![]() Marketplace:
|
IP Forwarding: Home NetworksConsider a home network of GNU/Linux and MSWindows machines, connected via ethernet. A GNU/Linux machine can connect to the Internet via PPP. We want to provide network access from all machines. We use iptables (for kernel version 2.4). Suppose Modern (98.9) is the host which will connect to the Internet using PPP. After installing iptables do the following on this host which will serve as the Internet gateway:
This clears the rules for filtering and then adds a rule to provide the IP forwarding. Now we need to turn it on for the kernel:
And that's it! This host, Modern (98.9) will now act as a gateway to the Internet for your local machines. There is some setup needed to have this survive a reboot. One approach is to do this through init.d, as explained in Section 46.2. The first step is to create a script file called /etc/init.d/myfirewall containing:
Then the firewall can be turned on and off with:
To have it started at boot and stopped at shutdown:
This creates the following links:
Another approach is to only turn it on and off as a PPP connection is established. See the scripts in /usr/share/doc/iptables/examples for details. Now Rose (98.31) and Inco (98.26), machines on the local home network, can have their network interface set up:
|
Marketplace: |
||||||||||
| Facts: " Humans are the best value in computers. Where else can you get a non-linear computer weighing only about 160 lbs., having a billion binary decision elements, that can be mass-produced by unskilled labour? " | ||||||||||||
Tuesday 22 May 2012 05:41:43 1337665303