Select Page

holdtime | keepalivE

BGP | HoldTime & Keepalive

  • Default: HoldTime=90sec  KeepAlive=30Sec

When the BGP session between two routers is established, the two routers exchange prefixes and then start sending traffic for those prefixes to the neighboring router.
But all good things must come to an end, including BGP sessions. When that happens, the router removes all prefixes received over the terminated session, and reroutes traffic over other paths, if those are available. It’s always possible to manually bring down a BGP session:

Juniper vMX 14 & EVE-NG Pro is used for this lab.

 Devices Configuration: 

[email protected]> show configuration |display set 
set version 14.1R4.8
set system host-name R1
set system root-authentication encrypted-password "$1$tO/JJjsr$6UERRBvamum8jyb8WbD5p1"
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/1 unit 0 family inet address 12.12.12.1/24
set interfaces lo0 unit 1 family inet address 1.1.1.1/24
set routing-options autonomous-system 100
set protocols bgp group eBGP type external
set protocols bgp group eBGP hold-time 30
set protocols bgp group eBGP export R1-loop
set protocols bgp group eBGP peer-as 200
set protocols bgp group eBGP neighbor 12.12.12.2
set policy-options policy-statement R1-loop term t1 from interface lo0.1
set policy-options policy-statement R1-loop term t1 then accept
[email protected]> show configuration |display set 
set version 14.1R4.8
set system host-name R2
set system root-authentication encrypted-password "$1$gQQMnrjZ$0y8.izSPbRBPDQ37sp0t70"
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 disable
set interfaces ge-0/0/1 unit 0 family inet address 12.12.12.2/24
set interfaces lo0 unit 2 family inet address 2.2.2.2/24
set routing-options autonomous-system 200
set protocols bgp group eBGP type external
set protocols bgp group eBGP export R2-loop
set protocols bgp group eBGP peer-as 100
set protocols bgp group eBGP neighbor 12.12.12.1
set policy-options policy-statement R2-loop from interface lo0.2
set policy-options policy-statement R2-loop then accept
— Configuration | Verification —

— iBGP & eBGP Peering:

R1>
set routing-options autonomous-system 100
set protocols bgp group eBGP type external
set protocols bgp group eBGP export R1-loop
set protocols bgp group eBGP peer-as 200
set protocols bgp group eBGP neighbor 12.12.12.2
set policy-options policy-statement R1-loop term t1 from interface lo0.1
set policy-options policy-statement R1-loop term t1 then accept

R2>
set routing-options autonomous-system 200
set protocols bgp group eBGP type external
set protocols bgp group eBGP export R2-loop
set protocols bgp group eBGP peer-as 100
set protocols bgp group eBGP neighbor 12.12.12.1
set policy-options policy-statement R2-loop from interface lo0.2
set policy-options policy-statement R2-loop then accept
[email protected]> show bgp summary 
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       1          1          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
12.12.12.2              200         84         86       0       0       36:43 1/1/1/0              0/0/0/0

[email protected]> show bgp summary Groups: 1 Peers: 1 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 1 1 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 12.12.12.1 100 86 85 0 0 36:55 1/1/1/0 0/0/0/0
[email protected]> show bgp neighbor Peer: 12.12.12.2+51603 AS 200 Local: 12.12.12.1+179 AS 100 Type: External State: Established Flags: Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: Cease Export: [ R1-loop ] Options: Holdtime: 90 Preference: 170 Number of flaps: 0 Error: 'Cease' Sent: 1 Recv: 0 Peer ID: 2.2.2.2 Local ID: 1.1.1.1 Active Holdtime: 90 Keepalive Interval: 30 Group index: 0 Peer index: 0 BFD: disabled, down Local Interface: ge-0/0/1.0 NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 200) Peer does not support Addpath Table inet.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 1 Received prefixes: 1 Accepted prefixes: 1 Suppressed due to damping: 0 Advertised prefixes: 1 Last traffic (seconds): Received 10 Sent 24 Checked 58 Input messages: Total 93 Updates 2 Refreshes 0 Octets 1839 Output messages: Total 95 Updates 1 Refreshes 0 Octets 1896 Output Queue[0]: 0

— Change default HoldTime: 

- On R1 change holdtime, and keepalive time will be updated as well.
/** BGP peering 'll reset once timer is changed.
[email protected]# set protocols bgp group eBGP hold-time 30 
[email protected]> show bgp neighbor    
Peer: 12.12.12.2+179 AS 200    Local: 12.12.12.1+57733 AS 100  
  Type: External    State: Established    Flags: <Sync>
  Last State: OpenConfirm   Last Event: RecvKeepAlive
  Last Error: None
  Export: [ R1-loop ] 
  Options: <Preference HoldTime PeerAS Refresh>
  Holdtime: 30 Preference: 170
  Number of flaps: 0
  Peer ID: 2.2.2.2         Local ID: 1.1.1.1           Active Holdtime: 30
  Keepalive Interval: 10         Group index: 0    Peer index: 0   
  BFD: disabled, down
  Local Interface: ge-0/0/1.0                       
  NLRI for restart configured on peer: inet-unicast
  NLRI advertised by peer: inet-unicast
  NLRI for this session: inet-unicast
  Peer supports Refresh capability (2)
  Stale routes from peer are kept for: 300
  Peer does not support Restarter functionality
  NLRI that restart is negotiated for: inet-unicast
  NLRI of received end-of-rib markers: inet-unicast
  NLRI of all end-of-rib markers sent: inet-unicast
  Peer supports 4 byte AS extension (peer-as 200)
  Peer does not support Addpath
---(more)---            


/** Once timer changes on R1, BGP peering 'll reset and neighbors will form peering with new HoldTime.


[email protected]> show bgp neighbor Peer: 12.12.12.1+57733 AS 100 Local: 12.12.12.2+179 AS 200 Type: External State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ R2-loop ] Options: <Preference PeerAS Refresh> Holdtime: 90 Preference: 170 Number of flaps: 1 Last flap event: RecvNotify Error: 'Cease' Sent: 0 Recv: 1 Peer ID: 1.1.1.1 Local ID: 2.2.2.2 Active Holdtime: 30 Keepalive Interval: 10 Group index: 0 Peer index: 0


/** R2 have updated the timer value.
/** Note that, low Holdtime value may cause issue, so default timers are good !!

— Addition Theory: BGP b/w Juniper & Cisco:

>> Even default timers are different b/w Juniper & Cisco routers, the both routers 'll negotiate and 'll agree to use common value.
Share on print
Print
Share on google
Google+
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Prepaid Phones, SIM Cards, No-Contract & Pay As You Go Phones at a price you wouldn’t expect.

 

The Juniper All-Access | Reading List

Leave a reply

Your email address will not be published. Required fields are marked *

ADENTECH guides

We love to help.

Get our newsletter, join the community: