[lxc-users] venet like networking in LXC possible ?
Marc MAURICE
marc.maurice at objectif-libre.com
Wed May 21 15:34:21 UTC 2014
Thanks a lot.
I tried the config and it's *almost* working.
When pinging the output from the container : packets are going out with
the good MAC.
However, nothing in return.
From tcpdumps I figured out that my parent host is not responding to
arp for the container IP.
How do I tell my host to respond to those arp queries ?
I found some post on how it's done with openvz venet :
http://forum.openvz.org/index.php?t=msg&goto=35611&
Any clue ?
Le 21/05/2014 16:41, Fajar A. Nugraha a écrit :
> On Wed, May 21, 2014 at 9:19 PM, Marc MAURICE
> <marc.maurice at objectif-libre.com> wrote:
>>>> I finally made it work with veth mode, and a bridge on the host, but it's
>>>> frustrating.
>>>> And I have to manually generate and allow all mac adresses (required by
>>>> my
>>>> server hoster).
>>>
>>> I'd just comment on this one first.
>>>
>>> What is your hoster like? Is it like serverloft where you can buy
>>> additional IPs (one IP, /32 each) and the hoster would route the
>>> additional IPs thru the server's primary IP?
>> It's Online.net (french)
>> I think it's exactly the way you describe.
>>
>>
>>> If yes, then you can use a custom veth + bridge + routed mode where
>>> the hoster's switch/router will only see one MAC.
>>>
>> That would work I think. Do you have some doc/exemple on that ?
>
> I use ubuntu precise on both server and container. On the server:
>
> ### snippet of /etc/network/interface ###
> auto br0
> iface br0 inet static
> address 192.168.124.1
> netmask 255.255.255.0
> bridge_ports none
> bridge_maxwait 0
> bridge_stp off
> bridge_fd 0
> up ip route add PUBLIC_IP_OF_CONTAINER/32 dev br0 || true
> ###
>
> ... and make sure /proc/sys/net/ipv4/ip_forward is 1 (lxc-net ubuntu
> package should already set that)
>
> ### snippet of container config ###
> # Network configuration
> lxc.network.type = veth
> lxc.network.flags = up
> lxc.network.link = br0
> lxc.network.hwaddr = 00:16:3E:D8:FF:13
> lxc.network.veth.pair=veth-CONT1-0
> ###
>
>
>
> on the container:
> ###
> auto eth0
> iface eth0 inet static
> address PUBLIC_IP_OF_CONTAINER
> netmask 255.255.255.255
> up ip route add 192.168.124.1 dev eth0
> up ip route add default via 192.168.124.1
> ###
>
More information about the lxc-users
mailing list