[Lxc-users] local routing
Ulli Horlacher
framstag at rus.uni-stuttgart.de
Wed May 11 12:40:05 UTC 2011
On Wed 2011-05-11 (11:29), Daniel Lezcano wrote:
> If you create a bridge, attach the physical interface to it, give the
> bridge the ip address you usually give to eth0, (make sure ifconfig eth0
> 0.0.0.0) and then give an IP address to the container on the same
> network than eth0, that will allow to have your container to communicate
> on the network and the host without passing through a gateway.
This is already working. Example (vms2 is the host):
root at vms2:~# lxc -l
container size (MB) start-PID status
flupp 33202 5251 running
ubuntu 490 0 stopped
vmtest8 490 5664 running
root at vms2:~# host vms2
vms2.rus.uni-stuttgart.de has address 129.69.1.68
root at vms2:~# host flupp
flupp.rus.uni-stuttgart.de has address 129.69.1.219
root at vms2:~# traceroute flupp
traceroute to flupp (129.69.1.219), 30 hops max, 60 byte packets
1 flupp.rus.uni-stuttgart.de (129.69.1.219) 16.533 ms 16.537 ms 16.538 ms
But I have other containers on other networks, too. Example:
root at vms2:~# host vmtest8
vmtest8.rus.uni-stuttgart.de has address 129.69.8.6
root at vms2:~# traceroute vmtest8
traceroute to vmtest8 (129.69.8.6), 30 hops max, 60 byte packets
1 ar30a-y2g-rus-1.rus.uni-stuttgart.de (129.69.1.251) 0.674 ms 0.734 ms 0.793 ms
2 * * *
vmtest8 has no internet connection so far, because the VLAN setup is not
correct. But this is another problem :-}
Nevertheless the host vms2 should reach the container vmtest8 directly
(internaly) without using an external router.
I can obtain this by setting host routes on vms2 and vmtest8, as I have
described in my first mail. Then host and container can reach each other
directly. What I now want is some kind of automatism. I do not want to set
such host routes manually, every time I use lxc-start.
--
Ullrich Horlacher Server- und Arbeitsplatzsysteme
Rechenzentrum E-Mail: horlacher at rus.uni-stuttgart.de
Universitaet Stuttgart Tel: ++49-711-685-65868
Allmandring 30 Fax: ++49-711-682357
70550 Stuttgart (Germany) WWW: http://www.rus.uni-stuttgart.de/
More information about the lxc-users
mailing list