Static Routes Question
mattipler
Member Posts: 175
in CCNA & CCENT
If I want to set a static route to network. Is there any difference in setting the static route to exit out of the router interface in the direction of the network say
ip route 10.10.10.0 255.255.255.0 fa0/0
to putting the next hop router in the direction of the network ie.
ip route 10.10.10.0 255.255.255.0 192.168.10.10
Would either route be considered better or more reliable? There just the same aren't they?
I hope that makes sense.
Cheers to anyone who replies.
ip route 10.10.10.0 255.255.255.0 fa0/0
to putting the next hop router in the direction of the network ie.
ip route 10.10.10.0 255.255.255.0 192.168.10.10
Would either route be considered better or more reliable? There just the same aren't they?
I hope that makes sense.
Cheers to anyone who replies.
Matt of England
Comments
-
dtlokee Member Posts: 2,378 ■■■■□□□□□□mattipler wrote:If I want to set a static route to network. Is there any difference in setting the static route to exit out of the router interface in the direction of the network say
ip route 10.10.10.0 255.255.255.0 fa0/0
to putting the next hop router in the direction of the network ie.
ip route 10.10.10.0 255.255.255.0 192.168.10.10
Would either route be considered better or more reliable? There just the same aren't they?
I hope that makes sense.
Cheers to anyone who replies.
Be careful using an exit interface that is a multi-access network, it's not reliable because finding the next hop may depend on proxy arp. Imagine an Ethernet network with 5 routers all leading to different remote subnets, how would the router sending the frame know what mac addresses to put on the frame to forward it to the correct next hop router?
Now, the case of a point to point interface (serial, p2p subinterfaces on frame, ISDN, atm, ect) you can use an exit interface and it works fine. The other thing is when you use an exit interface in a static route, it shows as directly connected with an administrative distance, and will be advertised by a routing protocol if it happens to fall in a network statement (go figure)The only easy day was yesterday! -
mattipler Member Posts: 175Agghhhh right so if you use fa0/0 it's set as directly connected admin of 0 but if you use the next hop it's got an admin of 1!!!! I see!!!!!Matt of England
-
dtlokee Member Posts: 2,378 ■■■■□□□□□□Here's an example:
!============= R1 ============ interface Loopback0 ip address 192.168.100.1 255.255.255.0 ! interface FastEthernet0/0 ip address 192.168.1.1 255.255.255.0 ! ip route 192.168.200.0 255.255.255.0 Loopback0 ! router rip version 2 network 192.168.1.0 ! R1#sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set S 192.168.200.0/24 is directly connected, Loopback0 <------ shown as directly connected C 192.168.1.0/24 is directly connected, FastEthernet0/0 C 192.168.100.0/24 is directly connected, Loopback0 !============== R2 =========== interface FastEthernet0/0 ip address 192.168.1.2 255.255.255.0 ! router rip version 2 network 192.168.1.0 R2#sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.1.0/24 is directly connected, FastEthernet0/0
Now let's add a network statement to R1 ans see the routing table of R2!====================== R1 =============== R1(config)#router rip R1(config-router)#network 192.168.200.0 !=========== R2 ============== R2# sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set R 192.168.200.0/24 [120/1] via 192.168.1.1, 00:00:09, FastEthernet0/0 C 192.168.1.0/24 is directly connected, FastEthernet0/0 R2#
The interesting part is that R1's network statement orginated a route using the static route becasue it was directly connected.
Now on to the other issue, don't use a multi access network as an exit interface (eg a FastEthernet interface) I have added a static route using Fa0/0 as the exit interface.R1(config-router)#ip route 0.0.0.0 0.0.0.0 fa0/0 R1(config)# R1(config)# R1(config)#do sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is 0.0.0.0 to network 0.0.0.0 S 192.168.200.0/24 is directly connected, Loopback0 C 192.168.1.0/24 is directly connected, FastEthernet0/0 C 192.168.100.0/24 is directly connected, Loopback0 S* 0.0.0.0/0 is directly connected, FastEthernet0/0 R1(config)#end R1#debug ip packet detail IP packet debugging is on (detailed) R1#ping 200.200.200.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.200.200.1, timeout is 2 seconds: *Mar 13 06:25:16.779: IP: tableid=0, s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), routed via RIB *Mar 13 06:25:16.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, sending *Mar 13 06:25:16.779: ICMP type=8, code=0 *Mar 13 06:25:16.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, encapsulation failed *Mar 13 06:25:16.779: ICMP type=8, code=0. *Mar 13 06:25:18.779: IP: tableid=0, s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), routed via RIB *Mar 13 06:25:18.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, sending *Mar 13 06:25:18.779: ICMP type=8, code=0 *Mar 13 06:25:18.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, encapsulation failed *Mar 13 06:25:18.783: ICMP type=8, code=0. *Mar 13 06:25:20.779: IP: tableid=0, s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), routed via RIB *Mar 13 06:25:20.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, sending *Mar 13 06:25:20.779: ICMP type=8, code=0 *Mar 13 06:25:20.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, encapsulation failed *Mar 13 06:25:20.779: ICMP type=8, code=0. **Mar 13 06:25:22.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, sending *Mar 13 06:25:22.779: ICMP type=8, code=0 *Mar 13 06:25:22.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, encapsulation failed *Mar 13 06:25:22.779: ICMP type=8, code=0. *Mar 13 06:25:24.779: IP: tableid=0, s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), routed via RIB *Mar 13 06:25:24.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, sending *Mar 13 06:25:24.779: ICMP type=8, code=0 *Mar 13 06:25:24.779: IP: s=192.168.1.1 (local), d=200.200.200.1 (FastEthernet0/0), len 100, encapsulation failed *Mar 13 06:25:24.779: ICMP type=8, code=0. Success rate is 0 percent (0/5) R1#
Notice the "encapsulation failed" this occured because there is no way to determine the next hop MAC address to place on the frame, therefore the frame was dropped.The only easy day was yesterday! -
r_durant Member Posts: 486 ■■■□□□□□□□Oh man, this was sweet...good question and great explanation!!
Almost brought tears to my eyes...CCNA (Expired...), MCSE, CWNA, BSc Computer Science
Working on renewing CCNA! -
gojericho0 Member Posts: 1,059 ■■■□□□□□□□Hello,
I was looking over this post and viewing dtlokee's examples of how using the exit interface can cause problems with multiple access networks and route advertisements. Is there any good reason to use an exit interface or is it always best practice to add the next hop router interface in case of situations like this?
Thanks -
datchcha Member Posts: 265mattipler wrote:If I want to set a static route to network. Is there any difference in setting the static route to exit out of the router interface in the direction of the network say
ip route 10.10.10.0 255.255.255.0 fa0/0
to putting the next hop router in the direction of the network ie.
ip route 10.10.10.0 255.255.255.0 192.168.10.10
Would either route be considered better or more reliable? There just the same aren't they?
I hope that makes sense.
Cheers to anyone who replies.
if you use the exit inteface it will set the AD to 0, while using the "192.168.10.10" will set the AD to 1.
Sorry was late on the question...saw taht it was already answered...my bad.
Cheers!!!Arrakis