<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
Le dimanche 15 mai 2011 à 19:26 +0200, Daniel Lezcano a écrit :
<BLOCKQUOTE TYPE=CITE>
<PRE>
On 05/15/2011 06:19 PM, David Touzeau wrote:
> Dear
>
> is it possible to point LXC container to a virtual interface ?
> I have only one interface 'eth1' and i would like LXC containers using
> "Virtual Interfaces"
> When running the LXC container the network card disapears and server
> network is down.
> I need to reboot the computer in order to retreive the eth1 main
> interface.
>
> I have these IP settings :
> eth1 Link encap:Ethernet HWaddr 00:0C:29:AD:40:A7
> inet adr:192.168.1.64 Bcast:192.168.1.255
> Masque:255.255.255.0
> adr inet6: fe80::20c:29ff:fead:40a7/64 Scope:Lien
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:1155 errors:0 dropped:0 overruns:0 frame:0
> TX packets:615 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 lg file transmission:1000
> RX bytes:635343 (620.4 KiB) TX bytes:61524 (60.0 KiB)
> Interruption:18 Adresse de base:0x2000
>
> eth1:1 Link encap:Ethernet HWaddr 00:0C:29:AD:40:A7
> inet adr:192.168.1.65 Bcast:192.168.1.255
> Masque:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> Interruption:18 Adresse de base:0x2000
>
> eth1:2 Link encap:Ethernet HWaddr 00:0C:29:AD:40:A7
> inet adr:192.168.1.66 Bcast:192.168.1.255
> Masque:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> Interruption:18 Adresse de base:0x2000
>
> eth1:3 Link encap:Ethernet HWaddr 00:0C:29:AD:40:A7
> inet adr:192.168.1.67 Bcast:192.168.1.255
> Masque:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> Interruption:18 Adresse de base:0x200
>
> And this configuration file.
>
> lxc.utsname =vps-1
> lxc.tty = 4
> lxc.pts = 1024
Remove these 4 lines
> lxc.network.type = phys
> lxc.network.flags = up
> lxc.network.link = eth1:3
> lxc.network.flags = up
and replace by:
lxc.network.type = macvlan
lxc.network.link = eth1
lxc.network.flags = up
Note the container won't be able to communicate with the host.
Otherwise you can use a veth + bridge configuration described at:
<A HREF="http://www.nsnam.org/wiki/index.php/HOWTO_Use_Linux_Containers_to_set_up_virtual_networks">http://www.nsnam.org/wiki/index.php/HOWTO_Use_Linux_Containers_to_set_up_virtual_networks</A>
Cheers
-- Daniel
</PRE>
</BLOCKQUOTE>
<BR>
Thanks Daniel<BR>
<BR>
So the "phys" is not compliance with "Virtual interfaces" ?<BR>
<BR>
When you said : "Note the container won't be able to communicate with the host."<BR>
is container can communicate with the world ? and is container should be contacted by the world (except the host) ?<BR>
<BR>
i have tried using veth+ bridge but it is not compliance when running LXC containers on host virtualized by ESXi<BR>
Containers can communicate with host but did not communicate with the entire network.<BR>
<BR>
Best regards<BR>
<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>