1

I have a raspi image that I use to duplicate other pi's, sometimes I want to have more than one of them connected to my network so I can test things all at once. However, they get confused on the network as their network settings are the exact same. I tried to solve this by setting a static IP address for one pi, but each time I try to do that I can't get a successful ping.

I tried following the solution here How do I set up networking/WiFi/static IP address on Raspbian/Raspberry Pi OS?

but that didn't work. I'm pretty green on networking issues, so I'm not sure what else I can change to troubleshoot. Any help is appreciated.

ifconfig results:

        inet 192.168.50.10  netmask 255.255.255.0  broadcast 192.168.50.255
        inet6 fe80::8237:8fa8:2a06:c5c7  prefixlen 64  scopeid 0x20<link>
        ether c8:3e:a7:01:3e:ad  txqueuelen 1000  (Ethernet)
        RX packets 1313  bytes 230370 (224.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1050  bytes 137704 (134.4 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 358 bytes 33382 (32.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 358 bytes 33382 (32.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

cat /etc/resolv.conf results:

#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.0.1
nameserver 8.8.8.8
nameserver fd51:42f8:caae:d92e::1

route -ne results:

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth0
192.168.0.1     0.0.0.0         255.255.255.255 UH        0 0          0 eth0
192.168.50.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0

sudo service dhcpcd status results:

   Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2022-06-21 09:23:39 EDT; 7min ago
  Process: 983 ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -b (code=exited, status=0/SUCCESS)
 Main PID: 1091 (dhcpcd)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/dhcpcd.service
           └─1091 /sbin/dhcpcd -q -b

Jun 21 09:23:45 121321001 dhcpcd[1091]: control command: /sbin/dhcpcd --exit piright Jun 21 09:23:45 121321001 dhcpcd[1091]: piright: removing interface Jun 21 09:23:45 121321001 dhcpcd[1091]: control command: /sbin/dhcpcd --exit pileft Jun 21 09:23:45 121321001 dhcpcd[1091]: pileft: removing interface Jun 21 09:23:47 121321001 dhcpcd[1091]: eth0: using static address 192.168.50.10/24 Jun 21 09:23:47 121321001 dhcpcd[1091]: eth0: router 192.168.0.1 requires a host route Jun 21 09:23:47 121321001 dhcpcd[1091]: eth0: adding route to 192.168.50.0/24 Jun 21 09:23:47 121321001 dhcpcd[1091]: eth0: adding host route to 192.168.0.1 Jun 21 09:23:47 121321001 dhcpcd[1091]: eth0: adding default route via 192.168.0.1 Jun 21 09:24:09 121321001 dhcpcd[1091]: eth0: no IPv6 Routers available

TKnapp
  • 13
  • 3

2 Answers2

2

What subnet is the router on? the 192.168 subnets are 8-bits/0-255 (192.168.0.xx and 192.168.50.xx are not on the same subnet).

The gateway being 192.168.0.1 makes it seem like you should be assigning IP addresses in the 192.168.0 subnet

virmaior
  • 146
  • 6
2

You said, "I'm pretty green on networking issues"

That statement suggests that you should not be using static IP addresses.

Did you know that dhcpcd comes with a default configuration in /etc/dhcpcd.conf that just works in most cases?

And I'm sorry, but I cannot let this statement from your question pass without comment: "However, they get confused on the network... "

I wonder how "they" got confused? :)

Seamus
  • 23,558
  • 5
  • 42
  • 83