0

I have a RPi CM4 machine with 2 NICs. I want to be able to communicate with the main network on eth0 (192.168.1.x) and a separate network on eth1 (192.168.0.x).

For the main network connection, IT gave me 192.168.1.224, mask 255.255.254.0, Gateway 192.168.1.1. So that is how I set up eth0 (also tried 255.255.255.0 mask)

I set eth1 to 192.168.0.200. Didn't set a mask or Gateway.

With no connection present on eth1, I can ping eth0 and ssh into it. When I connect eth1, I can no longer ping or ssh.

I have no idea what I'm doing. I'm a total noob/beginner/dunce when it comes to networking.

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 e4:5f:01:dc:d3:ca brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.224/24 brd 192.168.1.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::8b50:c7e0:6f8d:a2aa/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 84:8b:cd:4a:a1:ee brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.251/24 brd 192.168.0.255 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::7e0e:d55b:12a1:f029/64 scope link 
       valid_lft forever preferred_lft forever
4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether e4:5f:01:dc:d3:cc brd ff:ff:ff:ff:ff:ff
b4@raspberrypi:~ $ ip r
default via 192.168.1.1 dev eth0 src 192.168.1.224 metric 202 
default via 192.168.0.1 dev eth1 src 192.168.0.251 metric 203 
192.168.0.0/24 dev eth1 proto dhcp scope link src 192.168.0.251 metric 203 
192.168.1.0/24 dev eth0 proto dhcp scope link src 192.168.1.224 metric 202 
1
  • You should absolutely use the given subnet mask or you’ll run into connectivity issues sooner or later.
    – Daniel B
    Jun 10, 2023 at 8:56

1 Answer 1

0

In networking, the subnet mask is used to define which part of the address is the host bits, and which are the network bits. More detail on how it works is available in this Microsoft article.

A subnet mask of 255.255.254.0, like what IT provided you, indicates that the network ranges from 192.168.0.1 - 192.168.1.254. IT has assigned you 192.168.1.224, and given you a gateway of 192.168.1.1.

What that indicates is that 192.168.0.x and 192.168.1.x aren't actually separate networks, but one big one. I'd suggest seeking some further clarification from IT on the network layout, and why 2 different NICs are required.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .