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

BGP with keep-alive

Hi,

i am currently learning for BGP,

i tried a small lab in GNS3 to test keep-alive with TCP connection between two peers BGP

I used 7200 platform with  "c7200-adventerprisek9-mz.152-4.S7.image"

 

R1---------f0/0--R2--f0/1-----------R3

 

A peer BGP relation is established between R1 l0 (1.1.1.1) and R3 l0 (3.3.3.3) in the same AS

I used static routes to have IP connectivity between 1.1.1.1 and 3.3.3.3

The TCP transaction is established between a port client on R1 and port 179 on R3

On R3, i set service tcp-keepalives-in and service tcp-keepalives-out

Then, I shut f0/0 on R2

 

I hoped to see keepalive in action in R3

So i look up the output of

- show tcp brief

- show tcp tcb [ID]

- debug ip tcp transactions

 

But...

nothing happens with keepalive

BGP itself ends the TCP connection: i don't see anything related to keepalive

Please, can you give me an explanation why keepalive did nothing behind the scene ?

 

Regards

1 Accepted Solution

Accepted Solutions

Hi,

 tcp-keepalives-in (out) is used for telnet sessions. It has no effect on BGP sessions. BGP keepalive are controlled under "router BGP"

https://www.cisco.com/c/en/us/support/docs/dial-access/asynchronous-connections/14957-tcpkeepalive.html

 

Thanks

John

**Please rate posts you find helpful**

View solution in original post

3 Replies 3

johnd2310
Level 8
Level 8

Hi,

The commands "service tcp-keepalives-in and service tcp-keepalives-out" are used for connections to the swicth or router. They are used to kill stale connections. If you telnet/ssh to a router/switch and disconnect without logging out, the switch/router will still maintain connection settings. This is resource wasteful and can eventually lead to resource starvation on the affected device. The "service tcp-keepalives-in" command helps to kill all stall connections to the device. "service tcp-keepalives-out" works the same for connections from the device.

You configure keepalives under the under the  bgp confgiuration

router bgp xxxx

  timers bgp 3 15

 

You can see the keepalives sent/received using the "show ip bgp neighbors" command.

You can use the "debug ip bgp keepalives" if you would like to debug keepalives.

 

Thanks

John

**Please rate posts you find helpful**

hi John,

thank you very much and I accept your reply

But could you be a little more explicit ?

So,  does tcp-keepalives-in (out) work only for telnet (and ssh i suppose) ?

Why connection TCP 179 on R3 might not be a stale connection when you shut f0/0 on R2 ?

 

Regards

Hi,

 tcp-keepalives-in (out) is used for telnet sessions. It has no effect on BGP sessions. BGP keepalive are controlled under "router BGP"

https://www.cisco.com/c/en/us/support/docs/dial-access/asynchronous-connections/14957-tcpkeepalive.html

 

Thanks

John

**Please rate posts you find helpful**
Review Cisco Networking for a $25 gift card