Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two default routes - depending on interface?

Status
Not open for further replies.

pilgie

Technical User
May 2, 2006
16
GB
Hi,

I would like to know if it is possible to have two default routes on a router?

I would like to have a default route set depending on what interface the packet came in on? Is this possible?

Any advice appreciated!

Thanks,

Pilgie.
 
Hi,

Should should be able to do this via Routing policies using Route Maps, in the Route map you will match data to a criteria ( access list, interface ) and if it does match, set other criteria such as exit interface etc.

Below is a small example, but route maps are extremly dynamic and should sort you out.

route-map test, permit, sequence 10
Match clauses:
interface FastEthernet0/2
Set clauses:
interface FastEthernet0/2
Policy routing matches: 0 packets, 0 bytes
route-map test, permit, sequence 20
Match clauses:
interface FastEthernet0/3
Set clauses:
interface FastEthernet0/4
Policy routing matches: 0 packets, 0 bytes

lee.


LEEroy
MCNE6,CCNP,CWNA,CCSA,Project+
 
Ok thabks for your reply - I'd just like to re-iterate - please bear with me as I am new to this!

What I have is two sub interfaces. all packets coming in on sub interface 1 will use default gateway xxx.xxx.xxx.xxx and all packets comning in on subinterface 2 will use the gateway yyy.yyy.yyy.yyy.

Any chance you could be a bit more specific as to what I need to do?
 
If it is purley anything on interface 1 needing to goto ip address 1.1.1.1 as its next hop and anything from interface 2 needing to goto 2.2.2.2 as its next hop I would do the following

Route-map next-hop 10 permit
match interface serial0/1.1
set ip next-hop 1.1.1.1
Route-map next-hop 20 permit
match interface serial0/1.2
set ip next-hop 2.2.2.2

interface serial 0/1.1
ip policy route-map next-hop
interface serial 0/1.2
ip policy route-map next hop

* The above is how I would set things up and then test... so make sure you do this in a test environment first or when no one is using that system ;)

LEEroy
MCNE6,CCNP,CWNA,CCSA,Project+
 
For more details, go to Cisco's website and lookup policy-based routing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top