brazoayeye
Posts: 8
Joined: Wed Sep 20, 2023 6:34 am

Problem with ipv4

Wed Sep 20, 2023 6:51 am

Hello, i installed "Raspberry Pi OS with desktop" Release date: May 3rd 2023 on a Rpi4 8GB.

In the Wifi i have a DHCP and all works well, once setted SSID and password from desktop all works right:
>ping raspberrypi.local -4
Esecuzione di Ping raspberrypi.local [192.168.21.34] con 32 byte di dati:
Risposta da 192.168.21.34: byte=32 durata=17ms TTL=64
I setted eth0 as shown here: https://prnt.sc/pxGbvdqt-uBz

Once i connect only the eth cable I have the following problem:
> ping raspberrypi.local -4
Esecuzione di Ping raspberrypi.local [192.168.1.176] con 32 byte di dati:
Richiesta scaduta.
but
>ping raspberrypi.local -6
Esecuzione di Ping raspberrypi.local [fe80::b242:a189:8a5e:ed7%8] con 32 byte di dati:
Risposta da fe80::b242:a189:8a5e:ed7%8: durata<1ms
and
$ ping 192.168.1.12
PING 192.168.1.12 (192.168.1.12) 56(84) bytes of data.
From 172.18.9.3 icmp_seq=1 Destination Host Unreachable
laptop setup https://prnt.sc/rcbY237NUIpx

Why with eth I can only use ipv6 and not ipv4?

Thanks

User avatar
butchkemper
Posts: 222
Joined: Sat Jul 22, 2017 8:03 pm
Location: Sachse, Tx. Dallas is a western suburb of Sachse.

Re: Problem with ipv4

Wed Sep 20, 2023 3:15 pm

brazoayeye wrote:
Wed Sep 20, 2023 6:51 am
Hello, i installed "Raspberry Pi OS with desktop" Release date: May 3rd 2023 on a Rpi4 8GB.

In the Wifi i have a DHCP and all works well, once setted SSID and password from desktop all works right:
>ping raspberrypi.local -4
Esecuzione di Ping raspberrypi.local [192.168.21.34] con 32 byte di dati:
Risposta da 192.168.21.34: byte=32 durata=17ms TTL=64
I setted eth0 as shown here: https://prnt.sc/pxGbvdqt-uBz

Once i connect only the eth cable I have the following problem:
> ping raspberrypi.local -4
Esecuzione di Ping raspberrypi.local [192.168.1.176] con 32 byte di dati:
Richiesta scaduta.
but
>ping raspberrypi.local -6
Esecuzione di Ping raspberrypi.local [fe80::b242:a189:8a5e:ed7%8] con 32 byte di dati:
Risposta da fe80::b242:a189:8a5e:ed7%8: durata<1ms
and
$ ping 192.168.1.12
PING 192.168.1.12 (192.168.1.12) 56(84) bytes of data.
From 172.18.9.3 icmp_seq=1 Destination Host Unreachable
laptop setup https://prnt.sc/rcbY237NUIpx

Why with eth I can only use ipv6 and not ipv4?

Thanks
I think insertion of the ethernet cable creates a routing problem because the default route is lost or is assigned to a non-working device.

Post the results of these commands without the eth0 cable inserted and then with the eth0 cable inserted:
  • ip route
  • ip link
Butch

brazoayeye
Posts: 8
Joined: Wed Sep 20, 2023 6:34 am

Re: Problem with ipv4

Wed Sep 20, 2023 5:33 pm

Without cable:
$ ip route
default via 192.168.1.1 dev wlan0 proto dhcp src 192.168.1.88 metric 303 mtu 1500
192.168.0.0/16 dev wlan0 proto dhcp scope link src 192.168.1.88 metric 303 mtu 1500
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether d8:3a:dd:48:83:6c brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
link/ether d8:3a:dd:48:83:6d brd ff:ff:ff:ff:ff:ff
With cable:
$ ip route
default via 192.168.1.1 dev wlan0 proto dhcp src 192.168.1.88 metric 303 mtu 1500
192.168.0.0/16 dev wlan0 proto dhcp scope link src 192.168.1.88 metric 303 mtu 1500
marocco@raspberrypi:~ $ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether d8:3a:dd:48:83:6c brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
link/ether d8:3a:dd:48:83:6d brd ff:ff:ff:ff:ff:ff
Compare: https://prnt.sc/4VrAjIrC9LDo

Wifi continue working without problems during cable insertion / remove.

Thanks

brazoayeye
Posts: 8
Joined: Wed Sep 20, 2023 6:34 am

Re: Problem with ipv4

Thu Sep 21, 2023 8:06 am

Connected to the main network with gateway and internet now works...
:shock:
$ ip route
default via 192.168.1.1 dev eth0 src 192.168.1.176 metric 202 mtu 1500
default via 192.168.1.1 dev wlan0 proto dhcp src 192.168.1.88 metric 303 mtu 1500
192.168.0.0/16 dev wlan0 proto dhcp scope link src 192.168.1.88 metric 303 mtu 1500
192.168.1.0/24 dev eth0 proto dhcp scope link src 192.168.1.176 metric 202 mtu 1500
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether d8:3a:dd:48:83:6c brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
link/ether d8:3a:dd:48:83:6d brd ff:ff:ff:ff:ff:ff

pidd
Posts: 5216
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: Problem with ipv4

Thu Sep 21, 2023 8:41 am

Your 192.168.0.0/16 network overlaps 192.168.1.0/24

Whenever I do overlaps I overlap at the top sub-subnet, so the smaller subnet would be 192.168.255.0/24, that way they both share 192.168.255.255 as the common broadcast address. I can't remember the advantage now, it probably save a lot of unnecessary ARP traffic, although you are using mdns (.local), ARP normally keeps plugging away in the background.

brazoayeye
Posts: 8
Joined: Wed Sep 20, 2023 6:34 am

Re: Problem with ipv4

Thu Sep 21, 2023 9:27 am

Sorry pidd, I haven't understood what do you mean.

Why before it wasn't working and now it works?

Due to the connection problems i connected bot eth and wifi to the same network (router) but wifi is DHCPed and eth have static IP.

Now it replies on the lan IP, but is that related to the fact that also wifi is connected to the same network?

Thanks

pidd
Posts: 5216
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: Problem with ipv4

Thu Sep 21, 2023 2:47 pm

192.168.0.0/16 covers 192.168.0.0 to 192.168.255.255, a total of 65536 addresses and broadcasts on 192.168.255.255

192.168.1.0/24 covers 192.168.1.0 to 192.168.1.255 a total of 256 addresses and broadcasts on 192.168.1.255

The second subnet (/24) is a subset of the first, this can be a problem as DHCP for for the first subnet can issue IP addresses inside the second subnet (eg on top of your static IP). If the second subnet also has its own DHCP then that can also issue IP in part of the first subnet. Network arguments can happen.

Also there are two broadcast addresses despite devices from the two subnets potentially being able to see each other (yes, that is vague, memory fail)

If instead you use 192.168.255.0/24 for the second subnet ......

You can then limit the first subnet's dhcp to a max of 192.168.254.255 preventing any overlap of issued IP's. This retains 65280 addresses for subnet one.

Both subnets will have the same broadcast IP of 192.168.255.255 as that is in the overlap area of both subnets.

I've not played with that for a couple of years which is way outside my memory span to remember detailed ramifications. Just treat it as background information or look into it further. There is a risk with overlapping networks of DHCP issuing an IP already in use in the other subnet.

I personally avoid /16 subnets unless I am sure I could end up with more than say 100 clients, up to that point a /24 subnet is usually fine.

brazoayeye
Posts: 8
Joined: Wed Sep 20, 2023 6:34 am

Re: Problem with ipv4

Thu Sep 21, 2023 2:55 pm

My DHCP only gives addresses < 150 so can't hit 176


Thanks for the given informations, but the problem I described at the beginning was happening with the with the eth connected directly to my laptop and a static ip in both sides.

Once connected to a more complex network the problem disappeared

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

Re: Problem with ipv4

Thu Sep 21, 2023 4:08 pm

brazoayeye wrote:
Thu Sep 21, 2023 2:55 pm
My DHCP only gives addresses < 150 so can't hit 176
Login to your router's advanced options and search for the "DHCP Pool" it's clearly restricted to 150 addresses.

/24 is a normal subnet of 256 addresses.
/16 is abnormal for a 192.168.xxx.xxx network block. That's the whole address range from 192.168.0.0 to 192.168.255.255.

The private address groups (for IPv4) are
10.x.x.x/8
172.[16-31].x.x/16
and
192.168.x.x/24
those address groups are not routable. You shouldn't even be able to route between 192.168.1.25 and 192.168.3.14 without having a locally configured router.

169.254.x.x/16 is a special group (of 65536 addresses) that's used for a network without a DHCP server, every station picks their own random address and they workout how to connect to other stations in that network.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

Return to “Troubleshooting”