Quote:
Ya I you are right. Plse tell me how to configure DNS as a router
|
There are three steps to doing this.
1 - Enable IP Forwarding. Look for a file called ip_forward and the it's contents to 1. For example:
bash -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
2 - Enable NAT Take the packets that originate from the 192.168.1.0/255.255.255.0 network and are going to be routed the eth1 card, and change them so it looks like the IP address they came from *is* the eth1 IP address as follows:
iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -o eth1 -j MASQUERADE
3 - on your 'local' machines that need access, you need to set them to use 192.168.1.7 as their gateway / default route.
There is an alternative method, called bridging, where you can set your two NIC cards to "bridge" to the same network. It effectively accomplishes the same thing, but at a lower level. Using NAT with IP tables is emulating a layer 3 switch which bridging emulates a layer 2 switch. Here is a
link to a how-to that also has information about the method above.