You are not logged in.
I've set up a Raspberry Pi Zero to enable its USB gadget ethernet subsystem. On my Arch x86_64 desktop machine, I have avahi-daemon.service running. When I connect the Zero to a USB port, I can see it show up in the output of avahi-browse:
$ avahi-browse -art
[...]
+ enp0s26u1u1u3 IPv6 raspberrypi [62:22:a1:e8:3c:a3] Workstation local
[...]
= enp0s26u1u1u3 IPv6 raspberrypi [62:22:a1:e8:3c:a3] Workstation local
hostname = [raspberrypi.local]
address = [fe80::9469:84c0:ec07:4d1e]
port = [9]
txt = []
I can successfully ssh into the Zero with this command:
$ ssh -6 pi@fe80::9469:84c0:ec07:4d1e%enp0s26u1u1u3 # connection is OK with this
I'd like to be able to use the raspberrypi.local hostname, but I can't figure out how to get that to resolve. I would also like to be able to ssh to raspberrypi.local without having to specify the cryptic enp<something> interface name.
$ ssh -6 pi@raspberrypi.local
ssh: connect to host raspberrypi.local port 22: Invalid argument
I imagine the problem is that I'm not specifying an interface or route for ssh to raspberrypi.local. Trying to ping the Zero fails, but it appears my desktop machine (storm) is trying to reach it via the wrong interface, enp7s0.
$ ping -c 2 -6 -I enp0s26u1u1u3 raspberrypi.local
PING raspberrypi.local(raspberrypi.local (fe80::9469:84c0:ec07:4d1e)) 56 data bytes
From storm.local (fe80::8e89:a5ff:fe32:ea0d%enp7s0) icmp_seq=1 Destination unreachable: Address unreachable
From storm.local (fe80::8e89:a5ff:fe32:ea0d%enp7s0) icmp_seq=2 Destination unreachable: Address unreachable
--- raspberrypi.local ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1007ms
Last edited by johnp636 (2016-06-21 18:37:24)
Offline
Here are the messages from avahi-daemon.service and avahi-dnsconfd.service.
# journalctl -b -u avahi-daemon
-- Logs begin at Sat 2014-04-19 10:51:38 CDT, end at Sat 2016-06-18 12:15:11 CDT. --
Jun 18 12:13:46 storm systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Jun 18 12:13:46 storm avahi-daemon[1344]: Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Jun 18 12:13:46 storm avahi-daemon[1344]: Successfully dropped root privileges.
Jun 18 12:13:46 storm avahi-daemon[1344]: avahi-daemon 0.6.32 starting up.
Jun 18 12:13:46 storm systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Jun 18 12:13:46 storm avahi-daemon[1344]: Successfully called chroot().
Jun 18 12:13:46 storm avahi-daemon[1344]: Successfully dropped remaining capabilities.
Jun 18 12:13:46 storm avahi-daemon[1344]: No service file found in /etc/avahi/services.
Jun 18 12:13:46 storm avahi-daemon[1344]: Joining mDNS multicast group on interface enp7s0.IPv6 with address fe80::8e89:a5ff:fe32:ea
Jun 18 12:13:46 storm avahi-daemon[1344]: New relevant interface enp7s0.IPv6 for mDNS.
Jun 18 12:13:46 storm avahi-daemon[1344]: Joining mDNS multicast group on interface enp7s0.IPv4 with address 192.168.1.101.
Jun 18 12:13:46 storm avahi-daemon[1344]: New relevant interface enp7s0.IPv4 for mDNS.
Jun 18 12:13:46 storm avahi-daemon[1344]: Network interface enumeration completed.
Jun 18 12:13:46 storm avahi-daemon[1344]: Registering new address record for fe80::8e89:a5ff:fe32:ea0d on enp7s0.*.
Jun 18 12:13:46 storm avahi-daemon[1344]: Registering new address record for 192.168.1.101 on enp7s0.IPv4.
Jun 18 12:13:47 storm avahi-daemon[1344]: Server startup complete. Host name is storm.local. Local service cookie is 785245565.
Jun 18 12:14:26 storm avahi-daemon[1344]: Joining mDNS multicast group on interface enp0s26u1u1u3i1.IPv6 with address fe80::4c02:9ff
Jun 18 12:14:26 storm avahi-daemon[1344]: New relevant interface enp0s26u1u1u3i1.IPv6 for mDNS.
Jun 18 12:14:26 storm avahi-daemon[1344]: Registering new address record for fe80::4c02:9fff:fe82:dc86 on enp0s26u1u1u3i1.*.
# journalctl -b -u avahi-dnsconfd
-- Logs begin at Sat 2014-04-19 10:51:38 CDT, end at Sat 2016-06-18 12:18:25 CDT. --
Jun 18 12:18:25 storm systemd[1]: Stopped Avahi DNS Configuration Daemon.
Jun 18 12:18:25 storm systemd[1]: Started Avahi DNS Configuration Daemon.
Jun 18 12:18:25 storm avahi-dnsconfd[2023]: Successfully connected to Avahi daemon.
Offline
In case it helps to explain what's going on, here is what I see on the Zero.
pi@raspberrypi:~ $ ip addr show
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: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 5e:6c:a5:ba:79:70 brd ff:ff:ff:ff:ff:ff
inet 169.254.31.48/16 brd 169.254.255.255 scope global usb0
valid_lft forever preferred_lft forever
inet6 fe80::4e4d:42e0:7573:d93c/64 scope link
valid_lft forever preferred_lft forever
Offline
Show the output of
ip route
on both the machines.
and the output of
ip addr
on the desktop.
Mod note: Unless someone replies to your post, it is advisable to edit your existing post and keep adding newer information to that post itself.
Offline
Sorry about the serial posting.
By the way, there was a reboot since my last post, so the address of the Pi has changed.
On the desktop:
[root@storm ~]# ip route
default via 192.168.1.1 dev enp7s0 proto dhcp src 192.168.1.101 metric 10
192.168.1.0/24 dev enp7s0 proto kernel scope link src 192.168.1.101
192.168.1.1 dev enp7s0 proto dhcp scope link src 192.168.1.101 metric 10
[root@storm ~]# ip -6 route
fe80::/64 dev enp7s0 proto kernel metric 256 pref medium
fe80::/64 dev enp0s26u1u1u3i1 proto kernel metric 256 pref medium
default via fe80::224:a5ff:fed9:2c29 dev enp7s0 proto ra metric 1024 pref medium
[root@storm ~]# ip addr
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: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 8c:89:a5:32:ea:0d brd ff:ff:ff:ff:ff:ff
inet 192.168.1.101/24 brd 192.168.1.255 scope global dynamic enp7s0
valid_lft 43066sec preferred_lft 43066sec
inet6 fe80::8e89:a5ff:fe32:ea0d/64 scope link
valid_lft forever preferred_lft forever
3: enp0s26u1u1u3i1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 4e:02:9f:82:dc:86 brd ff:ff:ff:ff:ff:ff
inet6 fe80::4c02:9fff:fe82:dc86/64 scope link
valid_lft forever preferred_lft forever
Also on the desktop:
$ avahi-browse -art
+ enp0s26u1u1u3i1 IPv6 raspberrypi [ce:a6:f7:d5:a6:2e] Workstation local
[...]
= enp0s26u1u1u3i1 IPv6 raspberrypi [ce:a6:f7:d5:a6:2e] Workstation local
hostname = [raspberrypi.local]
address = [fe80::8d2f:967a:ebc8:7972]
port = [9]
txt = []
On the Pi Zero:
pi@raspberrypi:~ $ ip route
169.254.0.0/16 dev usb0 proto kernel scope link src 169.254.31.48 metric 202
pi@raspberrypi:~ $ ip -6 route
fe80::/64 dev usb0 proto kernel metric 256
pi@raspberrypi:~ $ ip addr
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: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether ce:a6:f7:d5:a6:2e brd ff:ff:ff:ff:ff:ff
inet 169.254.31.48/16 brd 169.254.255.255 scope global usb0
valid_lft forever preferred_lft forever
inet6 fe80::8d2f:967a:ebc8:7972/64 scope link
valid_lft forever preferred_lft forever
Last edited by johnp636 (2016-06-19 13:54:58)
Offline
So, the Pi only has a link local address? Try giving a 192 series IP to the pi and ping it from the desktop.
Offline
Giving the Pi another IP address defeats the purpose of this exercise, that is, finding it via Avahi name lookup. I've made some progress, however. I can tell ssh which of the desktop interfaces to use, and then it finds the Pi.
$ 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: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 8c:89:a5:32:ea:0d brd ff:ff:ff:ff:ff:ff
inet 192.168.1.101/24 brd 192.168.1.255 scope global dynamic enp7s0
valid_lft 38107sec preferred_lft 38107sec
inet6 fe80::8e89:a5ff:fe32:ea0d/64 scope link
valid_lft forever preferred_lft forever
3: enp0s26u1u1u3i1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 4e:02:9f:82:dc:86 brd ff:ff:ff:ff:ff:ff
inet6 fe80::4c02:9fff:fe82:dc86/64 scope link
valid_lft forever preferred_lft forever
$ # use the desktop's link-locak IPv6 address for the USB gadget ethernet interface
$ ssh -6 -o BindAddress=fe80::4c02:9fff:fe82:dc86%enp0s26u1u1u3i1 pi@raspberrypi.local # succeeds
Offline
Giving the Pi another IP address defeats the purpose of this exercise, that is, finding it via Avahi name lookup. I've made some progress, however. I can tell ssh which of the desktop interfaces to use, and then it finds the Pi.
Ah, nevermind. I somehow missed out that you wanted to only use Avahi. Glad that you could find a solution.
PS: If you are satisfied with your solution, then please mark the thread as solved.
Offline
In case someone would like to try this, I'll add some more information. To let the Pi Zero get a network connection of its own on my network, I set up a bridge and let systemd-networkd add both my desktop machine's Ethernet NIC and the USB gadget Ethernet NIC to the bridge. This way, my Pi gets its own IP address on my network from my router via DHCP.
Finding it as raspberrypi.local still works.
# cat MyBridge.netdev
[NetDev]
Name=br0
Kind=bridge
# cat MyBridge.network
[Match]
Name=br0
[Network]
DHCP=ipv4
# cat 50-dhcp.network
[Match]
Name=en*
[Network]
Bridge=br0
$ 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: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
link/ether 8c:89:a5:32:ea:0d brd ff:ff:ff:ff:ff:ff
inet6 fe80::8e89:a5ff:fe32:ea0d/64 scope link
valid_lft forever preferred_lft forever
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 92:ef:b2:67:5b:17 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.48/24 brd 192.168.1.255 scope global dynamic br0
valid_lft 42719sec preferred_lft 42719sec
inet6 fe80::90ef:b2ff:fe67:5b17/64 scope link
valid_lft forever preferred_lft forever
5: enp0s26u1u1u3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
link/ether 1a:0b:ad:f6:16:cf brd ff:ff:ff:ff:ff:ff
inet6 fe80::180b:adff:fef6:16cf/64 scope link
valid_lft forever preferred_lft forever
$ ssh pi@raspberrypi.local
[...]
$ 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: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether e6:41:f4:3c:9a:2a brd ff:ff:ff:ff:ff:ff
inet 192.168.1.49/24 brd 192.168.1.255 scope global usb0
valid_lft forever preferred_lft forever
inet6 fe80::3beb:a16b:cbe2:2616/64 scope link
valid_lft forever preferred_lft forever
Offline
Sorry to dig up this solved post but did you finally manage to use avahi?
Did you try to use nss-mdns as stated on avahi's wiki page?
Offline
Sorry to dig up this solved post but did you finally manage to use avahi?
Did you try to use nss-mdns as stated on avahi's wiki page?
After taking the approach of letting the Pi Zero on my home network by bridging, I didn't try again to get nss-mdns to work. Finding the Pi Zero using its IPv6 link-local address seemed to work, though.
Offline