ping baidu.com的ip,是没有问题,但ping baidu.com的域名,就不通
[root@sztech1-centos7 ~]# ping 111.13.101.208
PING 111.13.101.208 (111.13.101.208) 56(84) bytes of data.
64 bytes from 111.13.101.208: icmp_seq=1 ttl=127 time=58.3 ms
64 bytes from 111.13.101.208: icmp_seq=2 ttl=127 time=57.9 ms
64 bytes from 111.13.101.208: icmp_seq=3 ttl=127 time=54.6 ms
64 bytes from 111.13.101.208: icmp_seq=4 ttl=127 time=67.5 ms
64 bytes from 111.13.101.208: icmp_seq=5 ttl=127 time=56.7 ms
^C
--- 111.13.101.208 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4032ms
rtt min/avg/max/mdev = 54.697/59.080/67.556/4.427 ms
[root@sztech1-centos7 ~]# ping baidu.com
ping: baidu.com: Name or service not known
察看控制器里面provider子网信息没有问题:
[root@controller ~]# openstack subnet show public-sub
+-------------------------+--------------------------------------+
| Field | Value |
+-------------------------+--------------------------------------+
| allocation_pools | 192.168.133.30-192.168.133.50 |
| cidr | 192.168.133.0/24 |
| created_at | 2017-11-01T10:20:34Z |
| description | |
| dns_nameservers | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 192.168.133.2 |
| host_routes | |
| id | 8865f81d-c9d5-4469-9d82-78219fbca0eb |
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| name | public-sub |
| network_id | c9d6d6f1-8d9a-4c5f-a5d0-192a2e23d86d |
| project_id | 734ac639424c421492f38c617b7d06f9 |
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2017-11-01T10:20:34Z |
| use_default_subnet_pool | None |
+-------------------------+--------------------------------------+
后来,看虚拟机里面的/etc/resolv.conf
[root@sztech1-centos7 network-scripts]# cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
search openstacklocal
nameserver 10.10.0.2
发现这里的dns 为 10.10.0.2,修改为8.8.8.8,就好了 :
[root@sztech1-centos7 network-scripts]# vi /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
search openstacklocal
nameserver 8.8.8.8
再去测试,就好了 :
[root@sztech1-centos7 network-scripts]# ping baidu.com
PING baidu.com (123.125.114.144) 56(84) bytes of data.
64 bytes from 123.125.114.144 (123.125.114.144): icmp_seq=1 ttl=127 time=50.8 ms
64 bytes from 123.125.114.144 (123.125.114.144): icmp_seq=2 ttl=127 time=48.2 ms
64 bytes from 123.125.114.144 (123.125.114.144): icmp_seq=3 ttl=127 time=47.2 ms
|