3

I would like to use link-local address to connect an embedded device (running systemd-networkd) to a PC (Ubuntu, Win, OS X) using a crossover cable (no switch or DHCP server).

When I connect over a network providing DHCP everything works fine, the *.local address is linked to the DHCP IP, and avahi browser is able to detect my device on the network.

I only tried a crossover connection to Ubuntu for now, if I use the GUI to change the network config from Automatic (DHCP) to Link-Local Only both my embedded device and PC get a LL IP and I am able to ping the device from my PC using the LL IP (obtained using ip a while connected over a serial interface), but I am unable to address it using the *.local name and avahi-browser is also not finding anything.

I could not find an example online discussing my use case, which is strange, since zeroconf is kind of intended for handling such use cases.

This are IP settings from my embedded device (Ubuntu 16.04.01 on ARMhf):

root@rp-f00321:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:26:32:f0:03:21 brd ff:ff:ff:ff:ff:ff
    inet 169.254.171.143/16 brd 169.254.255.255 scope link eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::226:32ff:fef0:321/64 scope link 
       valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default 
    link/sit 0.0.0.0 brd 0.0.0.0

This are my wired network settings:

root@rp-f00321:~# cat /etc/systemd/network/wired.network 
[Match]
Name=eth0

[Network]
LinkLocalAddressing=yes
DHCP=yes
IPForward=yes
IPMasquerade=yes

I also tried to add the next two options, but it did not help:

MulticastDNS=yes
IPv4LLRoute=yes

Avahi daemon status:

root@rp-f00321:~# systemctl status avahi-daemon -l -n 50
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/avahi-daemon.service.d
           └─ad.conf
   Active: active (running) since Wed 2016-10-26 10:16:04 UTC; 41min ago
 Main PID: 1552 (avahi-daemon)
   Status: "avahi-daemon 0.6.32-rc starting up."
   CGroup: /system.slice/avahi-daemon.service
           ├─1552 avahi-daemon: running [rp-f00321.local
           └─1553 avahi-daemon: chroot helpe

Oct 26 10:16:04 rp-f00321 systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Process 1456 died: No such process; trying to remove PID file. (/var/run/avahi-daemon//pid)
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Found user 'avahi' (UID 107) and group 'avahi' (GID 110).
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Successfully dropped root privileges.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: avahi-daemon 0.6.32-rc starting up.
Oct 26 10:16:04 rp-f00321 systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Successfully called chroot().
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Successfully dropped remaining capabilities.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Loading service file /services/bazaar.service.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Loading service file /services/ssh.service.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::226:32ff:fef0:321.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: New relevant interface eth0.IPv6 for mDNS.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Joining mDNS multicast group on interface eth0.IPv4 with address 169.254.171.143.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: New relevant interface eth0.IPv4 for mDNS.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Network interface enumeration completed.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Registering new address record for fe80::226:32ff:fef0:321 on eth0.*.
Oct 26 10:16:04 rp-f00321 avahi-daemon[1552]: Registering new address record for 169.254.171.143 on eth0.IPv4.
Oct 26 10:16:05 rp-f00321 avahi-daemon[1552]: Server startup complete. Host name is rp-f00321.local. Local service cookie is 1486970882.
Oct 26 10:16:06 rp-f00321 avahi-daemon[1552]: Service "rp-f00321 SSH" (/services/ssh.service) successfully established.
Oct 26 10:16:06 rp-f00321 avahi-daemon[1552]: Service "rp-f00321 HTTP" (/services/bazaar.service) successfully established.

I could ping my PC using the .local name, but it stopped working now:

# ping dent.local
PING dent.local (169.254.100.55) 56(84) bytes of data.
64 bytes from Dent.local (169.254.100.55): icmp_seq=1 ttl=64 time=0.776 ms
64 bytes from Dent.local (169.254.100.55): icmp_seq=2 ttl=64 time=0.634 ms

This are IP settings from my host PC (Ubuntu 16.04):

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether c4:8e:8f:f5:a3:93 brd ff:ff:ff:ff:ff:ff
5: enx00e04c534458: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:e0:4c:53:44:58 brd ff:ff:ff:ff:ff:ff
    inet 169.254.100.55/16 brd 169.254.255.255 scope link enx00e04c534458
       valid_lft forever preferred_lft forever
    inet6 fe80::e07d:b734:e921:e87/64 scope link 
       valid_lft forever preferred_lft forever

And this are my ping attempts:

$ ping 169.254.171.143
PING 169.254.171.143 (169.254.171.143) 56(84) bytes of data.
64 bytes from 169.254.171.143: icmp_seq=1 ttl=64 time=0.679 ms
64 bytes from 169.254.171.143: icmp_seq=2 ttl=64 time=0.706 ms
^C
--- 169.254.171.143 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.679/0.692/0.706/0.029 ms
$ ping rp-f00321.local
ping: unknown host rp-f00321.local

Your Answer

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

Browse other questions tagged or ask your own question.