Understanding container networking (NAT) [message #48779] |
Wed, 21 November 2012 07:01 |
chacha
Messages: 1 Registered: November 2012 Location: QLD
|
Junior Member |
|
|
Hi,
Under a NAT setup (ip_forward enabled), I issued the following to create two containers -
vzctl create 101 --ostemplate centos-6-x86_64 --config basic --ipadd 192.168.3.101
vzctl set 101 --nameserver 8.8.8.8 --userpasswd root:xxxx --save
vzctl create 102 --ostemplate centos-6-x86_64 --config basic --ipadd 192.168.3.102
vzctl set 102 --nameserver 8.8.8.8 --userpasswd root:xxxx --save
I boot up the containers and connect to the first. The routing table shows as follows -
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 venet0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 venet0
I change the masks on both containers to /24 (they were /32 by default).
(Still connected to the first container) I traceroute to the second container (192.168.3.102) I see the following -
traceroute to 192.168.3.102 (192.168.3.102), 30 hops max, 60 byte packets
1 192.168.2.200 (192.168.2.200) 0.045 ms 0.011 ms 0.010 ms
2 192.168.3.102 (192.168.3.102) 0.021 ms 0.014 ms 0.013 ms
I had assumed that both containers would be on the same network segment. I don't understand why the first hop is the HN? (192.168.2.200)? Wouldn't they be on the same virtual switch?
Thanks.
|
|
|