LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-10-2003, 02:33 PM   #1
Morning_Star
LQ Newbie
 
Registered: Feb 2003
Posts: 3

Rep: Reputation: 0
Routing and nat


Hey!
I recently installed Mandrake 8.2 on a system w/ 2 network adapters. I have a network w/ two systems that was directly connected to a switch then into a cable modem to access the internet. I would like to make my network a private network with a subnet of 192.168.0.0, and use the mandrake Linux box as a router to the internet.

I have already setup the environment to make this work. Using one system to test the setup. Here is configuration of the Linux system:

Network Adapter A - Internet
DHCP: Yes
IP: 24.234.x.x
Subnet: 255.255.255.0
Gateway: 24.234.x.1
DNS: Provided by DHCP

Network Adapter B - Private Network
Static: Yes
IP: 192.168.0.10
Subnet: 255.255.255.0


Very basic LAN configuration as you can see. I am able to ping both the internet gateway (24.234.x.1) and my test PC (192.168.0.3) from the Linux system. I am also able to ping both interfaces on Linux system (192.168.0.10 and 24.234.x.x) from the test workstation. However, it will not route out and I am unable to ping the internet gateway (24.234.x.1) from the test workstation.

I have some experience with routing, but never done this with Linux. I understand you have to configure it but there is just so much information out there and no step-by-step guides on how to do it. If I do it once, I can always enhance upon it, but I have to start somewhere.

Please help me configure the NAT and routing on Linux system for my machines on my private network to access the internet. I can still access http request thorough my proxy but nothing else.
 
Old 02-10-2003, 08:05 PM   #2
Morning_Star
LQ Newbie
 
Registered: Feb 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Unhappy c'mon

someone has to know something??? When I try to use the iptables firewall in webmin I get this...."Either the /proc filesystem does not exist or iptables is not supported by your kernel. Maybe you have to load the ip_tables module (insmod ip_tables)? Or do you have an 2.2.x or earlier kernel version?"

I have found the updated kernel I just don't know what to do with it.

When I plug my cable modem into my XP box I have outside connectivity other than just getting the http requests from my proxy server, so I know there is a configuration issue with my Linux box. Am I even on the right track with IPtables or should I try something else?

edit: actually the first post should read Mandrake 9.0...lol don't know how I messed that one up!

Last edited by Morning_Star; 02-10-2003 at 08:06 PM.
 
Old 02-11-2003, 10:32 AM   #3
SlickWilly
Member
 
Registered: Dec 2002
Posts: 327

Rep: Reputation: 30
You're on the right lines yes

I don't know about Mandrake specifically, but you *should* have iptables support built into the kernel by default.

You may *not* have iptables turned on. I know Redhat, out of the box, uses ipchains.

Iptables and ipchains don't live together nicely. If you have ipchains running and attempt to start iptables it'll complain that it can't insert a hook and 'your kernel doesnt' support iptables'.

Which it does. But its kernel space has already been usurped by ipchains.

So, turn off ipchains.

chkconfig -del ipchains

then service iptables start

chkconfig -add iptables

You'll need to add various iptables rules. And there are *hundreds* of how-to's on how to do this. Look on freshmeat for 'jay iptables' and you'll get one of the more popular config programs.

I do it by hand, because um.. I'm anal like that, but your problem is that you're not routing packets from your internal to your external interface.

You need to do this :

echo 1 > /proc/sys/net/ipv4/ip_forward # Enable IP masq

$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

where
IPTABLES=/sbin/iptables
EXTIF="eth0"
INTIF="eth1"

change your external / internal interface numbers accordingly.

Slick.
 
Old 02-11-2003, 11:06 AM   #4
cojo
Member
 
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262

Rep: Reputation: 31
slickwilly, is it possible I could get a copy of your iptables rule set? I searched and searched on the net still not sure what exactlly what I need to put in to the file.....
 
Old 02-11-2003, 11:25 AM   #5
SlickWilly
Member
 
Registered: Dec 2002
Posts: 327

Rep: Reputation: 30
Um.. you don't want mine..

I've got some messed up stuff in mine which while it works doesn't look pretty..

Here's one I found that seems to be okay.

http://orbital.wiretapped.net/~technion/iptables

And here's a site which has a ton of resources on it worth visiting / reading...

http://www.linuxguruz.org/iptables/



Slick.
 
Old 02-11-2003, 11:31 AM   #6
cojo
Member
 
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262

Rep: Reputation: 31
thanks slick....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two-way NAT routing MPowers Linux - Networking 3 06-24-2005 03:24 PM
nat routing vaat Linux - Networking 11 02-16-2005 10:02 AM
routing through nat booyah Linux - Networking 3 01-17-2004 08:40 PM
real routing under nat routing nothingmuch Linux - Networking 4 10-27-2003 03:11 PM
Routing behind NAT bax *BSD 5 04-26-2003 05:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration