注: 192.168.48.142 为 floating ip
ping 测试
[root@station140 ~(keystone_admin)]# ping 192.168.48.142 PING 192.168.48.142 (192.168.48.142) 56(84) bytes of data. 64 bytes from 192.168.48.142: icmp_seq=1 ttl=63 time=1.61 ms
ssh 测试
[root@station140 ~(keystone_admin)]# ssh 192.168.48.142 The authenticity of host '192.168.48.142 (192.168.48.142)' can't be established. RSA key fingerprint is 7f:cc:6e:22:e4:39:99:6a:4c:de:4a:82:df:e9:1c:6c. Are you sure you want to continue connecting (yes/no)?
ip netns 空间测试方法
查询路由方法
[root@station140 ~(keystone_admin)]# neutron router-list | grep -v router1 +--------------------------------------+------------+-----------------------------------------------------------------------------+ | id | name | external_gateway_info | +--------------------------------------+------------+-----------------------------------------------------------------------------+ | b83f43cd-bf8f-42f8-812a-708c2c372820 | ext-to-int | {"network_id": "aebe75f0-6013-4a5e-bbd9-cb81e1f017bc", "enable_snat": true} | +--------------------------------------+------------+-----------------------------------------------------------------------------+
列出网络命名空间
[root@station140 ~(keystone_admin)]# ip netns qrouter-59fa152c-df2e-43e4-9d09-7b89fb9cce5d qdhcp-dc121f2d-1b3b-471f-8fe7-15ef973b949e qrouter-99859660-68fe-4be4-835a-073a05da6533 qrouter-b83f43cd-bf8f-42f8-812a-708c2c372820 qdhcp-d0e3f988-d62f-4f95-ab21-b73f4dae326b qdhcp-e8e14001-44d9-4ab1-a462-ea621b8a4746
利用网络命名空间进行操作例 1
[root@station140 ~(keystone_admin)]# ip netns exec qrouter-b83f43cd-bf8f-42f8-812a-708c2c372820 ip addr list 32: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 33: qg-5a8b8f30-f5: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN link/ether fa:16:3e:6f:b7:1c brd ff:ff:ff:ff:ff:ff inet 192.168.48.143/24 brd 192.168.48.255 scope global qg-5a8b8f30-f5 inet 192.168.48.142/32 brd 192.168.48.142 scope global qg-5a8b8f30-f5 inet6 fe80::f816:3eff:fe6f:b71c/64 scope link valid_lft forever preferred_lft forever 34: qr-bbfe84a2-50: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN link/ether fa:16:3e:1c:fd:1e brd ff:ff:ff:ff:ff:ff inet 10.0.0.1/8 brd 10.255.255.255 scope global qr-bbfe84a2-50 inet6 fe80::f816:3eff:fe1c:fd1e/64 scope link valid_lft forever preferred_lft forever
利用网络命名空间进行操作例 2
[root@station140 ~(keystone_admin)]# ip netns exec qrouter-b83f43cd-bf8f-42f8-812a-708c2c372820 ping 192.168.48.142 PING 192.168.48.142 (192.168.48.142) 56(84) bytes of data. 64 bytes from 192.168.48.142: icmp_seq=1 ttl=64 time=2.01 ms ^C --- 192.168.48.142 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 615ms rtt min/avg/max/mdev = 2.013/2.013/2.013/0.000 ms
[root@station140 ~(keystone_admin)]# ip netns exec qrouter-b83f43cd-bf8f-42f8-812a-708c2c372820 ping 10.0.0.50 PING 10.0.0.50 (10.0.0.50) 56(84) bytes of data. 64 bytes from 10.0.0.50: icmp_seq=1 ttl=64 time=2.27 ms