What is keepalive on Router interfaces and why it is there?

What is a keepalive?

Keepalive is a way of determining the state (up or down) of an interface. There is a time interval associated with the keepalive configuration, default is 10 seconds. So the router sends a keepalive packet every 10 seconds, and if it fails to see three packets in a row than it is considered down.

Therefore, if there is cable connected to the interface then router will receive reply within 10 seconds and router knows that the interface is up. Otherwise it is considered down. However, if you configure keepalive as no keepalive or keepalive 0 than router will not send any packets and it will consider always up/up.

Hence, with no keepalive command on the interface, no matter what, the interface should remain up/up?  And this technique is helpful in simulation and testing purpose.

Lets check it out!

Default interface settings of f0/0

R1#sh int f0/0

FastEthernet0/0 is administratively down, line protocol is down

Hardware is Gt96k FE, address is c200.1868.0000 (bia c200.1868.0000)

MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Encapsulation ARPA, loopback not set

Keepalive set (10 sec)

Half-duplex, 10Mb/s, 100BaseTX/FX

ARP type: ARPA, ARP Timeout 04:00:00

 

After keepalive is turned off the interface show up/up

R1(config)#int f0/0

R1(config-if)#no shut

R1(config-if)#no kee

R1(config-if)#no keepalive

R1(config-if)#end

R1#sh int f0/0

FastEthernet0/0 is up, line protocol is up

Hardware is Gt96k FE, address is c200.1868.0000 (bia c200.1868.0000)

MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Encapsulation ARPA, loopback not set

Keepalive not set

Half-duplex, 10Mb/s, 100BaseTX/FX

ARP type: ARPA, ARP Timeout 04:00:00

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s