Live data from Hacker News

Linux Bridge – How it works

goyalankit.com

11–20 of 21 posts

Re: Linux Bridge – How it works

#11
post #9

You would probably prefer the netlink interface these days over the old ioctl interface to configure bridges. But for an introduction the older one is probably easier to explain.

Any reason netlink would be preferable if you're only making these calls <10 per minute?

Re: Linux Bridge – How it works

#12
post #11
post #9

You would probably prefer the netlink interface these days over the old ioctl interface to configure bridges. But for an introduction the older one is probably easier to explain.

Any reason netlink would be preferable if you're only making these calls <10 per minute?

You have access to far more parameters through Netlink than through ioctl. For bridges, this includes VLAN tagging, flood behavior, filtering behavior, per-port MAC learning, etc. Any recent development on bridges for Linux is only accessible through sysfs and netlink.

Re: Linux Bridge – How it works

#13
post #5

This only works with dedicated hardware, right? I can't just take an arbitrary board like the raspberry pi and do this?

Works fine on a pi with either usb interfaces or virtual ones.

If you want to experiment at a low cost, though, there's the Banana PI BPI-R1. A ~$70 linux ARM dev board with 5 GB ethernet interfaces.

Re: Linux Bridge – How it works

#14
post #13
post #5

This only works with dedicated hardware, right? I can't just take an arbitrary board like the raspberry pi and do this?

Works fine on a pi with either usb interfaces or virtual ones. If you want to experiment at a low cost, though, there's the Banana PI BPI-R1. A ~$70 linux ARM dev board with 5 GB ethernet interfaces.

You can even bridge an interface to a tun/tap device, which is quite useful for VPNs and doing your own packet-twiddling code.

Re: Linux Bridge – How it works

#15

Also check out Open vSwitch http://openvswitch.org/ We use it to add bridged adapters with VLAN tags to our hypervisors

I'm not sure if this is still the case but the linux bridge had(has?) a limit of 1024 ports. OVS does not have this. Also OVS can give you GRE and VXVLAN as well.

Re: Linux Bridge – How it works

#16
post #5

This only works with dedicated hardware, right? I can't just take an arbitrary board like the raspberry pi and do this?

You can also do this with a VLAN interface. At my recommendation, a friend set up Raspberry Pi at home connected to a VLAN capable switch to break that one Ethernet interface out to 7.

Re: Linux Bridge – How it works

#17
FYI: You can do this on the small scale using ProxyARP. I did this once on a network interface connected to the DSL modem, and then proxy ARPed between that interface and another DMZ interface, and it worked just fine. For the router, I set up an ARP on the DMZ interface with that interface's MAC for the router IP, and for each machine in the DMZ I set up the DSL network's MAC with the systems IPs. So each side would see the routers MAC when doing ARP, but when the router received it it would know to send it on to the other interface.

Bridging works great, but it's kind of fun to see this at the proxy ARP level.

Post reply on HN