I have three Raspberry Pi's connected to Linux machines and one computer connected to a router which is connected to the Internet. My goal is to configure each Raspberry Pi so that they can communicate with each other, but also automatically route any Internet requests through the main computer's router so I can ping actual websites and get a response.
So far, I have used:
sudo ifconfig eth0 192.168.1.X netmask 255.255.255.0 up
sudo route add default gw 192.168.1.254 eth0
Where X is 10, 11, and 12 respectively for each of the Linux machines. The IP address of the machine with access to the Internet is 192.168.1.254, but I now need to configure NAT so that the IP tables properly forward Internet requests from the Linux machines using the Raspberry Pi's.
As of now, the IP table of the Internet-connected machine is:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 1 0 0 eth1
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
I'm somewhat new to network engineering, so any help/advice would be greatly appreciated. Currently, all four of the machines can ping each other and get responses. The only issue I'm facing is getting the three Linux machines to ping websites like this ping www.google.com
.