Linux as router.

Linux as router.

Post by R. Christopher Harshma » Wed, 01 Sep 1999 04:00:00



I've got a box with two NICs in it that I'm trying to set up as a
router.  One NIC is assigned 192.168.0.150, and is connected to
the downstairs LAN.  The other is assigned 192.168.3.1 and should
be the gateway for the 3rd floor.  I'm running a basically stock
Debian 2.1 (Kernel 2.0.36, recompiled).  The box is called 'jump-gate'

The third floor boxen can access jump-gate (ssh and http), and
jump-gate can get to the Internet (192.168.0.1 is hooked into a
DSL feed downstairs, and is running IP Masq'ing).  But the third
floor boxen cannot get to the Internet through jump-gate.  (I've set
up Apache w/ Proxy on jump-gate as a temporary stopgap.)

The relevant information is as follows:

jump-point:~# ifconfig -a
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
          RX packets:37 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          Collisions:0

eth0      Link encap:Ethernet  HWaddr 00:40:95:00:27:3D
          inet addr:192.168.3.1  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2371 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2685 errors:0 dropped:0 overruns:0 carrier:0
          Collisions:0
          Interrupt:11 Base address:0x6500

eth1      Link encap:Ethernet  HWaddr 00:40:95:00:27:35
          inet addr:192.168.0.150  Bcast:192.168.0.255
Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8652 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5627 errors:0 dropped:0 overruns:0 carrier:0
          Collisions:1
          Interrupt:15 Base address:0x6600

jump-point:~# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt
Iface
192.168.3.0     0.0.0.0         255.255.255.0   U      1500 0          0
eth0
192.168.0.0     0.0.0.0         255.255.255.0   U      1500 0          0
eth1
127.0.0.0       0.0.0.0         255.0.0.0       U      3584 0          0
lo
0.0.0.0         192.168.0.1     0.0.0.0         UG     1500 0          0
eth1
jump-point:~# cat /proc/ksyms | grep "ip_forward"
0014186c ip_forward
001eb02c sysctl_ip_forward

Any thoughts?  Many thanks in advance!

- Chris

--
R. Christopher Harshman             http://ebhon.jnst.uor.edu/~harshman
Going for a B.S. : "Information Systems and Media Production" (JNST-UOR)
Celeron 300a | i440BX | Mystique 220 + RRStudio | SB Live! | Win98
PIII-450 | i440BX-2 | Fusion AGP 3Dfx Banshee | Yamaha PCI | Linux / NT

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

Linux as router.

Post by Tom Easte » Wed, 01 Sep 1999 04:00:00



> I've got a box with two NICs in it that I'm trying to set up as a
> router.  One NIC is assigned 192.168.0.150, and is connected to
> the downstairs LAN.  The other is assigned 192.168.3.1 and should
> be the gateway for the 3rd floor.  I'm running a basically stock
> Debian 2.1 (Kernel 2.0.36, recompiled).  The box is called 'jump-gate'

> The third floor boxen can access jump-gate (ssh and http), and
> jump-gate can get to the Internet (192.168.0.1 is hooked into a
> DSL feed downstairs, and is running IP Masq'ing).  But the third
> floor boxen cannot get to the Internet through jump-gate.  (I've set
> up Apache w/ Proxy on jump-gate as a temporary stopgap.)

Have you enabled IP forwarding via:

        echo 1 > /proc/sys/net/ipv4/ip_forward

-Tom
--
Tom Eastep               \    Opinions expressed here

Shoreline, Washington USA  \    those of my employer


 
 
 

Linux as router.

Post by R. Christopher Harshma » Thu, 02 Sep 1999 04:00:00


Yes.

I think it's a routing problem.  The network looks sort of like
this:

*** internet <--->  sprawl [192.168.0.1] <---+---> 192.168.0.0 network
                                             |
                                             |
                     [eth1:192.168.0.150] <--+
           jump-gate [eth0:192.168.3.1]   <--+
                |
                |
                +---> 192.168.3.0 network

Now, if I put a static route into sprawl pointing at, say, my
machine [192.168.3.100] everything works as it should:

sprawl:~# route add 192.168.3.100 gw 192.168.0.150

But hand-coding routes to every potential host is obviously
less than ideal.  However, when I try to simply add a net
route, I don't seem to be able to:

sprawl:~# route add -net 192.168.3.0 gw 192.168.0.150
SIOCADDRT: Invalid argument

Eh?

FWIW, sprawl is running RedHat 6, jump-gate is running Debian 2.1.
TIA!

- Chris



> Have you enabled IP forwarding via:

>    echo 1 > /proc/sys/net/ipv4/ip_forward

> -Tom
> --
> Tom Eastep               \    Opinions expressed here

> Shoreline, Washington USA  \    those of my employer


--
R. Christopher Harshman             http://ebhon.jnst.uor.edu/~harshman
Going for a B.S. : "Information Systems and Media Production" (JNST-UOR)
Celeron 300a | i440BX | Mystique 220 + RRStudio | SB Live! | Win98
PIII-450 | i440BX-2 | Fusion AGP 3Dfx Banshee | Yamaha PCI | Linux / NT

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

Linux as router.

Post by Tom Easte » Thu, 02 Sep 1999 04:00:00



> Yes.

> I think it's a routing problem.  The network looks sort of like
> this:

> *** internet <--->  sprawl [192.168.0.1] <---+---> 192.168.0.0 network
>                                              |
>                                              |
>                      [eth1:192.168.0.150] <--+
>            jump-gate [eth0:192.168.3.1]   <--+
>                 |
>                 |
>                 +---> 192.168.3.0 network

> Now, if I put a static route into sprawl pointing at, say, my
> machine [192.168.3.100] everything works as it should:

> sprawl:~# route add 192.168.3.100 gw 192.168.0.150

> But hand-coding routes to every potential host is obviously
> less than ideal.  However, when I try to simply add a net
> route, I don't seem to be able to:

> sprawl:~# route add -net 192.168.3.0 gw 192.168.0.150
> SIOCADDRT: Invalid argument

> Eh?

Er - I would think that you'd need to specify a netmask for a net route
(e.g., route add -net 192.168.3.0 -netmask 255.255.255.0 gw
192.168.0.150).

-Tom
--
Tom Eastep               \    Opinions expressed here

Shoreline, Washington USA  \    those of my employer

 
 
 

Linux as router.

Post by R. Christopher Harshma » Thu, 02 Sep 1999 04:00:00


I'm doing a dance for joy at everything now working,
whilst smacking myself in the forehead for being so
stupid.  Thank you, thank you, thank you.

- Chris



Quote:> Er - I would think that you'd need to specify a netmask for a net
route
> (e.g., route add -net 192.168.3.0 -netmask 255.255.255.0 gw
> 192.168.0.150).

--
R. Christopher Harshman             http://ebhon.jnst.uor.edu/~harshman
Going for a B.S. : "Information Systems and Media Production" (JNST-UOR)
Celeron 300a | i440BX | Mystique 220 + RRStudio | SB Live! | Win98
PIII-450 | i440BX-2 | Fusion AGP 3Dfx Banshee | Yamaha PCI | Linux / NT

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

1. Linux/Win2K Server As A Router vs. Linksys Router (BEFSR41)

Hi,

I have a cable modem connection with a single semi dynamic
public IP address.  Currently, I have installed a Linksys router
(BEFSR41) between the cable modem and my intranet LAN to share
my Linux machine as well as several windows machines.  I am
thinking to replace this Linksys Router with a home made Win2K
server or Linux running on either a winchip 200MHz or an AMD
K6-2 400MHz CPU (prefer to use a winchip 200MHz CPU from IOpener
and put the 400MHz CPU to the IOpener).  Frankly speaking, I am
opted to use Linux over Win2K as a router.  However, being
limited to only a single public IP address, I am force to
thinking of using Win2K instead of Linux as my router mainly
because I can attach several USB devices, i.e. VoIPBlaster,
ActionTec VoIP devices, etc.  to the router to use them.  As
with Linux, the VoIPBlaster driver found on the SourceForge
site, (http://sourceforge.net/projects/voip-blaster), is still
to early to use.

I am very confused to face this dilemma and am hoping you all
will be able to help me out.  TIA.

2. Limiting bandwidth to a proccess?

3. linux router Vs Linksys Router

4. Tracing Linux Kernel

5. Linux setup as IPX router and TCP/IP router??

6. Unix Administrators and Developers

7. Linux router vs Netopia router on DSL

8. Please Help-Kernel panic

9. Linux setup as IPX router and TCP/IP router??

10. Access to a novell server across a linux IP router (or needed I IPX router)

11. Linux Router Project (LRP): Make just a router ???

12. Suse Linux Router hinter Cisco Router ???

13. ADSL thourgh hardware router to a linux box router