Router help request

Dustin Cross dusty at sandust.com
Fri Dec 28 11:27:49 PST 2001


I agree, Static routing in *nix is very easy.  Just use the route command to add 
all your routes and your good to go.

The systax of the route command is:
route [add|delete|change] (-net|-host) destination[IP|defailt] (-netmask) gateway
[IP|interface] metric

The netmask field is optional, but will allow you to do things that most people 
will tell you aren't possible, like variable length subnet masking.  The Metric 
field is no longer listed in the man page, but it was used to set priority.  If you 
had two routes to the same destination going out two seperate interfaces you would 
give the primary a metric of 0 and the secondary a metric of 1.  If the primary was 
unreachable then it would route to the secondary.

Here are some examples.

to set up a default route:
#su -c "router add default eth0 0"

to route all 192.168.1.0/24 traffic to eth1:
#su -c "route add -net 192.168.1.0 -netmask 255.255.255.0 eth1 0"

to route all 192.168.2.0/25 traffic to eth2:
#su -c "route add -net 192.168.2.0 -netmask 255.255.255.128 eth2 0"

to route all 192.168.2.128/26 traffic to eth3:
#su -c "route add -net 192.168.2.128 -netmask 255.255.255.64 eth3 0"

to send the rest of your 192.168.2.192/26 traffic to another router:
#su -c "route add -net 192.168.2.192 -netmask 255.255.255.64 206.24.36.3 0"


Remember that these are static and if something changes you have to go back and 
edit these routes, but most *nix come with routed which does RIP routing if you 
want to have your *nix router to use a dynamic routing protocol.  Other things like 
Zebra and GateD are available, but the route command can do it all if your routes 
don't change often.

For your problem it sounds like you need to set up your PPP to assign an IP in a 
different range than your dhcp.

For example:
give dhcp - 192.168.1.0/24
give ppp - 192.168.2.1/24

Then setup your routes
#su -c "router add default eth0 0"
#su -c "route add -net 192.168.1.0 -netmask 255.255.255.0 eth1 0"
#su -c "route add -net 192.168.2.0 -netmask 255.255.255.0 ppp0 0"

Basically I think your system doesn't know how to route back to your dial-up 
connection.


Dusty

PS - I would be interested in your class Brian.





Brian Chee (chee at hawaii.edu) wrote: 
>
>uhmmm....it's only overkill if he doesn't need to use real
>subnets.....otherwise masquerade and iptables/ipchains is the solution.....
>
>What I was trying to get at, is that MANY folks have a mix of unix+netware
>and/or NT and would like to utilize multiple subnets on an isolated
>corporate intranet.  (ie. law firms are notorious for this) So the solution
>I suggested of using static routes is cheaper and faster (cpu wise) than
>masquerading and easier to implement than zebra or some other type of soft
>router.  (yes I know all he wanted was masquerade, but since routing on unix
>isn't well know, it's worth just a little soap box time)
>
>Adding a static off linux/unix box is dramatically easier to maintain than
>those under NT and doesn't kill the box like NT tends to do.  So if the
>organization really does wanna use "real" subnets say on an isolated
>intranet...then routing rather than masquerading gets alot more bang for the
>buck.... (http://master-www.linuxrouter.org:8080/) is the Linux Router
>project....this will allow you to turn an old 486 into a router even if it
>doesn't have a hard disk....the basic image fits onto a 1.44mb floppy.
>
>Not to mention, you get some very nice traffic isolation without too much
>cpu overhead....and if you ever find yourself needing multicast, you can add
>a soft router to the existing box and implement something easy like dvmrp or
>PIM-DM.
>
>Speaking of which....how much desire is there on this list for a class on
>multicast routing protocols? I've got one that talks about intranet (DVMRP,
>PIM-DM, PIM-SM, PIM-SM/SSM) and internet (MSDP, MBGP, PIM-SM/SSM)  multicast
>routing protocols and takes about 1.5 hour to deliver. It's a recycle from
>what I delivered at Networld+Interop last year.
>
>If there is desire, I can deliver it via the UH ICS Club and make it free to
>anyone that wants to show up for it.
>
>/brian chee
>
>University of Hawaii ICS Dept
>Advanced Network Computing Lab
>1680 East West Road, POST rm 311
>Honolulu, HI  96822
>808-956-5797 voice, 808-956-5175 fax
>
>----- Original Message -----
>From: "MonMotha" <monmotha at indy.rr.com>
>To: "Linux & Unix Advocates & Users" <luau at maile.hi.net>
>Sent: Friday, December 28, 2001 1:28 AM
>Subject: [luau] Re:Router help request
>
>
>> I think for his application, this would be a bit of overkill...  All
>> we're talking about is 3 physical subnets, two of them acting logically
>> as one (I'm hoping he's using proxy-arp on his ppp connection, otherwise
>> that's probably the problem).  In this case, since all you have is one
>> internal IP subnet (the private one) and the rest of the world, we're
>> talking about 3 routes (add one in for loopback).  These routes are
>> likely not to change (unless he does something drastic like renumber his
>>   internal LAN), so dynamic routing daemons wouldn't be of much use here
>> and could very well just complicate matters more.
>>
>> --MonMotha
>>
>> Brian Chee wrote:
>>
>> > Here's one of the BIG issues of getting a plain vanilla
>> > linux/bsd/solaris/etc box to be a router....they normally don't talk
>routing
>> > protocols like RIP/OSPF/BGP/etc.....so you literally have to create a
>static
>> > route both in the unix'ish box and in the upstream router.
>> >
>> ....
>>
>>
>>
>> ---
>> You are currently subscribed to luau as: chee at hawaii.edu
>> To unsubscribe send a blank email to $subst('Email.Unsub')
>
>
>---
>You are currently subscribed to luau as: dusty at sandust.com
>To unsubscribe send a blank email to $subst('Email.Unsub')
>



More information about the LUAU mailing list