ionmich
Posts: 16
Joined: Sat Apr 17, 2021 1:17 am

RPi4 64bit connect eth0 via cable

Sun May 23, 2021 4:48 pm

Connecting via wi-fi with nothing else connected works but the signal is weak. When I add a cable connection to my Belkin router and try to connect to the Internet, neither work. Three other computers can connect via the router, and I have swapped cables in case the one I used was bad.

Code: Select all

 $ sudo journalctl -b | grep eth0
[sudo] password for ion: 
May 23 11:19:46 raspberrypi kernel: bcmgenet fd580000.ethernet eth0: Link is Down
May 23 11:19:46 raspberrypi dhcpcd[508]: eth0: waiting for carrier
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: carrier acquired
May 23 11:19:48 raspberrypi kernel: bcmgenet fd580000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
May 23 11:19:48 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: IAID 32:38:27:f0
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: adding address fe80::55f5:fc73:a24a:3349
May 23 11:19:48 raspberrypi avahi-daemon[436]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::55f5:fc73:a24a:3349.
May 23 11:19:48 raspberrypi avahi-daemon[436]: New relevant interface eth0.IPv6 for mDNS.
May 23 11:19:48 raspberrypi avahi-daemon[436]: Registering new address record for fe80::55f5:fc73:a24a:3349 on eth0.*.
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: rebinding lease of 192.168.2.80
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: NAK: from 192.168.44.1
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: soliciting a DHCP lease
May 23 11:19:49 raspberrypi dhcpcd[508]: eth0: soliciting an IPv6 router
May 23 11:19:49 raspberrypi dhcpcd[508]: eth0: offered 192.168.2.80 from 192.168.2.1
May 23 11:19:49 raspberrypi dhcpcd[508]: eth0: probing address 192.168.2.80/24
May 23 11:19:55 raspberrypi dhcpcd[508]: eth0: leased 192.168.2.80 for infinity
May 23 11:19:55 raspberrypi avahi-daemon[436]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.2.80.
May 23 11:19:55 raspberrypi avahi-daemon[436]: New relevant interface eth0.IPv4 for mDNS.
May 23 11:19:55 raspberrypi dhcpcd[508]: eth0: adding route to 192.168.2.0/24
May 23 11:19:55 raspberrypi avahi-daemon[436]: Registering new address record for 192.168.2.80 on eth0.IPv4.
May 23 11:19:55 raspberrypi dhcpcd[508]: eth0: adding default route via 192.168.2.1
May 23 11:20:01 raspberrypi dhcpcd[508]: eth0: no IPv6 Routers available
ion@raspberrypi:~ $ 
 
Any advice will be appreciated.

User avatar
neilgl
Posts: 3654
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: RPi4 64bit connect eth0 via cable

Sun May 23, 2021 6:38 pm

What happens if you use 32bit Raspi OS on a spare microSD card?

bls
Posts: 1851
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: RPi4 64bit connect eth0 via cable

Sun May 23, 2021 7:10 pm

ionmich wrote:
Sun May 23, 2021 4:48 pm
Connecting via wi-fi with nothing else connected works but the signal is weak. When I add a cable connection to my Belkin router and try to connect to the Internet, neither work. Three other computers can connect via the router, and I have swapped cables in case the one I used was bad.

Code: Select all

 $ sudo journalctl -b | grep eth0
[sudo] password for ion: 
May 23 11:19:46 raspberrypi kernel: bcmgenet fd580000.ethernet eth0: Link is Down
May 23 11:19:46 raspberrypi dhcpcd[508]: eth0: waiting for carrier
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: carrier acquired
May 23 11:19:48 raspberrypi kernel: bcmgenet fd580000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
May 23 11:19:48 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: IAID 32:38:27:f0
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: adding address fe80::55f5:fc73:a24a:3349
May 23 11:19:48 raspberrypi avahi-daemon[436]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::55f5:fc73:a24a:3349.
May 23 11:19:48 raspberrypi avahi-daemon[436]: New relevant interface eth0.IPv6 for mDNS.
May 23 11:19:48 raspberrypi avahi-daemon[436]: Registering new address record for fe80::55f5:fc73:a24a:3349 on eth0.*.
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: rebinding lease of 192.168.2.80
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: NAK: from 192.168.44.1
May 23 11:19:48 raspberrypi dhcpcd[508]: eth0: soliciting a DHCP lease
May 23 11:19:49 raspberrypi dhcpcd[508]: eth0: soliciting an IPv6 router
May 23 11:19:49 raspberrypi dhcpcd[508]: eth0: offered 192.168.2.80 from 192.168.2.1
May 23 11:19:49 raspberrypi dhcpcd[508]: eth0: probing address 192.168.2.80/24
May 23 11:19:55 raspberrypi dhcpcd[508]: eth0: leased 192.168.2.80 for infinity
May 23 11:19:55 raspberrypi avahi-daemon[436]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.2.80.
May 23 11:19:55 raspberrypi avahi-daemon[436]: New relevant interface eth0.IPv4 for mDNS.
May 23 11:19:55 raspberrypi dhcpcd[508]: eth0: adding route to 192.168.2.0/24
May 23 11:19:55 raspberrypi avahi-daemon[436]: Registering new address record for 192.168.2.80 on eth0.IPv4.
May 23 11:19:55 raspberrypi dhcpcd[508]: eth0: adding default route via 192.168.2.1
May 23 11:20:01 raspberrypi dhcpcd[508]: eth0: no IPv6 Routers available
ion@raspberrypi:~ $ 
 
Any advice will be appreciated.
Why do you think it's not working? Your eth0 gets an IP address (192.168.2.80), and knows that your router is at 192.168.2.1.

Please provide some output showing what your problem is.
Pi tools:
Quickly and easily build customized-just-for-you SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

ionmich
Posts: 16
Joined: Sat Apr 17, 2021 1:17 am

Re: RPi4 64bit connect eth0 via cable

Sun May 23, 2021 7:30 pm

As requested...

$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 93ms

User avatar
DougieLawson
Posts: 41886
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: RPi4 64bit connect eth0 via cable

Sun May 23, 2021 7:39 pm

Get the output from the following commands

ip addr show
ip route
ping -c3 $(ip route | awk '/default/ {print $3}')
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

ionmich
Posts: 16
Joined: Sat Apr 17, 2021 1:17 am

Re: RPi4 64bit connect eth0 via cable

Sun May 23, 2021 8:05 pm

Thanks for helping. As requested...

$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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 mq state UP group default qlen 1000
link/ether dc:a6:32:38:27:f0 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.80/24 brd 255.255.255.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::55f5:fc73:a24a:3349/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether dc:a6:32:38:27:f2 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.171/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0
valid_lft 84234sec preferred_lft 73434sec
inet6 2806:102e:11:4cf4::2/128 scope global dynamic noprefixroute
valid_lft 2589831sec preferred_lft 2589831sec
inet6 2806:102e:11:4cf4:c3a4:d40c:62b:a4/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 2591649sec preferred_lft 2591649sec
inet6 fd2c:ab00:df18:7b00:cbf8:7117:c374:9125/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 6849sec preferred_lft 3249sec
inet6 fe80::b905:c798:8536:4b10/64 scope link
valid_lft forever preferred_lft forever

$ ip route
default via 192.168.2.1 dev eth0 proto dhcp src 192.168.2.80 metric 202 mtu 64
default via 192.168.1.254 dev wlan0 proto dhcp src 192.168.1.171 metric 303
192.168.1.0/24 dev wlan0 proto dhcp scope link src 192.168.1.171 metric 303
192.168.2.0/24 dev eth0 proto dhcp scope link src 192.168.2.80 metric 202 mtu 64

$ ping -c3 $(ip route | awk '/default/ {print $3}')
PING 192.168.1.254 (192.168.1.254) 56(124) bytes of data.
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
^C
--- 192.168.1.254 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 19ms

User avatar
DougieLawson
Posts: 41886
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: RPi4 64bit connect eth0 via cable

Sun May 23, 2021 8:51 pm

You've got two default routes defined. That will never work since the one the kernel picks first isn't a router.

Remove the route on wlan0.

sudo ip route delete default via 192.168.1.254 dev wlan0

Then update /etc/dhcpcd.conf so that that route doesn't get re-created at your next reboot.

Code: Select all

interface wlan0
static ip_address=192.168.1.171/24
static routers=192.168.1.254
Becomes

Code: Select all

interface wlan0
static ip_address=192.168.1.171/24
#static routers=192.168.1.254
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

ionmich
Posts: 16
Joined: Sat Apr 17, 2021 1:17 am

Re: RPi4 64bit connect eth0 via cable

Sun May 23, 2021 9:17 pm

Thanks I'll try that later. At this moment there are erratic connection problems with the Mexican (where I am) DNS.

ionmich
Posts: 16
Joined: Sat Apr 17, 2021 1:17 am

Re: RPi4 64bit connect eth0 via cable

Sun May 23, 2021 10:04 pm

Sorry selecting Code from above did not work. First of all the code...

interface wlan0
static ip_address=192.168.1.171/24
static routers=192.168.1.254

did not exist in /etc/dhcpcd.conf, nevertheless I added

interface wlan0
static ip_address=192.168.1.171/24
#static routers=192.168.1.254

when I rebooted I got...

ion@raspberrypi:~ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.2.1 icmp_seq=1 Destination Host Unreachable
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 7ms

This was while my desktop was connected to the router and working. Makes no sense. Look I appreciate you helping me, but I've spent too much time on this for one day. I have a couple of other computers that do work, the problem being that the wi-fi is my neighbor's and he insists on turning it off when he leaves the house. My wired connection works.I'll get back to this later. Thanks again.

ionmich
Posts: 16
Joined: Sat Apr 17, 2021 1:17 am

Re: RPi4 64bit connect eth0 via cable

Mon May 24, 2021 8:01 pm

Six more hours later, I have finally given up. There seems to be no simple way to complete my task. Even after following countless suggestions over the Internet. I guess the Pi 4 is not for me. But thanks anyway for all the time you've spent trying to help me.

epoch1970
Posts: 7238
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: RPi4 64bit connect eth0 via cable

Mon May 24, 2021 9:54 pm

Did you notice eth0 and wlan0 were actually on 2 different networks? (.1.x, .2.x)
Maybe you need to connect the cable on another switch port or another switch.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

ionmich
Posts: 16
Joined: Sat Apr 17, 2021 1:17 am

Re: RPi4 64bit connect eth0 via cable

Mon May 24, 2021 10:02 pm

Looks different to me
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.102 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::55f5:fc73:a24a:3349 prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:38:27:f0 txqueuelen 1000 (Ethernet)
RX packets 39 bytes 10950 (10.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 100 bytes 11964 (11.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1 bytes 80 (80.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 80 (80.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.171 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::b905:c798:8536:4b10 prefixlen 64 scopeid 0x20<link>
inet6 2806:102e:11:4cf4::2 prefixlen 128 scopeid 0x0<global>
inet6 2806:102e:11:4cf4:c3a4:d40c:62b:a4 prefixlen 64 scopeid 0x0<global>
inet6 fd2c:ab00:df18:7b00:cbf8:7117:c374:9125 prefixlen 64 scopeid 0x0<global>
ether dc:a6:32:38:27:f2 txqueuelen 1000 (Ethernet)
RX packets 1169 bytes 686296 (670.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1302 bytes 211692 (206.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.0.1 icmp_seq=1 Destination Net Unreachable
From 192.168.0.1 icmp_seq=2 Destination Net Unreachable
From 192.168.0.1 icmp_seq=3 Destination Net Unreachable
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 11ms

epoch1970
Posts: 7238
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: RPi4 64bit connect eth0 via cable

Mon May 24, 2021 10:10 pm

It’s magic apparently.
Every time you connect the Ethernet interface, the network changes...

If 192.168.1.0/24 gives you internet access on WiFi try to get that network over the Ethernet cable.
Use DHCP do not configure the Pi at all
Examine your router and switches configs.
Disconnect a working (=with internet access) Ethernet computer, bring the Pi over and connect the pi with that very cable.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

ionmich
Posts: 16
Joined: Sat Apr 17, 2021 1:17 am

Re: RPi4 64bit connect eth0 via cable

Wed May 26, 2021 2:58 pm

Problem solved. Well not really solved, but at least avoided. When I connect to the primary (cable only router) that is connected to my modem, I get a working eth0. If I replace it with a wi-fi router, I also get a wi-fi connection. The problems occur when I try to connect to my secondary router in another location connected to the primary router via cable. (I prefer cable connections as their problems are easier to diagnose.)

Thanks to all for the help.

AaFran
Posts: 3
Joined: Wed May 26, 2021 5:45 pm

Re: RPi4 64bit connect eth0 via cable

Wed May 26, 2021 6:24 pm

Have you tried using dhclient for assigning your dynamic IP address instead of dhcpcd? Sometimes dhcpcd has bugs when you change your access point from 192.168.0.1 to another IP. Also you can check if a DHCP server is running with dhcping.
Last edited by AaFran on Fri May 28, 2021 6:36 am, edited 1 time in total.

epoch1970
Posts: 7238
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: RPi4 64bit connect eth0 via cable

Thu May 27, 2021 11:21 am

ionmich wrote:
Wed May 26, 2021 2:58 pm
The problems occur when I try to connect to my secondary router in another location connected to the primary router via cable.
You could configure that router so that it allows internet access, or don't use it as a router but as a switch (aka bridge mode).

Dhcpcd is fine.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “General discussion”