In the last 10 days I've been researching a lot about networks on Linux, more specifically, on Raspberry. After coming to the conclusion that I will not be able to solve it myself, I come to this forum to try to find the solution, or else, the right way to go.
Using > Raspberry Pi 3
I'm using Ethernet connection (eth0) with Router and P2P with notebook sometimes.
I set up my Raspberry to recognize raspberry.local and use it to login in SSH. So, what the problem: The raspberry.local dont work when I plug the Raspi direct on notebook.. I have it in my connection:
RPi <--eth0--> Router (IP RPi: 192.168.0.40 and raspberry.local work) Router is the dhcp
RPi <--eth0--> notebook (IP RPi: 169.254.5.95 and raspberry.local dont work)
My configs:
$ route -n (RPi <--eth0--> Router)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 202 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
$ cat /etc/networks
default 0.0.0.0
loopback 127.0.0.0
link-local 169.254.0.0
$ ifconfig (RPi <--eth0--> Router)
eth0 Link encap:Ethernet HWaddr b8:27:eb:d9:4c:3b
inet addr:192.168.0.40 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::27c8:5163:48b2:87eb/64 Scope:Link
inet6 addr: 2804:14d:8a81:1132:8caa:976b:e8bf:3015/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11785 errors:0 dropped:5 overruns:0 frame:0
TX packets:11634 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5789126 (5.5 MiB) TX bytes:10058686 (9.5 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4943 errors:0 dropped:0 overruns:0 frame:0
TX packets:4943 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:9649934 (9.2 MiB) TX bytes:9649934 (9.2 MiB)
wlan0 Link encap:Ethernet HWaddr b8:27:eb:8c:19:4e
inet6 addr: fe80::6653:f75d:e2a3:dd39/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
$ sudo nano /etc/network/interfaces
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0-raspbian inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
How or what I need do to route the link-local (RPi <-eth0-> notebook) to raspberry.local? If I use 169.254.5.95 to login in SSH, it work, but this IP change if I use in other computer ou with other RPi.. So, I need work with Router(dhcp) and without router (direct eth) and all able to route to hostname raspberry.local I need help!
Maybe I need create a virtual eth >(eth1?) with static ip routing to 127.0.0.1 and route the 169.254.0.0 to this virtual interface? If it's correct, how do it?
Thank a lot!
169.
is a Link-local address - it unclear what you are attempting to achieve. – Milliways Jan 01 '18 at 23:01avahi
when there is a link-local address... when connected in link-local, what is the output, on the RPi, ofsudo systemctl status avahi-daemon
– RubberStamp Jan 03 '18 at 18:51