Private networks for dummies
Posted by isilanes on October 5, 2006
Requirements and setup
Your NAT computer needs two Ethernet cards: one to connect it to the Internet, and another one to connect it to the laptop. You also need a crossover cable, to connect the laptop to the desktop computer.
The physical setup is easy: make the connections as below:
Desktop computer setup
You need to set
eth1 (second NIC) of your comp to connect to the LAN, and leave the
eth0 as it was (to connect to the internet). Edit
/etc/network/interfaces (for Debian. Other distros, edit the corresponding file), and add (suposing the network you want to create is 192.168.10.0):
iface eth1 inet static address 192.168.10.1 netmask 255.255.255.0 broadcast 192.168.10.255 gateway 192.168.10.1 post-up route del -net 0.0.0.0 gw 192.168.10.1 eth1 post-up route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.10.1 eth1
The last two lines (
man interfaces) remove the default routing path that bringing up
eth1 sets, because we want
eth0 to still be the default, with only signals going to
192.168.10.0 network being routed through
eth1. The latter is set by the last line.
We have to modify
/etc/network/interfaces, too. Here it’s
eth0 that we set up:
iface eth0 inet static address 192.168.10.2 netmask 255.255.255.0 broadcast 192.168.10.255 gateway 192.168.10.1
This entry was posted on October 5, 2006 at 1:25 pm and is filed under Free software and related beasts. Tagged: en, floss/linux, networks, Software. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.