Skip to content

Graceful Shutdown

BGP-Graceful-Shutdown is a mechanism defined in RFC6198 to inform your BGP neighbor that you want to close the session. The peer will then stop sending you new routes and you can safely close the session. The purpose of this community is to reduce the amount of traffic lost when BGP peering sessions are about to be shut down deliberately, e.g. for planned maintenance.

function honor_graceful_shutdown()
{
  if (65535, 0) ~ bgp_community then {
    bgp_local_pref = 0;
  }
}

protocol bgp neighbor_name {
  ipv4 {
    import filter {
      honor_graceful_shutdown();
      # other filters
      accept;
    };
  }
  ipv6 {
    import filter {
      honor_graceful_shutdown();
      # other filters
      accept;
    };
  }
}
router bgp 64500
  bgp graceful-shutdown

VyOS has two modes (operational and configuration mode). Enter configuration mode with configure to make changes. Use commit to apply them and save to keep them after reboot.

set protocols bgp parameters graceful-shutdown