Default Route & Policy Routing

Default Route & Policy Routing

Post by Frank Ueppin » Fri, 11 May 2001 02:44:19



Hi,
I need two default routes on my router.
One for routing traffic originated on my router and one for forwarding.
I think this is a job for policy routing but I don't know how to achieve
this.

Frank

 
 
 

Default Route & Policy Routing

Post by Dean Thompso » Fri, 11 May 2001 10:47:31


Hi Frank,

Quote:> I need two default routes on my router.
> One for routing traffic originated on my router and one for forwarding.
> I think this is a job for policy routing but I don't know how to achieve
> this.

Don't you just need one forwarding rule in IPchains and one route which
basically forwards all data off your network ?

You can only really have one default route for a machine at any one time.  You
can have other routes with different metrics, but normally only one default
route is present (is it the safety net).

See ya

Dean Thompson

--
+____________________________+____________________________________________+

| Bach. Computing (Hons)     | ICQ     - 45191180                         |
| PhD Student                | Office  - <Off-Campus>                     |
| School Comp.Sci & Soft.Eng | Phone   - +61 3 9903 2787 (Gen. Office)    |
| MONASH (Caulfield Campus)  | Fax     - +61 3 9903 1077                  |
| Melbourne, Australia       |                                            |
+----------------------------+--------------------------------------------+

 
 
 

Default Route & Policy Routing

Post by Raine » Thu, 24 May 2001 20:51:10


Natualy there is only one "DEFAULT" route.
But:
I also have 2 lines to different providers (permanent online). if one of
them fail, I have to change the default route to the other one.
This should be possible to do automatic. --- But how?

--
Best regards / Mit freundlichen Gruessen

R. Pietsch



Quote:

> Hi Frank,

> > I need two default routes on my router.
> > One for routing traffic originated on my router and one for forwarding.
> > I think this is a job for policy routing but I don't know how to achieve
> > this.

> Don't you just need one forwarding rule in IPchains and one route which
> basically forwards all data off your network ?

> You can only really have one default route for a machine at any one time.
You
> can have other routes with different metrics, but normally only one
default
> route is present (is it the safety net).

> See ya

> Dean Thompson

> --

+____________________________+____________________________________________+

|
> | Bach. Computing (Hons)     | ICQ     - 45191180
|
> | PhD Student                | Office  - <Off-Campus>
|
> | School Comp.Sci & Soft.Eng | Phone   - +61 3 9903 2787 (Gen. Office)
|
> | MONASH (Caulfield Campus)  | Fax     - +61 3 9903 1077
|
> | Melbourne, Australia       |
|

+----------------------------+--------------------------------------------+
 
 
 

Default Route & Policy Routing

Post by Jér?me PETAZZON » Thu, 24 May 2001 21:09:28


Quote:> Natualy there is only one "DEFAULT" route.
> I also have 2 lines to different providers (permanent online). if one of
> them fail, I have to change the default route to the other one.
> This should be possible to do automatic. --- But how?

you may use a routing protocol across your lines, so when a line
is down, its default route won't be advertised anymore.

you can also craft some scripts to detect error conditions and
swap default routes.

if one of your lines is a PPP link, you can play with the defaultroute
option and some metrics, i.e.:

link 1 = ppp with defaultroute
link 2 = isdn with "hardcoded" default route of metric 2

link 1 default route will always be used, but when it's down,
link 2 will be used instead (and probably trigger a dialup).

finally, if your hosts are servers which receive connexions but
won't make outcoming connexions, you don't need a "global" default
route, but a "per link" default route, like:

ip rule add from my.fir.st.ip lookup 100
ip rule add from my.sec.ond.ip lookup 200
ip route add table 100 default via my.fir.st.gw
ip route add table 200 default via my.sec.ond.gw

so each response will go to the right link.

 
 
 

Default Route & Policy Routing

Post by Dean Thompso » Thu, 24 May 2001 21:57:03


Hi!,

Quote:> Natualy there is only one "DEFAULT" route.
> But:
> I also have 2 lines to different providers (permanent online). if one of
> them fail, I have to change the default route to the other one.
> This should be possible to do automatic. --- But how?

It can be done automatically with routing protocols, especially RIP and BGP
for dealing with multiple ISP providers, however the setup can get quite
tricky.  As Jerome has mentioned you can get around this trick, by building a
script which establishes both default routes but gives one route a metric of 2
and another a metric of 3.

If one link is to fail (which can be detected by trying to reach the remote
gateway address) then you take the other route and lower its metric to 1.
This will have the effect of changing the default route for you.  Once you
find that your primary line has come good, you can then take the route which
has a metric of 1 and increase it back to 2 or 3 and take the other route
metric and lower it to 1.

I suspect you will have to write a script like this to get your situation to
work, as routing protocols normally deal with different networks and not
necessarily the default route (although BGP makes an exception here).

See ya

Dean Thompson

--
+____________________________+____________________________________________+

| Bach. Computing (Hons)     | ICQ     - 45191180                         |
| PhD Student                | Office  - <Off-Campus>                     |
| School Comp.Sci & Soft.Eng | Phone   - +61 3 9903 2787 (Gen. Office)    |
| MONASH (Caulfield Campus)  | Fax     - +61 3 9903 1077                  |
| Melbourne, Australia       |                                            |
+----------------------------+--------------------------------------------+

 
 
 

Default Route & Policy Routing

Post by Dean Thompso » Thu, 24 May 2001 21:57:11


Hi!,

Quote:> Natualy there is only one "DEFAULT" route.
> But:
> I also have 2 lines to different providers (permanent online). if one of
> them fail, I have to change the default route to the other one.
> This should be possible to do automatic. --- But how?

It can be done automatically with routing protocols, especially RIP and BGP
for dealing with multiple ISP providers, however the setup can get quite
tricky.  As Jerome has mentioned you can get around this trick, by building a
script which establishes both default routes but gives one route a metric of 2
and another a metric of 3.

If one link is to fail (which can be detected by trying to reach the remote
gateway address) then you take the other route and lower its metric to 1.
This will have the effect of changing the default route for you.  Once you
find that your primary line has come good, you can then take the route which
has a metric of 1 and increase it back to 2 or 3 and take the other route
metric and lower it to 1.

I suspect you will have to write a script like this to get your situation to
work, as routing protocols normally deal with different networks and not
necessarily the default route (although BGP makes an exception here).

See ya

Dean Thompson

--
+____________________________+____________________________________________+

| Bach. Computing (Hons)     | ICQ     - 45191180                         |
| PhD Student                | Office  - <Off-Campus>                     |
| School Comp.Sci & Soft.Eng | Phone   - +61 3 9903 2787 (Gen. Office)    |
| MONASH (Caulfield Campus)  | Fax     - +61 3 9903 1077                  |
| Melbourne, Australia       |                                            |
+----------------------------+--------------------------------------------+