[avahi] Multiple link local interfaces
Herczeg Lars
Lars.Herczeg at haslerrail.com
Wed Oct 9 04:50:18 PDT 2013
Hello everybody
For the short question: how is RFC 3927, ch. 3 "Considerations for
Multiple Interfaces" to be handled with avahi-autoipd?
Following a longer explanation of what I'm trying to do: I have
avahi-autoipd installed on an embedded device with the following setup:
- one Ethernet port, eth0
- one IP-over-USB port, usb0
Both ports are configured to get an IP address via DHCP, both dropping
to an IPv4LL IP address, since no DHCP server serving the request, see
below:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:c2:a0:cf:79
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3603 errors:0 dropped:0 overruns:0 frame:0
TX packets:4647 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:367831 (359.2 KiB) TX bytes:1576515 (1.5 MiB)
Interrupt:148 Base address:0xa300
eth0:avahi Link encap:Ethernet HWaddr 00:50:c2:a0:cf:79
inet addr:169.254.10.78 Bcast:169.254.255.255
Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:148 Base address:0xa300
usb0 Link encap:Ethernet HWaddr 00:03:d9:00:00:00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:424 errors:0 dropped:0 overruns:0 frame:0
TX packets:1174 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39105 (38.1 KiB) TX bytes:437286 (427.0 KiB)
usb0:avahi Link encap:Ethernet HWaddr 00:03:d9:00:00:00
inet addr:169.254.2.182 Bcast:169.254.255.255
Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
The routing table on embedded side looks as follows:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
0.0.0.0 0.0.0.0 0.0.0.0 U 1002 0 0
eth0
0.0.0.0 0.0.0.0 0.0.0.0 U 1003 0 0
usb0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0
usb0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0
eth0
192.168.255.2 0.0.0.0 255.255.255.255 UH 0 0 0
ppp0
On the other side I have connected a PC, with the following setup:
C:\>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Autoconfiguration IP Address. . . : 169.254.42.77
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
Ethernet adapter Local Area Connection 2:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 169.254.2.3
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
And the routing table on PC side looks as follows:
C:\>netstat -r
========================================================================
===
Active Routes:
Network Destination Netmask Gateway Interface
Metric
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1
1
169.254.0.0 255.255.0.0 169.254.2.3 169.254.2.3
30
169.254.0.0 255.255.0.0 169.254.42.77 169.254.42.77
20
169.254.2.3 255.255.255.255 127.0.0.1 127.0.0.1
30
169.254.42.77 255.255.255.255 127.0.0.1 127.0.0.1
20
169.254.255.255 255.255.255.255 169.254.2.3 169.254.2.3
30
169.254.255.255 255.255.255.255 169.254.42.77 169.254.42.77
20
224.0.0.0 240.0.0.0 169.254.2.3 169.254.2.3
30
224.0.0.0 240.0.0.0 169.254.42.77 169.254.42.77
20
255.255.255.255 255.255.255.255 169.254.2.3 169.254.2.3
1
255.255.255.255 255.255.255.255 169.254.42.77 169.254.42.77
1
========================================================================
===
Persistent Routes:
None
Pinging isn't working, i.e. it's not possible to ping from PC the
embedded device, nor vice-versa.
I presume it's because of the identical metric in the route of the
embedded device, i.e.
Destination Gateway Genmask Flags Metric Ref Use
Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0
usb0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0
eth0
My question is how this should be done correctly to work? I tried
setting the metric of the usb0 device on embedded side to 1 instead of
0, i.e.
Destination Gateway Genmask Flags Metric Ref Use
Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 1 0 0
usb0
Doing this lets me ping from PC side both embedded IP addresses (all
traffic goes via the Ethernet channel though). From embedded side I can
only ping the Ethernet IP address, not the USB IP address.
Is there a way how to handle such a setup properly for all cases, and if
yes, how should this be handled to work correctly?
Thanks a lot for feedback,
Lars
More information about the avahi
mailing list