I have a Linux box that I have setup with 3 network interfaces, connected to 3 different networks, each with their own subnet. At a high level I am trying to achieve communications between devices on each of these networks to devices on each of the other networks.
The 3 network interfaces are configured as described:
eth0 “WAN Port”
eth0 is a fairly standard interface configured as a DHCP client and connected to an upstream network which has a DHCP server and provides a gateway to the internet.
IP: 192.168.100.105/24 (address assigned by DHCP server on network)
eth1 “LAN Port”
eth1 has been configured as a DHCP Server and acts as the gateway for a small LAN. The interface has been configured with the following command:
nmcli c add con-name eth1-dhcp-server type ethernet ifname eth1 ipv4.method shared ipv6.method ignore ipv4.addresses 10.79.0.1
IP: 10.79.0.1/24
wlan0 “WiFi AP”
wlan0 is configured similarly to eth1, providing a small LAN, but instead using a WiFi Access Point. The Access Point, DHCP server and static IP, is setup with the following commands:
nmcli d wifi hotspot ifname wlan0 ssid <ss_id> password <password>
nmcli c modify Hotspot connection.autoconnect yes ipv4.addresses 10.80.0.1
IP: 10.80.0.1/24
Ping Test Setup
To test communication across networks I’ve connected the following devices to each of the networks.
Device | Network (Identified by Linux box’s network interface) | IP |
---|---|---|
PC1 | eth0 | 192.168.100.145 |
PC2 | eth1 | 10.79.0.77 |
PC3 | wlan0 | 10.80.0.16 |
Ping Test Results
PC1 (192.168.100.145):
ping 10.79.0.77
✕ Fail
ping 10.80.0.16
✓ Success
PC2 (10.79.0.77):
ping 192.168.100.145
✓ Success
ping 10.80.0.16
✓ Success
PC3 (10.80.0.16):
ping 192.168.100.145
✓ Success
ping 10.79.0.77
✕ Fail
The results of this tests indicate some positive results, with successful routing of packets with destinations of 192.168.100.0/24 and 10.80.0.0/24, but not to 10.79.0.0/24.
Troubleshooting Attempts
After battling to try and get all packets routed successfully I’ve still made very little progress. However I have come across one interesting find to do with modifying the route metric of the 10.80.0.0/24 route, changing it from 150 to 101 (lower than the 10.79.0.0/24 route). This changes the ping behaviour so that packets with destination 10.79.0.0/24 get successfully routed, and now 10.80.0.0/24 are not. Setting them to the same metric did not get them to both work, so I’m not sure there is a related permanent fix here…
Original routing table:
$ ip route
default via 192.168.100.1 dev eth0 proto dhcp metric 100
10.79.0.0/24 dev eth1 proto kernel scope link src 10.79.0.1 metric 101
10.80.0.0/24 dev wlan0 proto kernel scope link src 10.80.0.1 metric 150
169.254.0.0/16 dev eth0 scope link metric 1000
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.100.0/24 dev eth0 proto kernel scope link src 192.168.100.105 metric 100
Modified routing table:
$ ip route
default via 192.168.100.1 dev eth0 proto dhcp metric 100
10.79.0.0/24 dev eth1 proto kernel scope link src 10.79.0.1 metric 101
10.80.0.0/24 dev wlan0 proto kernel scope link src 10.80.0.1 metric 100 ** reduced from 150
169.254.0.0/16 dev eth0 scope link metric 1000
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.100.0/24 dev eth0 proto kernel scope link src 192.168.100.105 metric 100
Is there anyone out there with a solid understanding on what is going on here? And even better yet a solution!
Thanks for taking a look.