[lxc-users] Networking: virtual interface name

Jäkel, Guido G.Jaekel at dnb.de
Thu Aug 14 12:04:15 UTC 2014


>On 08/13/2014 07:31 PM, Garrett Gauthier wrote:
>
>
>
>	To keep accounting for network traffic for each container, I need to know the virtual interface name.  The problem is
>that each time my container starts I get a new interface created on the host, something like vethCSR894, it is never the same.
>I have tried by using lxc.network.veth.pair but that parameter is ignored and a new interace pair is cerated each time
>VETH##### (Host) ↔ ETH0 (Container).
>
>	So bottom line I want to create a virtual interface that is connected to my bridge and force the container to use that
>interface each time.
>
>
>	 I used Cacti but any tool has the same issue as the interface name is randomly generated each time the container
>starts.
>
>	Any help would be appreciated.
>
>
>
>It works for me:
>
>lxc.network.veth.pair = veth_da-ipa-0


I'm even using something like

	lxc-start [...] -s lxc.network.veth.pair=$CONTAINER

in my lxc wrapper. Notice, that you can't "overwrite" an existing config file entry because multiple container interfaces are declared by repeating the "lxc.network" tags.


Guido

	


More information about the lxc-users mailing list