Ask Your Question
0

How do I ping guests from host?

asked 2014-11-13 22:17:24 -0500

Tim Potter gravatar image

I have a working Icehouse install on a single node - per-tenant networks, floating IPs bridging to my local network - everything is working fine. I'm curious though how I can access one of the tenant networks from the host. Is this possible?

My first thought that simply assigning an IP address to the br-int port that's congruent with the tenant network would work, but it doesn't. For example if I have an external network 192.168.1.0/24, a tenant network 10.0.0.0/24 if I run ifconfig br-int 10.0.0.99 net mask 255.255.255.0 I should be able to ping a VM on that network with an address of 10.0.0.5 right? It works for the br-ex port so I'm trying to understand how the same thing on br-int not working fits in with my mental model of neutron.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-11-13 23:36:28 -0500

dbaxps gravatar image

You can access your tenants networks via qdhcp-namespace. Sample follows bellow :-
First

[root@juno1 nova(keystone_admin)]# neutron net-list
+--------------------------------------+---------------+-----------------------------------------------------+
| id                                   | name          | subnets                                             |
+--------------------------------------+---------------+-----------------------------------------------------+
| f0df774f-a892-4dd7-a2e9-14ae4051df1a | demo_net      | 132341e9-b014-4126-afd3-55fd2cbeb3ca 40.0.0.0/24    |
| fd446da9-d0d8-4d78-9282-a78325dbb91d | demo_net01    | 5b074024-20a0-45c8-873f-80a6a5132a34 70.0.0.0/24    |
| 65cbd354-daae-41bb-9d3c-e58b1062be19 | public        | 147d5ecd-fe39-489e-8901-3b20a2c50148 192.168.1.0/24 |
| 45577666-657d-4f75-a3ab-9bc232f15203 | private_boris | ac209735-54cd-418f-9245-252c56f5eed7 50.0.0.0/24    |
| eb0a79de-1142-4f3c-9fc8-7a63ee565a24 | private       | f58beb24-1e2f-4b00-af55-c1b5ed04d4ad 60.0.0.0/24    |
+--------------------------------------+---------------+-----------------------------------------------------+
[root@juno1 nova(keystone_admin)]# ip netns | grep 45577666-657d-4f75-a3ab-9bc232f15203
qdhcp-45577666-657d-4f75-a3ab-9bc232f15203

Second

[root@juno1 nova(keystone_admin)]# ip netns exec qdhcp-45577666-657d-4f75-a3ab-9bc232f15203 ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap7a12f9b0-a4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 50.0.0.11  netmask 255.255.255.0  broadcast 50.0.0.255
        inet6 fe80::f816:3eff:fe29:fef1  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:29:fe:f1  txqueuelen 0  (Ethernet)
        RX packets 23  bytes 1824 (1.7 KiB)
        RX errors 0  dropped 5  overruns 0  frame 0
        TX packets 8  bytes 648 (648.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@juno1 nova(keystone_admin)]# ip netns exec qdhcp-45577666-657d-4f75-a3ab-9bc232f15203 route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         50.0.0.1        0.0.0.0         UG    0      0        0 tap7a12f9b0-a4
50.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 tap7a12f9b0-a4

Start VM with private IP 50.0.0.12

[root@juno1 nova(keystone_admin)]# ip netns exec qdhcp-45577666-657d-4f75-a3ab-9bc232f15203 ping -c 3 50.0.0.12
PING 50.0.0.12 (50.0.0.12) 56(84) bytes of data.
64 bytes from 50.0.0.12: icmp_seq=1 ttl=64 time=1.13 ms
64 bytes from 50.0.0.12: icmp_seq=2 ttl=64 time=0.281 ms
64 bytes from 50.0.0.12: icmp_seq=3 ttl=64 time=0.246 ms

Login :

[root@juno1 ~(keystone_admin)]# ip netns exec qdhcp-45577666-657d-4f75-a3ab-9bc232f15203 ssh -i oskey57.pem fedora@50.0.0.12
Last login: Thu Nov 13 17:41:16 2014
[fedora@vf20rx520711 ~]$ uname -a
Linux vf20rx520711.novalocal 3.16.7-200.fc20.x86_64 #1 SMP Thu Oct 30 18:12:41 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[fedora@vf20rx520711 ~]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 50.0.0.12  netmask 255.255.255.0  broadcast 50.0.0.255
        inet6 fe80::f816:3eff:fe5e:939b  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:5e:93:9b  txqueuelen 1000  (Ethernet)
        RX packets 13546  bytes 14130963 (13.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10171  bytes 3291816 (3.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier ...
(more)
edit flag offensive delete link more

Comments

Excellent - thanks!. Had read about network namespaces but it had not come together in my head until now. Am going to try out creating a veth interface pair to try and create a permanent bridge the two networks for a more permanent arrangement.

Tim Potter gravatar imageTim Potter ( 2014-11-16 18:07:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-13 22:17:24 -0500

Seen: 128 times

Last updated: Nov 13 '14