I'm trying to set up a linux host as a router. I'm following the instruction at http://www.cyberciti.biz/tips/linux-as-router-for-dsl-t1-line-etc.html
which assured me it would be a 2-minute process, but after 2 minutes, I'm stuck. Here's what I did so far, per the instructions:
I am running Slackware distro, kernel 22.214.171.124
I currently have two NIC cards in this computer: eth0 is currently connected to a D-Link router (which, in turn, is connected to the ISP's cable modem), and eth1 is currently not connected to anything, but will be the LAN connection.
eth0 is configured in /etc/rc.d/rc.inet1.conf for DHCP.
STEPS SO FAR:
I connected eth0 to the cable mode and reset the NIC:
$ /etc/rc.d.rc.inet1 eth0_restart
That worked fine, eth0 got an IP. Then, I created the file /etc/sysctl.conf and added one line:
net.ipv4.ip_forward = 1
Then the iptables commands for IP forwarding and Masquerading:
$ iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
$ iptables --append FORWARD --in-interface eth1 -j ACCEPT
Here's where I'm stuck. How to I configure eth1 in /etc/rc.d/rc.inet1.conf? I want to give it a static IP for the LAN, but what do I put in for gateway and DNS? Won't specifying a gateway confuse eth0?
# Config information for eth1:
# Default gateway IP address:
Do I use /etc/resolv.conf for DNS servers? Start named? Can I somehow specify eth0's IP as the gateway?