My Setup:
In my home setup, I have 3 NICs one that is connected to the internet (enp1s0),
The other two forward internet access to local devices (enp2s0 & enp3s0).
PC1 is connected to enp2s0 with IP Address (10.10.10.2/24).
PC2 is connected to enp3s0 with IP Address (10.10.20.2/24).
Note that I’m using Ubuntu 22.04.4.
Also, I did the following steps to route internet:
-
Uncommented the following line in
/etc/sysctl.conf
net.ipv4.ip_forward=1
-
Configured IP tables using the following commands:
sudo iptables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE
sudo iptables -A INPUT -i enp2s0 -j ACCEPT
sudo iptables -A INPUT -i enp3s0 -j ACCEPT
My problem:
When I try to make a LAN session for a game or anything else,
PC1 and PC2 can’t see each other’s session (I think they need to be on the same subnet).
Anything I can do & Thanks?