SETUP LINUX AS ROUTER

SETUP LINUX AS ROUTER

Post by mohammad ulla » Wed, 25 Sep 2002 15:04:28



Hi,

Consider me a dumbass and a linux newbie.

I want to setup linux as a router and my situation is like this drawing:

windows xp                     linux box (redhat 7.3)
1 NIC card <---cross cable---> eth1
                                eth0---straight cable--->CABLE MODEM

NOTES :
- eth0 which is connected to cable modem automatically gets ip when
redhat boots up ( i am able to access internet on linux box)
- eth1 doesnt, i used : "ifconfig eth1 up" and it got a local ip
starting with 192.x.x.x

How do I route things here so that I can use internet from windows too?

I want to be able to access internet from both machines. Will some
knowledgeable person show me the ropes. IF you could outline the
steps/commands and what have you it would be excellant. Specific
commands and explanations is what i am looking for. Thanks in advance
for the help.

Mohammad

 
 
 

SETUP LINUX AS ROUTER

Post by Vincent Zweij » Wed, 25 Sep 2002 18:04:53



||  windows xp                     linux box (redhat 7.3)
||  1 NIC card <---cross cable---> eth1
||                                  eth0---straight cable--->CABLE MODEM

||  - eth0 which is connected to cable modem automatically gets ip when
||  redhat boots up ( i am able to access internet on linux box)
||  - eth1 doesnt, i used : "ifconfig eth1 up" and it got a local ip
||  starting with 192.x.x.x
||
||  How do I route things here so that I can use internet from windows too?

You need to:

  * Point the XP box to the linux box as its gateway,
  * Configure masquerading (source NAT) on the linux box, and
  * Turn on routing on your linux box.

Go to the relevant HOWTOs for the details.  The NET HOWTO comes to
mind.

Good luck.                                                Vincent.

 
 
 

SETUP LINUX AS ROUTER

Post by nick haddo » Wed, 25 Sep 2002 23:56:25



> Hi,

> Consider me a dumbass and a linux newbie.

> I want to setup linux as a router and my situation is like this drawing:

> windows xp                     linux box (redhat 7.3)
> 1 NIC card <---cross cable---> eth1
>                                 eth0---straight cable--->CABLE MODEM

> NOTES :
> - eth0 which is connected to cable modem automatically gets ip when
> redhat boots up ( i am able to access internet on linux box)
> - eth1 doesnt, i used : "ifconfig eth1 up" and it got a local ip
> starting with 192.x.x.x

> How do I route things here so that I can use internet from windows too?

> I want to be able to access internet from both machines. Will some
> knowledgeable person show me the ropes. IF you could outline the
> steps/commands and what have you it would be excellant. Specific
> commands and explanations is what i am looking for. Thanks in advance
> for the help.

> Mohammad

Well you need to turn ip forwarding on using the following.

echo "1" >/proc/sys/net/ipv4/ipforward - this command will need to be
entered in a boot script for re-boot permanancy

I would recommend using iptables to protect your internal network
using NAT (needed as you are using rfc1918 internal addresses) and
restricting incoming connections. I have written a newsgroup post on
how to turn off ipchains and enable iptables for Redhat, just search
on my alias - codfather.

Also visit www.netfilter.org for many useful tutorials.

codfather

 
 
 

SETUP LINUX AS ROUTER

Post by David Lewi » Thu, 26 Sep 2002 02:12:31


IPTables:
http://www.linuxguruz.org/iptables/howto/iptables-HOWTO.html

But what you really need is:
http://www.linuxguruz.org/iptables/howto/ipnatctl-HOWTO.html


> Hi,

> Consider me a dumbass and a linux newbie.

> I want to setup linux as a router and my situation is like this drawing:

> windows xp                     linux box (redhat 7.3)
> 1 NIC card <---cross cable---> eth1
>                                 eth0---straight cable--->CABLE MODEM

> NOTES :
> - eth0 which is connected to cable modem automatically gets ip when
> redhat boots up ( i am able to access internet on linux box)
> - eth1 doesnt, i used : "ifconfig eth1 up" and it got a local ip
> starting with 192.x.x.x

> How do I route things here so that I can use internet from windows too?

> I want to be able to access internet from both machines. Will some
> knowledgeable person show me the ropes. IF you could outline the
> steps/commands and what have you it would be excellant. Specific
> commands and explanations is what i am looking for. Thanks in advance
> for the help.

> Mohammad