Openstack Victoria SRIOV doesn't have the required PCI devices - openstack

I have followed the Openstack Victoria documentation to configure SRIOV (https://docs.openstack.org/neutron/victoria/admin/config-sriov.html) and I think I am missing something since when creating the port over the SRIOV network that has configured the network provider physnet3 does not find the PCI device.
My servers:
controller: host02
compute: hots09
My settings:
compute host09:
cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-5.4.0-72-generic root=/dev/mapper/vg0-lv--root ro isolcpus=42-55 maybe-ubiquity intel_iommu=on iommu=pt hugepagesz=1G hugepages=32 default_hugepagesz=1G transparent_hugepage=never
lspci -v | grep Mel
02:00.0 Ethernet controller: Mellanox Technologies MT27520 Family [ConnectX-3 Pro]
86:00.0 Ethernet controller: Mellanox Technologies MT27520 Family [ConnectX-3 Pro]
86:00.1 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:00.2 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:00.3 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:00.4 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:00.5 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:00.6 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:00.7 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:01.0 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:01.1 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:01.2 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:01.3 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:01.4 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:01.5 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:01.6 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:01.7 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:02.0 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:02.1 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:02.2 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:02.3 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:02.4 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:02.5 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:02.6 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:02.7 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:03.0 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:03.1 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:03.2 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:03.3 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:03.4 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:03.5 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:03.6 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:03.7 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
86:04.0 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
cat /etc/nova/nova.conf | grep -v "\#" | sed '/^[[:space:]]*$/d'
[DEFAULT]
my_ip =
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
log_dir = /var/log/nova
transport_url = rabbit://
use_neutron = True
linuxnet_interface_driver = nova.network.linux_net.LinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
vif_plugging_is_fatal = True
vif_plugging_timeout = 300
cpu_allocation_ratio = 3.0
reserved_huge_pages = node:0,size:1GB,count:1
reserved_huge_pages = node:1,size:1GB,count:1
vcpu_pin_set = 42-55
[filter_scheduler]
available_filters=nova.scheduler.filters.all_filters
enabled_filters=AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,PciPassthroughFilter,NUMATopologyFilter,AggregateInstanceExtraSpecsFilter
[api]
auth_strategy = keystone
[vnc]
enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://
[glance]
api_servers = http://
[oslo_concurrency]
lock_path = $state_path/tmp
[keystone_authtoken]
www_authenticate_uri = http://
auth_url = http://
memcached_servers =
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username =
password =
[placement]
auth_url = http://
os_region_name = RegionOne
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username =
password =
[wsgi]
api_paste_config = /etc/nova/api-paste.ini
[neutron]
auth_url = http://
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username =
password =
service_metadata_proxy = True
metadata_proxy_shared_secret =
[cinder]
os_region_name = RegionOne
[pci]
passthrough_whitelist = { "devname": "enp134s0", "physical_network": "physnet3", "trusted":"true", "devname": "enp134s0d1", "physical_network": "physnet4", "trusted":"true"}
cat /etc/neutron/plugins/ml2/ml2_conf.ini | grep -v "\#" | sed '/^[[:space:]]*$/d'
[DEFAULT]
path_mtu = 1550
physical_network_mtus = physnet1:1550
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge
extension_drivers = port_security
path_mtu = 1550
segment_mtu = 1550
physical_network_mtus = physnet1:1500
[ml2_type_flat]
flat_networks = *
[ml2_type_geneve]
[ml2_type_gre]
[ml2_type_vlan]
network_vlan_ranges = physnet2:1500:1520
[ml2_type_vxlan]
vni_ranges = 1:1000
[ovs_driver]
[securitygroup]
[sriov_driver]
cat /etc/neutron/plugins/ml2/sriov_agent.ini | grep -v "\#" | sed '/^[[:space:]]*$/d'
[DEFAULT]
[agent]
[sriov_nic]
physical_device_mappings = physnet3:enp134s0,physnet4:enp134s0d1
exclude_devices = enp134s0:86:02.1;86:02.2;86:02.3;86:02.4;86:02.5;86:02.6;86:02.7;86:03.0;86:03.1;86:03.2;86:03.3;86:03.4;86:03.5;86:03.6;86:03.7;86:04.0,enp134s0d1:86:00.1;86:00.2;86:00.3;86:00.4;86:00.5;86:00.6;86:00.7;86:01.0;86:01.1;86:01.2;86:01.3;86:01.4;86:01.5;86:01.6;86:01.7;86:02.0
[securitygroup]
firewall_driver = neutron.agent.firewall.NoopFirewallDriver
cat /etc/neutron/neutron.conf | grep -v "\#" | sed '/^[[:space:]]*$/d'
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
state_path = /var/lib/neutron
allow_overlapping_ips = True
transport_url = rabbit://
global_physnet_mtu = 1550
[agent]
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
[keystone_authtoken]
www_authenticate_uri = http://
auth_url = http://
memcached_servers =
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username =
password =
[oslo_concurrency]
lock_path = $state_path/lock
controller host02:
openstack network agent list --host host09
+--------------------------------------+--------------------+--------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+--------------+-------------------+-------+-------+---------------------------+
| 0ee3ac1e-8ea2-4da9-8143-3a71e4de130c | Metadata agent | host09 | None | :-) | UP | neutron-metadata-agent |
| 32b5a152-92eb-4a37-b513-8b6cbaf7ec31 | Linux bridge agent | host09 | None | :-) | UP | neutron-linuxbridge-agent |
| 89e0a1b1-ecfe-4af2-9c4a-9f355eecd38a | NIC Switch agent | host09 | None | :-) | UP | neutron-sriov-nic-agent |
| b8e51a2e-de07-4d62-b6b4-cbe6d545f8cf | DHCP agent | host09 | nova | :-) | UP | neutron-dhcp-agent |
+--------------------------------------+--------------------+--------------+-------------------+-------+-------+---------------------------+
openstack network agent list --host host02
+--------------------------------------+--------------------+--------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+--------------+-------------------+-------+-------+---------------------------+
| 59a0f618-a66f-44e6-9763-5d29f071d6da | Linux bridge agent | host02 | None | :-) | UP | neutron-linuxbridge-agent |
| de9daf1c-6325-4cff-ab0e-dd1be29b57e8 | L3 agent | host02 | nova | :-) | UP | neutron-l3-agent |
+--------------------------------------+--------------------+--------------+-------------------+-------+-------+---------------------------+
cat /etc/neutron/neutron.conf | grep -v "\#" | sed '/^[[:space:]]*$/d'
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
state_path = /var/lib/neutron
dhcp_agent_notification = True
allow_overlapping_ips = True
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
transport_url = rabbit://
global_physnet_mtu = 1550
[agent]
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
[keystone_authtoken]
www_authenticate_uri = http://
auth_url = http://
memcached_servers =
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username =
password =
[database]
connection = mysql+pymysql://neutron:
[nova]
auth_url = http://
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password =
[oslo_concurrency]
lock_path = $state_path/tmp
cat /etc/neutron/plugins/ml2/ml2_conf.ini | grep -v "\#" | sed '/^[[:space:]]*$/d'
[DEFAULT]
path_mtu = 1550
physical_network_mtus = physnet1:1550
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,sriovnicswitch
extension_drivers = port_security
path_mtu = 1550
segment_mtu = 1550
physical_network_mtus = physnet1:1500
[ml2_type_flat]
flat_networks = *
[ml2_type_geneve]
[ml2_type_gre]
[ml2_type_vlan]
network_vlan_ranges = physnet2:1500:1520,physnet3:1504:1506,physnet4:1504:1506
[ml2_type_vxlan]
vni_ranges = 1:1000
[ovs_driver]
[securitygroup]
[sriov_driver]
cat /etc/nova/nova.conf | grep -v "\#" | sed '/^[[:space:]]*$/d'
[DEFAULT]
my_ip =
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
log_dir = /var/log/nova
transport_url = rabbit://
use_neutron = True
linuxnet_interface_driver = nova.network.linux_net.LinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
vif_plugging_is_fatal = True
vif_plugging_timeout = 300
debug=true
[filter_scheduler]
available_filters=nova.scheduler.filters.all_filters
enabled_filters=AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAffinityFilter,PciPassthroughFilter,NUMATopologyFilter,AggregateInstanceExtraSpecsFilter
[api]
auth_strategy = keystone
[glance]
api_servers = http://
[oslo_concurrency]
lock_path = $state_path/tmp
[api_database]
connection = mysql+pymysql://
[database]
connection = mysql+pymysql://
[keystone_authtoken]
www_authenticate_uri = http://
auth_url = http://
memcached_servers =
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username =
password =
[placement]
auth_url = http://
os_region_name = RegionOne
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username =
password =
[wsgi]
api_paste_config = /etc/nova/api-paste.ini
[neutron]
auth_url = http://
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username =
password =
service_metadata_proxy = True
metadata_proxy_shared_secret =
openstack network show 61e37950-5944-44e1-81df-5aa3a94a016f
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | nova |
| created_at | 2021-04-19T15:52:42Z |
| description | |
| dns_domain | None |
| id | 61e37950-5944-44e1-81df-5aa3a94a016f |
| ipv4_address_scope | None |
| ipv6_address_scope | None |
| is_default | None |
| is_vlan_transparent | None |
| mtu | 1550 |
| name | sriov-net-1504 |
| port_security_enabled | True |
| project_id | 2467cb8a053d40f0a0a8af43d89d1c32 |
| provider:network_type | vlan |
| provider:physical_network | physnet3 |
| provider:segmentation_id | 1504 |
| qos_policy_id | None |
| revision_number | 2 |
| router:external | Internal |
| segments | None |
| shared | False |
| status | ACTIVE |
| subnets | e5dd4fa3-abe7-482c-8544-b73836c547cf |
| tags | |
| updated_at | 2021-04-19T15:59:34Z |
+---------------------------+--------------------------------------+
nova-scheduler.log
2021-04-20 02:26:08.344 450488 DEBUG nova.scheduler.filters.pci_passthrough_filter [req-dec3be12-9274-4733-94a1-7e29dc4b6de2 3b1d6ae009c94f99800bb1a53cedba4a 2467cb8a053d40f0a0a8af43d89d1c32 - default default] (
magma-host09, magma-host09) ram: 171084MB disk: 13312MB io_ops: 0 instances: 5 doesn't have the required PCI devices (InstancePCIRequests(instance_uuid=<?>,requests=[InstancePCIRequest])) host_passes /usr/lib/py
thon3/dist-packages/nova/scheduler/filters/pci_passthrough_filter.py:52
As you can see in the log of the nova scheduler it does not find the PCI device
doesn't have the required PCI devices
I would greatly appreciate the help, regards.

I found the error, my passthrough_whitelist on nova compute was wrong:
wrong:
passthrough_whitelist = { "devname": "enp134s0", "physical_network": "physnet3", "trusted":"true", "devname": "enp134s0d1", "physical_network": "physnet4", "trusted":"true"}
Fixed multiple values:
passthrough_whitelist = { "devname": "enp134s0", "physical_network": "physnet3", "trusted":"true" }
passthrough_whitelist = { "devname": "enp134s0d1", "physical_network": "physnet4", "trusted":"true" }

Related

Unable to Connect to Rabbit MQ

I am using amazon service and created rabbitmq broker now from the DOT NET code i am trying to connect to this broker.
var factory = new ConnectionFactory
{
Uri = new Uri("amqps://it:Password#hostname:5671")
};
var connection = factory.CreateConnection();
I am struggle here to get connection getting below error :
None of the specified endpoints were reachable
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
Update:
It seems your client wants to connect using TLS/SSL (your uri specifies the protocol "amqps" and the port 5671).
Try enabling TLS/SSL:
var factory = new ConnectionFactory {
UserName = userName,
Password = password,
VirtualHost = "/",
HostName = hostName,
Port = port,
Ssl = new SslOption
{ Enabled = true, // <--------
ServerName = hostName }
};
The (JVM based) guide shows how to configure the connection factory. It sets the credentials on the factory, not in the URI:
ConnectionFactory factory = new ConnectionFactory();
factory.setUsername(username); // <----------
factory.setPassword(password); // <----------
//Replace the URL with your information
factory.setHost("b-c8352341-ec91-4a78-ad9c-a43f23d325bb.mq.us-west-2.amazonaws.com");
factory.setPort(5671);
// Allows client to establish a connection over TLS
factory.useSslProtocol()
// Create a connection
Connection conn = factory.newConnection();
(This needs to be translated to the corresponding .NET code)

how to pass url in request through upstream proxy using Nginx

How to pass our client request through Authorized upstream proxy to specific web address ?
I have to enter username/password to connect an upstream proxy and then open some web page in my browser (for example jj.com) in HTTP and HTTPS protocol (I can set that in Firefox manual proxy options).
So I want make a way to get access for other client to open jj.com whitout need to know and enter username/password and open web page (like jj.com) in her/his browser through NginX.
+--------------------+ +---------------------+
| | | upstramProxy:9090 | +----------+
| Client browser | | user:user-003 |+----->| jj.com |
| | | pass:123456 |<------+----------+
+--------------------+ +---------------------+
| ^ (myProxyService.com:8080/pr?url=jj.com) | ^
| | | |
| | | |
| | +---------------------+
| +--------------------------------| myProxyService.com |
| | NginX in myServer |
+---------------------------------->| Listen to 8080 |
+---------------------+
Is it possible ?
If there is any other approach I want to know.
Simple java web application in witch java send all request through third party proxy named : myProxyServer
public static void processRequest(HttpServletRequest req, HttpServletResponse resp) {
try {
PrintWriter out = resp.getWriter();
System.out.println(req.getRequestURI());
System.out.println(req.getRequestURL());
jjTools.ShowAllParameter(req);
final BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(
new AuthScope("thirdpartyProxy.com", 8080),
new UsernamePasswordCredentials("username", "passss".toCharArray())
);
try (final CloseableHttpClient httpclient = HttpClients.custom()
.setDefaultCredentialsProvider(credsProvider).build()) {
final HttpHost target = new HttpHost("https", "www.targetwebSite.com", 443);
final HttpHost proxy = new HttpHost("http", "thirdpartyProxy.com", 8080);
final RequestConfig config = RequestConfig.custom()
.setProxy(proxy)
.setCircularRedirectsAllowed(true)
.build();
final HttpGet httpget = new HttpGet(req.getRequestURI().replaceFirst("/My_Proxy/", "/"));
httpget.setConfig(config);
System.out.println("Executing request " + httpget.getMethod() + " " + httpget.getUri()
+ " via " + proxy);
try (final CloseableHttpResponse response = httpclient.execute(target, httpget)) {
System.out.println("----------------------------------------");
resp.setContentType(response.getHeader("Content-Type").toString());
System.out.println(response.getHeader("Content-Type").toString());
System.out.println(response.getCode() + " " + response.getReasonPhrase());
out.print(EntityUtils.toString(response.getEntity())+"<scipt>alert");
}
}
out.close();
} catch (Exception ex) {
Logger.getLogger(Listener.class.getName()).log(Level.SEVERE, null, ex);
}
}
Then you have to config nginX.conf like the code below:
server {
listen 80;
server_name targetwebSite.localhost;
location / {
#proxy_set_header X-Forwarded-Host $host;
#proxy_set_header X-Forwarded-Server $host;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/My_Proxy/;
}
}
And for result it will be working for all page with its CSS and JavaScript files in
http : / / targetwebSite.localhost /
address
note: It have some problem with cookie and accept cookie policies in browser
https://www.tutorialspoint.com/apache_httpclient/apache_httpclient_using_proxy.htm

What is the difference between assigning machine to network by port or by network name?

I use Terraform trying to setup my infrastructure on OVH.
From docs I see that I can connect compute instance to network either by name:
resource "openstack_compute_instance_v2" "front" {
network {
name = "Ext-Net"
}
}
or by port (then you need to create port entity):
data "openstack_networking_network_v2" "ext_net" {
name = "Ext-Net"
}
resource "openstack_networking_port_v2" "public_port" {
name = "public_port"
network_id = "${data.openstack_networking_network_v2.ext_net.id}"
admin_state_up = "true"
}
resource "openstack_compute_instance_v2" "front" {
network {
port = "${openstack_networking_port_v2. public_port.id}"
}
}
There is also a 3rd option (connect by network's uuid, but it is quite similar to network name).
In which case I should use port instead of network name?
Also when I connect both interfaces by name and ssh to freshly booted compute instance, I can see that ipv4 for internal network is not set as expected. Is it ok for OVH and I should set 10.0.0.1 manually with some kind of provisioning script?
network = [
{
name = "Ext-Net"
},
{
name = "internal"
fixed_ip_v4 = "10.0.0.1"
}
]

SMTP Error (-1): Connection to server failed | can't sent mails

Fresh installation (postfix-dovecote-roundcode) without reserving domain name just VPS IP i can't sent any mail from web but i can sent normally from terminal, it'r return SMTP Error (-1): Connection to server failed
/var/log/mail.log
Jan 7 05:28:04 mail postfix/submission/smtpd[9541]: connect from localhost[127.0.0.1]
Jan 7 05:28:04 mail postfix/submission/smtpd[9541]: lost connection after UNKNOWN from localhost[127.0.0.1]
Jan 7 05:28:04 mail postfix/submission/smtpd[9541]: disconnect from localhost[127.0.0.1]
Jan 7 05:33:06 mail postfix/submission/smtpd[9607]: connect from localhost[127.0.0.1]
Jan 7 05:33:06 mail postfix/submission/smtpd[9607]: lost connection after UNKNOWN from localhost[127.0.0.1]
Jan 7 05:33:06 mail postfix/submission/smtpd[9607]: disconnect from localhost[127.0.0.1]
/var/log/nginx/error.log
2018/01/07 05:33:06 [error] 9504#0: *1 FastCGI sent in stderr: "PHP message: fsockopen(): unable to connect to ssl://mail.test.com:587 (Unknown error) (0):
PHP message: Failed to connect socket: fsockopen(): unable to connect to ssl://mail.test.com:587 (Unknown error) ():" while reading response header from upstream, client: 16.196.246.136, server: , request: "POST /rcm/?_task=mail&_unlock=loading1515303186377&_lang=en&_framed=1 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "", referrer: "https://X.x.x.x/rcm/?_task=mail&_id=5005492295a51afd366fe3&_action=compose"
Conf
root#mail:~# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = localhost
myhostname = mail.test.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_security_level = may
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_tls_security_level = may
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf mysql:/etc/postfix/mysql-virtual-email2email.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
10-master.conf
root#mail:~# grep -v "#" /etc/dovecot/conf.d/10-master.conf
service imap-login {
inet_listener imap {
port = 0
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service pop3-login {
inet_listener pop3 {
port = 0
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
mode = 0600
user = postfix
group = postfix
}
}
service imap {
}
service pop3 {
}
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0600
user = postfix
group = postfix
}
unix_listener auth-userdb {
mode = 0600
user = vmail
}
user = dovecot
}
service auth-worker {
user = vmail
}
service dict {
unix_listener dict {
}
}
root#mail:~# hostname
mail
root#mail:~# cat /etc/hosts
127.0.0.1 localhost mail mail.test.com test.com
i found the solution it's on the configuration file
$config['smtp_server'] = 'tls://mail.com'
it should be tls not ssl :)
Shouldn't this:
ssl://mail.test.com:587
be this?
ssl://localhost:587
I believe roundcube needs "localhost" set as the mailserver address, but from the logs it looks to me like it might be set to use "mail.test.com"
If mail.test.com is your VPS - that only exists on IP, not DNS - then there is no way to route to it using that address, so roundcube on the same server will not be able to find it.
If roundcube is on the same server, the mailserver address it uses should be set to "localhost" anyway.

the wired network connection is active ,but can't connect to the internet

The operating system is Ubuntu10.04. The icon of network connection on the panel shows
the wired network connection is active, but I can't access to the Internet. So I set the network configuration manually.I changed the /etc/resolv.conf as below:
nameserver 202.112.14.151
202.112.14.151 is my school's DNS server's IP. 192.168.2.1 is router' address. I also changed the /etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.2.107
netmask 255.255.255.0
gateway 192.168.2.1
And /var/run/network/ifstate:
lo=lo
eth0=eth0
My classmates (we'are in the same room and use the same router) used
address:192.168.2.254
netmask:255.255.255.0
gateway:192.168.2.1
DNS server:202.112.14.151
to configure the network on Windows xp can access to the Internet.
I typed the command ping 192.168.2.1 but it reminds me the host 192.168.2.1 is unreachable. Do I neglect something? Please tell me, Thx!
If 192.168.2.1 is unreachable, there is something wrong with your local area network. This could mean your adapter / cable, but you say the panel shows an active connection. Are you connected to the right switch / right port on the switch? Are you using the right kind of cable (try changing)?
Try ping 192.168.2.255 to see if you can reach any nodes on the network.
Here The Solution
` public static void main(String[] args) {
String IP;
try {
InetAddress ip = InetAddress.getLocalHost();
IP=ip.getHostAddress();
//Host NET ID
System.out.println("Current IP address : " + IP);
NetworkInterface network = NetworkInterface.getByInetAddress(ip);
byte[] mac = network.getHardwareAddress();
//Type
System.out.println("Type Eth0/wlan :"+network.getName());
//SubNet Prefix
System.out.println("SubNet ID :"+network.getInterfaceAddresses().get(0).getNetworkPrefixLength());
System.out.println();
//HostName
System.out.println("HostName :"+ip.getHostName());
//MAC
System.out.print("Current MAC address : ");
StringBuilder sb = new StringBuilder();
for (int i = 0; i < mac.length; i++) {
sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : ""));
}
System.out.println(sb.toString());
InetAddress i = InetAddress.getLocalHost();
byte[] ip1 = i.getAddress();
for (int b = 0; b <255;b++) {
ip1[3] = (byte)b;
InetAddress address = InetAddress.getByAddress(ip1);
if (address.isReachable(3000)) {
System.out.println("\tIP :"+address.getHostAddress());
NetworkInterface network1 = NetworkInterface.getByInetAddress(address);
System.out.println("Type Eth0/wlan :"+network.getName());
System.out.println();
} else if (!address.getHostAddress().equals(address.getHostName())) {
System.out.println("\tIP :"+address.getHostAddress());
} else {
System.out.println("NO");
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}`
Output

Resources