LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Networking via Crossover- Not sure what I did wrong? (https://www.linuxquestions.org/questions/slackware-14/networking-via-crossover-not-sure-what-i-did-wrong-292989/)

Makaelin 02-21-2005 10:48 AM

Networking via Crossover- Not sure what I did wrong?
 
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.

carboncopy 02-22-2005 09:41 PM

Can you ping each other now?

To check your iptables is loaded correctly
Code:

iptable -L
I found your problem.

You need to be explicit about the location of iptables

/usr/sbin/iptables

instead of just iptables

Your PATH have not been loaded before you login.

Makaelin 03-07-2005 10:48 PM

Just an update, in case my idiocy helps anyone else.

I found the problem. Slackware swapped the NICs around upon reboot (eth0 became eth1, vice versa). I hadn't even thought about it doing that on it's own.

So, I'm a fool. Everything else I had done was correct. :rolleyes:

thick_guy_9 07-04-2005 03:47 PM

Hello Makaelin
would you mind sharing (a detailed how-to would be most welcome) how you did this? Also can you add Linux-Linux configuration?

Thx

Makaelin 07-26-2005 10:04 PM

Everything I did is posted above, actually. Just in the end, I had to swap eth0 and eth1 in the EXTERNAL and INTERNAL parts. Hope this helps!

EDIT : Just read through my post again in detail and realized that it's probably not very helpful if you're as clueless as I was when I started learning how to do all that. I'll try and go back over my steps again and post a detailed HOWTO tomorrow!


All times are GMT -5. The time now is 05:26 PM.