I have already asked a topic with an almost similar question, but I did not reach the end point, even after reading the literature.
Our devices:
- Laptop with ip address 192.168.0.24 connected to switch
- The first Linux machine:
eth1 with ip address 192.168.0.155 - connected to the switch
auto eth1 iface ethic net dhcp
iptables looks like this:
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth1 -j MASQUERADE
and
eth0 with ip address 192.168.2.155 - connected to the eth0 of the second Linux machine.
auto eth0 iface eth0 inet static address 192.168.2.155 netmask 255.255.255.0
- The second Linux machine:
eth0 with ip address 192.168.2.167 - is connected to eth0 first Linux machine and has access to the network through it.
auto eth0 iface ethic net dhcp
I need to add the rule to the iptables first Linux machine, so that when connected via a laptop via ssh root@192.168.0.155 -73 or any other port, this is not the main thing, I was hooked to ssh connecting the second Linux machine.
eth1connected to the xxx.xxx.0.xxx network, and the first Linux machine already creates its network and distributes the Internet viaeth0second Linux machine. - Insider