[Lxc-users] Routing from lxc guest to a directly connected network to host.
Luis M. Ibarra
michael.ibarra at gmail.com
Thu Jul 25 15:45:00 UTC 2013
Ok, I just figured out what's going on.. The network 192.168.1.0 doesn't
have a route to known the hosts in the network 192.168.5.0.
Is it possible to NAT all the lxc network to route to the 192.168.1.0?
2013/7/25 Luis M. Ibarra <michael.ibarra at gmail.com>
> Hi Tony,
>
> I forgort to add the ip addresses of the host and the guest:
>
> Host: 192.168.5.154
> Guest: 192.168.5.215
> GW connected to Internet: 192.168.5.1
>
> Tony, you were right, I just tested and the host it's connecting to all
> the 192.168.5.0 using 192.168.5.154 as a default gateway. However, I can't
> ping or make a connection to any host in the 192.168.1.0 from the guest.
>
> lxc HOST routing table:
>
>
> #route -n
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use
> Iface
> 192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
> 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
> eth1
> 0.0.0.0 192.168.5.1 0.0.0.0 UG 0 0
> 0 br0
>
> Testing from the HOST to 192.168.1.0 network:
> #ping 192.168.1.21
> PING 192.168.1.21 (192.168.1.41) 56(84) bytes of data.
> 64 bytes from 192.168.1.21: icmp_seq=1 ttl=64 time=0.148 ms
> 64 bytes from 192.168.1.21: icmp_seq=2 ttl=64 time=0.104 ms
> 64 bytes from 192.168.1.21: icmp_seq=3 ttl=64 time=0.110 ms
> ^C
> --- 192.168.1.21 ping statistics ---
> 3 packets transmitted, 3 received, 0% packet loss, time 2429ms
> rtt min/avg/max/mdev = 0.104/0.120/0.148/0.023 ms
>
>
> GUEST routing table:
>
> # route -n
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref
> Use Iface
> 192.168.5.0 0.0.0.0 255.255.255.0 U 0
> 0 0 eth0
> 169.254.0.0 0.0.0.0 255.255.0.0 U 1002
> 0 0 eth0
> 0.0.0.0 192.168.5.154 0.0.0.0 UG
> 0 0 0 eth0
>
>
> Testing from the GUEST to 192.168.1.0 network:
> #ping 192.168.1.21
> PING 192.168.1.21 (192.168.1.21) 56(84) bytes of data.
> ^C
> --- 192.168.1.41 ping statistics ---
> 90 packets transmitted, 0 received, 100% packet loss, time 89100ms
>
>
>
> 2013/7/25 Tony Su <tonysu at su-networking.com>
>
>> Hello Luis,
>> Your host routing table specifically identifies the DGW as 192.168.5.1
>> (the last line)
>>
>> why would you think you could "go anywhere" without a DGW?
>>
>> Tony
>>
>
>
>
>> On Jul 25, 2013 7:08 AM, "Luis M. Ibarra" <michael.ibarra at gmail.com>
>> wrote:
>>
>>> Hi everybody,
>>>
>>> I run over this issue. I have an lxc host with this routing table:
>>>
>>> #route -n
>>> Kernel IP routing table
>>> Destination Gateway Genmask Flags Metric Ref Use
>>> Iface
>>> 192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0
>>> br0
>>> 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
>>> eth1
>>> 0.0.0.0 192.168.5.1 0.0.0.0 UG 0 0 0
>>> br0
>>>
>>> and
>>> #cat /proc/sys/net/ipv4/ip_forward
>>> 1
>>>
>>>
>>> and an lxc guest with:
>>> # route -n
>>> Kernel IP routing table
>>> Destination Gateway Genmask Flags Metric Ref
>>> Use Iface
>>> 192.168.5.0 0.0.0.0 255.255.255.0 U 0
>>> 0 0 eth0
>>> 169.254.0.0 0.0.0.0 255.255.0.0 U 1002
>>> 0 0 eth0
>>> 0.0.0.0 192.168.5.154 0.0.0.0 UG
>>> 0 0 0 eth0
>>>
>>> with this configuration packets can't go anywhere. If I change the
>>> default gw of the lxc guest to 192.158.5.1 at least I get all the network
>>> 192.158.5.0.
>>>
>>> My question, why am I missing to get this working?
>>>
>>>
>>>
>>>
>>> --
>>> Luis M. Ibarra
>>>
>>> ------------------------------------------------------------------------------
>>> See everything from the browser to the database with AppDynamics
>>> Get end-to-end visibility with application monitoring from AppDynamics
>>> Isolate bottlenecks and diagnose root cause in seconds.
>>> Start your free trial of AppDynamics Pro today!
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Lxc-users mailing list
>>> Lxc-users at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/lxc-users
>>>
>>>
>
>
> --
> Luis M. Ibarra
--
Luis M. Ibarra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130725/8683a80c/attachment.html>
More information about the lxc-users
mailing list