링크 로컬 주소를 사용하는 크로스오버 케이블(스위치나 DHCP 서버 없음)을 사용하여 임베디드 장치(systemd-networkd 실행)를 PC(Ubuntu, Win, OS X)에 연결하고 싶습니다.
DHCP를 제공하는 네트워크를 통해 연결하면 모든 것이 잘 작동하고 주소가 *.local
DHCP IP에 연결되며 avahi 브라우저가 네트워크에서 내 장치를 감지할 수 있습니다.
GUI를 사용하여 네트워크 구성을 변경하는 경우 지금은 Ubuntu와의 교차 연결만 시도했습니다.자동(DHCP)도착하다로컬에서만 링크ip a
내 임베디드 장치와 PC 모두 LL IP를 갖고 있으며 LL IP(직렬 인터페이스를 통해 연결할 때 얻은)를 사용하여 내 PC에서 장치를 ping 할 수 있지만 Cann'이라는 *.local
이름을 사용하여 주소를 지정할 수 없습니다. 아무것도 avahi-browser
찾을 수 없습니다 .
내 사용 사례를 설명하는 예제를 온라인에서 찾을 수 없습니다. 이는 이상합니다.제로 구성이러한 사용 사례를 처리하도록 설계되었습니다.
내 임베디드 장치(ARMhf의 Ubuntu 16.04.01)에 대한 IP 설정은 다음과 같습니다.
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
이것은 내 유선 네트워크 설정입니다.
root@rp-f00321:~# cat /etc/systemd/network/wired.network
[Match]
Name=eth0
[Network]
LinkLocalAddressing=yes
DHCP=yes
IPForward=yes
IPMasquerade=yes
또한 다음 두 가지 옵션을 추가하려고 시도했지만 도움이 되지 않았습니다.
MulticastDNS=yes
IPv4LLRoute=yes
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.
해당 이름을 사용하여 내 컴퓨터에 ping을 보낼 수 있지만 .local
지금은 작동이 중지되었습니다.
# 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
내 호스트 PC(Ubuntu 16.04)의 IP 설정은 다음과 같습니다.
$ 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
내 핑 시도는 다음과 같습니다.
$ 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