I have a machine (hostname foo) with two wired network interfaces, eth0 and eth1. When I connect another host bar to one of them (eth0), I can see in either one's NetworkManager that it's using "Link-Local Only" mode:

enter image description here

This works great—I can instantly communicate between the two hosts just with ping foo.local or ping bar.local.

However, as soon as I plug in a second host onto eth1, foo.local and bar.local become unreachable to each other, due to now having multiple overlapping routes. How do I fix this permanently, such that I don't need to repeat some ip incantations on each host every time I connect a host, and also minimize the amount of static IP configuration I have to do (I'd like to solve this in the most ZeroConfNetworking-ish way possible)? FWIW all machines are running Ubuntu 12.04.


The only simple way is to bridge both Ethernet interfaces (basically having your computer act as a switch). Then you will have only one route over the br0 bridge, and it'll use the learned MAC addresses to decide which Ethernet port to use for each host.

If you want to keep the interfaces separate, there really aren't any good solutions. IPv6 makes this somewhat easier, since the resolver (Avahi) can additionally return the interface (scope id) as part of AF_INET6 addresses... unfortunately, glibc's getaddrinfo() discards it by default.

  • How do I do what you suggested (setting up zeroconf bridging)? – Yang Apr 21 '15 at 16:42
  • @Yang: If your NetworkManager is relatively modern, nm-connection-editor will have an option to add bridge interfaces (Add → Virtual → Bridge). Create one, with both Ethernet ports as 'slaves', and configure IP addressing on it like you would normally. – grawity Apr 21 '15 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.