[Noisebridge-discuss] Bridging my unused eth0 interface...

Jonathan Lassoff jof at thejof.com
Wed Oct 13 22:04:01 UTC 2010


On Wed, Oct 13, 2010 at 2:50 PM, Jason Dusek <jason.dusek at gmail.com> wrote:
>  The list seems to be less exciting lately so I thought I'd
>  stir the pot a bit...
>
>  I am setting up LXC containers on my laptop. I always use
>  wifi, never the ethernet port; eth0 sits there unused all the
>  time. Can I bring it up even without plugging a cable in to
>  it, add it to a bridge and use it to communicate with the LXC
>  containers? That would be cool.

While I have no direct experience so far with Linux containers, I'm
pretty familiar with the networking code.


It is indeed possible to set an interface to be "UP" without having a
link present on the interface. The "UP" distinction is more of an "I
want this interface to be enabled" directive, whereas actually
detecting a "link" to the underlying media is a separate abstraction.

You can see this in action with the iproute2 "ip" utility. Running "ip
link show dev eth0" will show something like:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP qlen 1000

when a link is detected, and

2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

when it's "UP" but there's no link. Notice the "LOWER_UP" flag on the interface.


>  According to my reading, bridging wifi in Linux is a mess.

I'll agree that the Linux wireless driver code is a little crazy, but
once the device is configured and associated to a network, it acts
just like another Ethernet interface that can be added/removed from a
bridge.


If you're using network namespaces in the kernel, it's possible to
assign eth0 to another instance, but I'm not sure if it can bridge
from one namespace to another.
I'd imagine some isolated pair of dummy interfaces between containers
would be needed, a la Xen's vethX/vifX pairs that shuttle frames back
and forth. Maybe some tun/tap hack could do it?



More information about the Noisebridge-discuss mailing list