cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5319
Views
15
Helpful
4
Replies

Setting up static routes

mandolordian
Spotlight
Spotlight

Hello,

I don't quite get static routes. How would I go about implementing static routes for two routers that are connected to each other?

I've included the pkt file below, which is where I'd like to add static routes.

 

2 Accepted Solutions

Accepted Solutions

Hello,

 

in the static routes, you need to specify the remote, not directly connected network(s), with the next hop being the neighboring interface:

 

R1(config)#ip route 192.168.1.96 255.255.255.240 192.168.2.2




R2(config)#ip route 192.168.1.0 255.255.255.192 192.168.2.1
R2(config)#ip route 192.168.1.64 255.255.255.224 192.168.2.1

View solution in original post

Martin L
VIP
VIP

 

each router knows about its directly connected networks and must have link to other router (share subnet) to exchange info.

each router would need to have static route to reach the network that he does not own (not directly connected) either via next hop IP or his exit interface.  So, Router0 needs to know about all networks on R1, except the one that they share, and vice versa.  R0 would need to know how (which way) to reach other networks beyond R1. 

Note: Default route should only be used on edge routers (border router), aka gateway router (connected to ISP).

 

Regards, ML
**Please Rate All Helpful Responses **

 

View solution in original post

4 Replies 4

Hello,

 

in the static routes, you need to specify the remote, not directly connected network(s), with the next hop being the neighboring interface:

 

R1(config)#ip route 192.168.1.96 255.255.255.240 192.168.2.2




R2(config)#ip route 192.168.1.0 255.255.255.192 192.168.2.1
R2(config)#ip route 192.168.1.64 255.255.255.224 192.168.2.1

Martin L
VIP
VIP

 

each router knows about its directly connected networks and must have link to other router (share subnet) to exchange info.

each router would need to have static route to reach the network that he does not own (not directly connected) either via next hop IP or his exit interface.  So, Router0 needs to know about all networks on R1, except the one that they share, and vice versa.  R0 would need to know how (which way) to reach other networks beyond R1. 

Note: Default route should only be used on edge routers (border router), aka gateway router (connected to ISP).

 

Regards, ML
**Please Rate All Helpful Responses **

 

So, if the interface g0/0/1 on Router0 were to not have an IP address, neither IPv4 nor IPv6, would I use Router0's interface, g0/0/1, as part of the static route command to Router1's non-direct-network-interface's IP address? In my case, in the pkt file I uploaded, Router1's non-direct-network-interface, g0/0/1, has an ip address of 192.168.1.97. Router0's interface, g0/0/1, also has an IP address, but I'm thinking of removing it and using Router0's interface itself, instead of an IP address, as part of the static route command. Can I do that?

 

I uploaded the pkt file below if you need to see it for yourself.

 

 

you can add static route with exit interface but if it is down or goes down, that static route is removed from routing table (RIB). 

Interface must have IP address to be UP/UP state to be use in static route. 

You cannot use my interface Y for your router's exit interface X in static route (aka non-direct-network-interface).  Similarly you cannot use your IP as next-hop IP in your static route; u must use next-hop IP. 

You can use non-direct-network-interface's IP address but it is mostly not recommended due to router must do extra lookup steps called "recursive lookup". i.e.  Router 1 has network A, you can say R0 can reach that A via B, then reach B via C and finally C is connected to R0's interface x (or via next-hop IP). So, you would have series of static routes to reach A.

see CLN post about it https://learningnetwork.cisco.com/s/question/0D56e0000B4uzC4CQI/routing-concept-part6

and https://learningnetwork.cisco.com/s/question/0D56e0000B4sNonCQE/routing-concept-part4

 

Regards, ML
**Please Rate All Helpful Responses **