Me gustaría usar una dirección de enlace local para conectar un dispositivo integrado (que ejecuta systemd-networkd) a una PC (Ubuntu, Win, OS X) mediante un cable cruzado (sin conmutador ni servidor DHCP).
Cuando me conecto a través de una red que proporciona DHCP, todo funciona bien, la *.local
dirección está vinculada a la IP de DHCP y el navegador Avahi puede detectar mi dispositivo en la red.
Solo probé una conexión cruzada con Ubuntu por ahora, si uso la GUI para cambiar la configuración de red deAutomático (DHCP)aEnlace local únicamenteTanto mi dispositivo integrado como mi PC obtienen una IP de LL y puedo hacer ping al dispositivo desde mi PC usando la IP de LL (obtenida ip a
mientras estoy conectado a través de una interfaz en serie), pero no puedo abordarlo usando el *.local
nombre y avahi-browser
tampoco encontrar cualquier cosa.
No pude encontrar un ejemplo en línea que analice mi caso de uso, lo cual es extraño, ya queconfiguración ceroestá destinado a manejar tales casos de uso.
Estas son las configuraciones de IP de mi dispositivo integrado (Ubuntu 16.04.01 en 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
Esta es mi configuración de red cableada:
root@rp-f00321:~# cat /etc/systemd/network/wired.network
[Match]
Name=eth0
[Network]
LinkLocalAddressing=yes
DHCP=yes
IPForward=yes
IPMasquerade=yes
También intenté agregar las siguientes dos opciones, pero no ayudó:
MulticastDNS=yes
IPv4LLRoute=yes
Estado del demonio Avahi:
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.
Pude hacer ping a mi PC usando el .local
nombre, pero dejó de funcionar ahora:
# 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
Estas son las configuraciones de IP de mi PC host (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
Y estos son mis intentos de ping:
$ 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