next up previous contents index
Next: Enabling Routing Up: Home Networking Previous: Private Networks   Contents   Index


Network Address Translation

Common switches provide network address translation (NAT), but for a few dollars less you can get one without that service. If you cannot NAT the addresses with a switch you can do it with your computer. Install two network cards and use ipchains to translate the addresses. Here are some lines you could use to translate addresses listed above:

-A forward -s 10.0.0.0/8 -d 0.0.0.0/0 -j MASQ
-A forward -s 172.16.0.0/12 -d 0.0.0.0/0 -j MASQ
-A forward -s 192.168.0.0/16 -d 0.0.0.0/0 -j MASQ

Just put these lines in the /etc/sysconfig/ipchains file. The next time you start ipchains the rules will be in effect. This is how you would restart ipchains:

bash# /etc/rc.d/init.d/ipchains stop
Flushing all chains:                                       [  OK  ]
Removing user defined chains:                              [  OK  ]
Resetting built-in chains to the default ACCEPT policy:    [  OK  ]
bash# /etc/rc.d/init.d/ipchains start
Flushing all current rules and user defined chains:        [  OK  ]
Clearing all current rules and user defined chains:        [  OK  ]
Applying ipchains firewall rules:                          [  OK  ]



Joseph Colton 2002-09-24