June 2016
Intermediate to advanced
152 pages
3h 30m
English
Connecting two local networks is useful, but these days it's more common to want to connect a local network to the Internet. The basic concept works the same, but with the necessary addition of NAT. NAT rewrites your packet headers in order to make them appear as if they come from your router, thus effectively hiding your system's address from the destination.
Create a third NIC (eth2) on server 1 and connect it to your cable modem or ISP's router.
eth2 to receive an IP address via DHCP:auto eth2 iface eth2 inet dhcp
iptables to enable NAT on packets heading out through eth2:# /sbin/iptables -t nat -A POSTROUTING -o eth2 \ -j MASQUERADE # /sbin/iptables -A FORWARD -i eth2 -o eth0 -m \ state ...
Read now
Unlock full access