1

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 169.254.0.0/16 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.

1 Answer 1

0

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.

2
  • How do I do what you suggested (setting up zeroconf bridging)?
    – xyzzyrz
    Commented Apr 21, 2015 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. Commented Apr 21, 2015 at 18:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .