cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
696
Views
0
Helpful
3
Replies

default route with " int " option

sarahr202
Level 5
Level 5

Hi everybody

I just encountered a command while doing a cisco tshoot demo on cisco website.     

           

ip route 0.0.0.0 0.0.0.0 f0/0 199.199.199.2

What is the logic  for using " f0/0" above?i

The static route now depends upon the status of f0/0. If f0/0 is up and up status, the static route will stay in routing table. If the f0/0 goes down, the static route will also be removed from the routing table.

Is that the reason we might want to use f0/0 above ?

thanks.

2 Accepted Solutions

Accepted Solutions

Raju Sekharan
Cisco Employee
Cisco Employee

Hi

Specifying a numerical next hop on a directly connected interface       prevents the router from performing ARP or each destination address. However,       if the interface with the next hop goes down and the numerical next hop is       reachable through a recursive route, you should specify both the next hop IP       address and the interface through which the next hop should be found.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800ef7b2.shtml#topic1

Thanks

Raju

View solution in original post

Rolf Fischer
Level 9
Level 9

In addition to Raju's answer, I'd like to show you an example. If you want, you can easily test it with gns3 or a real lab.

"debug ip routing" gives you an interesting output.

Let's say 199.199.199.2 is your ISP and 199.199.199.0/24 is the IP-range of the whole site.

For the site's range you have configured a null-route:

C       199.199.199.0/30 is directly connected, FastEthernet0/0
S       199.199.199.0/24 is directly connected, Null0
S*   0.0.0.0/0 [1/0] via 199.199.199.2

Without the interface-option something probably undesired happens when you shutdown Fa0/0:

R1(config-if)# shutdown

R1(config-if)#do show ip route
Gateway of last resort is 199.199.199.2 to network 0.0.0.0

S    199.199.199.0/24 is directly connected, Null0
S*   0.0.0.0/0 [1/0] via 199.199.199.2

The default-route is still in the routing table! That's because the recursive nature of static routes:

R1(config-if)#do show ip route 199.199.199.2
Routing entry for 199.199.199.0/24
Known via "static", distance 1, metric 0 (connected)
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 0, traffic share count is 1

The /24-route is less specific but it matches as well for 199.199.199.2.

Of course, 199.199.199.2 is not reachable via Null0:

R1(config-if)#do ping 199.199.199.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 199.199.199.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

Let's change the route (Fa0/0 is re-enabled).

R1(config)#do show run | i ^ip route
ip route 0.0.0.0 0.0.0.0 199.199.199.2
ip route 199.199.199.0 255.255.255.0 Null0


R1(config)#no ip route 0.0.0.0 0.0.0.0 199.199.199.2
R1(config)#ip route 0.0.0.0 0.0.0.0 Fa0/0 199.199.199.2

R1(config)#int f0/0
R1(config-if)#shutdown
R1(config-if)#do show ip route

Gateway of last resort is not set

S    199.199.199.0/24 is directly connected, Null0

See the difference?

HTH

Rolf

View solution in original post

3 Replies 3

Raju Sekharan
Cisco Employee
Cisco Employee

Hi

Specifying a numerical next hop on a directly connected interface       prevents the router from performing ARP or each destination address. However,       if the interface with the next hop goes down and the numerical next hop is       reachable through a recursive route, you should specify both the next hop IP       address and the interface through which the next hop should be found.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800ef7b2.shtml#topic1

Thanks

Raju

Rolf Fischer
Level 9
Level 9

In addition to Raju's answer, I'd like to show you an example. If you want, you can easily test it with gns3 or a real lab.

"debug ip routing" gives you an interesting output.

Let's say 199.199.199.2 is your ISP and 199.199.199.0/24 is the IP-range of the whole site.

For the site's range you have configured a null-route:

C       199.199.199.0/30 is directly connected, FastEthernet0/0
S       199.199.199.0/24 is directly connected, Null0
S*   0.0.0.0/0 [1/0] via 199.199.199.2

Without the interface-option something probably undesired happens when you shutdown Fa0/0:

R1(config-if)# shutdown

R1(config-if)#do show ip route
Gateway of last resort is 199.199.199.2 to network 0.0.0.0

S    199.199.199.0/24 is directly connected, Null0
S*   0.0.0.0/0 [1/0] via 199.199.199.2

The default-route is still in the routing table! That's because the recursive nature of static routes:

R1(config-if)#do show ip route 199.199.199.2
Routing entry for 199.199.199.0/24
Known via "static", distance 1, metric 0 (connected)
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 0, traffic share count is 1

The /24-route is less specific but it matches as well for 199.199.199.2.

Of course, 199.199.199.2 is not reachable via Null0:

R1(config-if)#do ping 199.199.199.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 199.199.199.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

Let's change the route (Fa0/0 is re-enabled).

R1(config)#do show run | i ^ip route
ip route 0.0.0.0 0.0.0.0 199.199.199.2
ip route 199.199.199.0 255.255.255.0 Null0


R1(config)#no ip route 0.0.0.0 0.0.0.0 199.199.199.2
R1(config)#ip route 0.0.0.0 0.0.0.0 Fa0/0 199.199.199.2

R1(config)#int f0/0
R1(config-if)#shutdown
R1(config-if)#do show ip route

Gateway of last resort is not set

S    199.199.199.0/24 is directly connected, Null0

See the difference?

HTH

Rolf

fb_webuser
Level 6
Level 6

when we use int then we not use next hop...........

---

Posted by WebUser Raj Verma from Cisco Support Community App

Review Cisco Networking for a $25 gift card