I've been using Linux for awhile, but I've only had one machine... so I admit, I'm a total newbie all over again when it comes to networking. I'm trying to get my Slackware box to share the cable connection with a WinXP machine. Here's what I've done thus far:
Made rc.ip_forward executable.
In /etc/inetd.conf (sp?), I manually set up eth0 and eth1. I made eth0 DHCP enabled and left it alone, as that is the external connection. On eth1, I gave it an IP of 192.168.0.1, mask of 255.255.255.0, and put in my ISP's DNS as the nameserver.
On the WinXP machine, I configured it's NIC to have an IP of 192.168.0.2, gateway of 192.168.0.1. ISP DNS server for Primary DNS.
I couldn't ping one way or the other. Then I found that Slack wasn't seeing eth1 (a Marvell Yukon Gigabit onboard), so I dug around and found it needed a module. Did a modprobe sk98lin, and voila! The NIC was seen and I could ping my XP machine from Slack, and the Slack machine from Windows. Added that to rc.modules.
Okay, so now I've got all NICs manually set up, the module added to startup, so now I needed the NAT script in rc.local. Using Pat's example in rc.modules, I put in the following:
Code:
EXTERNAL=eth0
INTERNAL=eth1
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "Setting up NAT (Network Address Translation)..."
iptables -P FORWARD DROP
iptables -A FORWARD -i $EXTERNAL -o $INTERNAL -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTERNAL -o $EXTERNAL -j ACCEPT
iptables -t nat -A POSTROUTING -o $EXTERNAL -j MASQUERADE
With everything I've read, it seems like all this should work. However, when I rebooted, the Marvell Gigabit was dead (no activity whatever, even though the module loaded), and I could no longer even get to the internet from Slack as I could before making the changes.
Not sure what I'm missing here? If anyone has any help to offer, it'd be greatly appreciated. As a note, there's no X on this install, I installed Slack 10.1 with only the necessities of /a, /ap, /k, /n so I can learn more doing everything manually.