BGP Unnumbered in SONiC

Example model & SONiC version:

  • Aurora 610
  • Netberg SONiC: SONiC.202111-nba610-support.0

A standard BGP requires the user to configure explicit BGP sessions with the neighbor IP address and remote-AS information for each BGP peer to exchange IPv4 prefixes, which can consume a significant amount of IP addresses in large networks.

Instead of specifying an IPv4 neighbor address, the user can provide the L3 port number and remote-AS number to declare an eBGP session. BGP unnumbered uses the IPv6 link-local address as the next-hop IP address for both IPv4 and IPv6 prefixes.

Limitations:

  • BGP unnumbered supports:
    • L2 interface that is not part of a Port-Channel or a VLAN.
    • Layer 3 interfaces on port, port-channel, and VLAN interfaces.

Please refer to the HLD for more details.
SONiC 202111 or later supports the “link-local-only” setting for using with BGP unnumbered.

Example:

 admin@nba610-1:~$ sudo config interface ipv6 enable use-link-local-only Ethernet69
 admin@nba610-1:~$ show ipv6 link-local-mode 
 +------------------+----------+
 | Interface Name   | Mode     |
 +==================+==========+
 | Ethernet69       | Enabled  |
 +------------------+----------+
 | Ethernet73       | Disabled |
 +------------------+----------+

BGP unnumbered configuration

BGP Unnumbered on SONiC by Netberg
Figure 1. Network topology
  1. Configure Loopback0 following the topology.
  2. Configure BGP in FRRouting

    Aurora 610-1

    admin@nba610-1:~$ vtysh
    
    Hello, this is FRRouting (version 7.5.1-sonic).
    Copyright 1996-2005 Kunihiro Ishiguro, et al.
    
    nba610-1# configure
    nba610-1(config)# router bgp 65101
    nba610-1(config-router)# bgp router-id 10.10.10.1
    nba610-1(config-router)# no bgp ebgp-requires-policy
    nba610-1(config-router)# neighbor Ethernet69 interface remote-as 65200
    nba610-1(config-router)# address-family ipv6 unicast
    nba610-1(config-router-af)# neighbor Ethernet69 activate
    nba610-1(config-router-af)# end
    nba610-1# write
    

    Aurora 610-2

    admin@nba610-2:~$ vtysh
    
    Hello, this is FRRouting (version 7.5.1-sonic).
    Copyright 1996-2005 Kunihiro Ishiguro, et al.
    
    nba610-2# configure
    nba610-2(config)# router bgp 65200
    nba610-2(config-router)# bgp router-id 10.10.10.100
    nba610-2(config-router)# no bgp ebgp-requires-policy
    nba610-2(config-router)# neighbor Ethernet68 interface remote-as 65101
    nba610-2(config-router)# address-family ipv6 unicast
    nba610-2(config-router-af)# neighbor Ethernet68 activate
    nba610-2(config-router-af)# end
    nba610-2# write
  3. Check the BGP status

Aurora 610-1

nba610-1# show bgp summary

IPv4 Unicast Summary:
BGP router identifier 10.10.10.1, local AS number 65101 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
Ethernet69      4      65200        13        20        0    0    0 00:00:07            0        0

Total number of neighbors 1

IPv6 Unicast Summary:
BGP router identifier 10.10.10.1, local AS number 65101 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
Ethernet69      4      65200        13        20        0    0    0 00:00:07            0        0

Total number of neighbors 1

nba610-1# show bgp neighbors
BGP neighbor on Ethernet69: fe80::3a68:ddff:fe52:236c, remote AS 65200, local AS 65101, external link
Hostname: sonic
  BGP version 4, remote router ID 10.10.10.100, local router ID 10.10.10.1
  BGP state = Established, up for 00:03:44
  Last read 00:00:44, Last write 00:00:44
  Hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    AddPath:
      IPv4 Unicast: RX advertised IPv4 Unicast and received
      IPv6 Unicast: RX advertised IPv6 Unicast and received
    Extended nexthop: advertised and received
      Address families by peer:
                   IPv4 Unicast
    Route refresh: advertised and received(old & new)
    Address Family IPv4 Unicast: advertised and received
    Address Family IPv6 Unicast: advertised and received
    Hostname Capability: advertised (name: sonic,domain name: n/a) received (name: sonic,domain name: n/a)
    Graceful Restart Capability: advertised and received
      Remote Restart timer is 120 seconds
      Address families by peer:
        none
  Graceful restart information:
    End-of-RIB send: IPv4 Unicast, IPv6 Unicast
    End-of-RIB received: IPv4 Unicast, IPv6 Unicast
    Local GR Mode: Helper*
    Remote GR Mode: Helper
    R bit: True
    Timers:
      Configured Restart Time(sec): 120
      Received Restart Time(sec): 120
    IPv4 Unicast:
      F bit: False
      End-of-RIB sent: Yes
      End-of-RIB sent after update: Yes
      End-of-RIB received: Yes
      Timers:
        Configured Stale Path Time(sec): 360
    IPv6 Unicast:
      F bit: False
      End-of-RIB sent: Yes
      End-of-RIB sent after update: Yes
      End-of-RIB received: Yes
      Timers:
        Configured Stale Path Time(sec): 360
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  7          6
    Notifications:          8          2
    Updates:                3          3
    Keepalives:             5          5
    Route Refresh:          0          0
    Capability:             0          0
    Total:                 23         16
  Minimum time between advertisement runs is 0 seconds

For address family: IPv4 Unicast
 Update group 7, subgroup 7
 Packet Queue length 0
 Community attribute sent to this neighbor(all)
 0 accepted prefixes

For address family: IPv6 Unicast
 Update group 8, subgroup 8
 Packet Queue length 0
 Community attribute sent to this neighbor(all)
 0 accepted prefixes

  Connections established 2; dropped 1
  Last reset 00:03:46,  No AFI/SAFI activated for peer
  Message received that caused BGP to send a NOTIFICATION:
    FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
    00640104 00C800B4 0A0A0A65 47020601
    04000100 01020805 06000100 01000202
    06010400 02000102 02800002 02020002
    06410400 0000C802 0A450800 01010100
    02010102 09490705 736F6E69 63000204
    40020078
Local host: fe80::3a68:ddff:fe52:23bc, Local port: 179
Foreign host: fe80::3a68:ddff:fe52:236c, Foreign port: 52466
Nexthop: 10.10.10.1
Nexthop global: fe80::3a68:ddff:fe52:23bc
Nexthop local: fe80::3a68:ddff:fe52:23bc
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on  Write thread: on  FD used: 28

Aurora 610-2

nba610-2# show bgp summary

IPv4 Unicast Summary:
BGP router identifier 10.10.10.100, local AS number 65200 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
Ethernet68      4      65101         7         9        0    0    0 00:00:01            0        0

Total number of neighbors 1

IPv6 Unicast Summary:
BGP router identifier 10.10.10.100, local AS number 65200 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
Ethernet68      4      65101         7         9        0    0    0 00:00:01            0        0

Total number of neighbors 1

nba610-2# show bgp neighbors
BGP neighbor on Ethernet68: fe80::3a68:ddff:fe52:23bc, remote AS 65101, local AS 65200, external link
Hostname: sonic
  BGP version 4, remote router ID 10.10.10.1, local router ID 10.10.10.100
  BGP state = Established, up for 00:06:10
  Last read 00:00:10, Last write 00:00:10
  Hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    AddPath:
      IPv4 Unicast: RX advertised IPv4 Unicast and received
      IPv6 Unicast: RX advertised IPv6 Unicast and received
    Extended nexthop: advertised and received
      Address families by peer:
                   IPv4 Unicast
    Route refresh: advertised and received(old & new)
    Address Family IPv4 Unicast: advertised and received
    Address Family IPv6 Unicast: advertised and received
    Hostname Capability: advertised (name: sonic,domain name: n/a) received (name: sonic,domain name: n/a)
    Graceful Restart Capability: advertised and received
      Remote Restart timer is 120 seconds
      Address families by peer:
        none
  Graceful restart information:
    End-of-RIB send: IPv4 Unicast, IPv6 Unicast
    End-of-RIB received: IPv4 Unicast, IPv6 Unicast
    Local GR Mode: Helper*
    Remote GR Mode: Helper
    R bit: True
    Timers:
      Configured Restart Time(sec): 120
      Received Restart Time(sec): 120
    IPv4 Unicast:
      F bit: False
      End-of-RIB sent: Yes
      End-of-RIB sent after update: Yes
      End-of-RIB received: Yes
      Timers:
       Configured Stale Path Time(sec): 360
    IPv6 Unicast:
      F bit: False
      End-of-RIB sent: Yes
      End-of-RIB sent after update: Yes
      End-of-RIB received: Yes
      Timers:
        Configured Stale Path Time(sec): 360
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  2          2
    Notifications:          2          0
    Updates:                3          3
    Keepalives:             8          8
    Route Refresh:          0          0
    Capability:             0          0
    Total:                 15         13
  Minimum time between advertisement runs is 0 seconds

For address family: IPv4 Unicast
 Update group 7, subgroup 7
 Packet Queue length 0
 Community attribute sent to this neighbor(all)
 0 accepted prefixes

For address family: IPv6 Unicast
 Update group 8, subgroup 8
 Packet Queue length 0
 Community attribute sent to this neighbor(all)
 0 accepted prefixes
  Connections established 2; dropped 1
  Last reset 00:06:12,   Notification sent (Cease/Other Configuration Change)
Local host: fe80::3a68:ddff:fe52:236c, Local port: 52466
Foreign host: fe80::3a68:ddff:fe52:23bc, Foreign port: 179
Nexthop: 10.10.10.100
Nexthop global: fe80::3a68:ddff:fe52:236c
Nexthop local: fe80::3a68:ddff:fe52:236c
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Estimated round trip time: 5 ms
Read thread: on  Write thread: on  FD used: 27
NEWS

Latest news