Example for Configuring Basic BGP Unnumbered
Networking Requirements
Figure 1. BGP Unnumbered Configuration Example
As shown in Figure 1, Switch A and Switch B are BGP peers. An EBGP connection is established between Switch A and Switch B. To save IP addresses, BGP unnumbered can be configured between Switch A and Switch B. In this example, routed interfaces are configured for the use of BGP unnumbered interface.
The only difference between a BGP unnumbered configuration and the BGP numbered configuration is that the BGP neighbor is specified as an interface instead of an IP address. The interface between the two peers does not need to have an IP address configured on each side.
NOTE: The ebgp-requires-policy function needs to be disabled in EBGP, no need in IBGP. |
Procedure
Switch A
Step 1 Enable te-1/1/1 as a routed interface and configure the interface name as rif-1.
admin@SwitchA# set interface gigabit-ethernet te-1/1/1 routed-interface enable true
admin@SwitchA# set interface gigabit-ethernet te-1/1/1 routed-interface name rif-1
admin@SwitchA# set vlans reserved-vlan 80-90
admin@SwitchA# set l3-interface routed-interface rif-1Step 2 Configure EBGP and disable ebgp-requires-policy policy.
admin@SwitchA# set protocols bgp local-as 65001
admin@SwitchA# set protocols bgp router-id 49.49.49.49
admin@SwitchA# set protocols bgp interface rif-1 remote-as 65002
admin@SwitchA# set protocols bgp interface rif-1 ipv6-unicast activate true
admin@SwitchA# set protocols bgp interface rif-1 capability extended-nexthop
admin@SwitchA# set protocols bgp ebgp-requires-policy falseStep 3 Enable IP routing.
admin@SwitchA# set ip routing enable trueStep 4 Advertise the host subnets through BGP.
admin@SwitchA# set protocols bgp ipv4-unicast network 49.49.49.49/32Step 5 Commit the configuration.
admin@SwitchA# commitSwitch B
Step 1 Enable ge-1/1/5 as a routed interface and configure interface name as rif-1.
admin@SwitchB# set interface gigabit-ethernet ge-1/1/5 routed-interface enable true
admin@SwitchB# set interface gigabit-ethernet ge-1/1/5 routed-interface name rif-1
admin@SwitchB# set vlans reserved-vlan 80-90
admin@SwitchB# set l3-interface routed-interface rif-1Step 2 Configure EBGP and disable ebgp-requires-policy policy.
admin@SwitchB# set protocols bgp local-as 65002
admin@SwitchB# set protocols bgp router-id 45.45.45.45
admin@SwitchB# set protocols bgp interface rif-1 remote-as 65001
admin@SwitchB# set protocols bgp interface rif-1 ipv6-unicast activate true
admin@SwitchB# set protocols bgp interface rif-1 capability extended-nexthop
admin@SwitchB# set protocols bgp ebgp-requires-policy falseStep 3 Enable IP routing.
admin@SwitchB# set ip routing enable trueStep 4 Advertise the host subnets through BGP.
admin@SwitchB# set protocols bgp ipv4-unicast network 45.45.45.45/32Step 5 Commit the configuration.
admin@SwitchB# commitVerify the Configuration
Check the BGP neighbor by running the following command.
admin@SwitchA# run show bgp neighbor
BGP neighbor on rif-1: fe80::1a5a:5810:83c:42a1, remote AS 65002, local AS 65001, external link
Hostname: SwitchB
BGP version 4, remote router ID 45.45.45.45, local router ID 49.49.49.49
BGP state = Established, up for 00:03:38
Last read 00:00:38, Last write 00:00:38
Hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
4 Byte AS: advertised and received
Extended Message: 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)
Enhanced Route Refresh: advertised and received
Address Family IPv4 Unicast: advertised and received
Address Family IPv6 Unicast: advertised and received
Hostname Capability: advertised (name: 49sw,domain name: n/a) received (name: 45sw,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: No
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: 3 2
Notifications: 0 2
Updates: 9 9
Keepalives: 5 5
Route Refresh: 0 0
Capability: 0 0
Total: 17 18
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
Update group 5, subgroup 5
Packet Queue length 0
Community attribute sent to this neighbor(all)
1 accepted prefixes
For address family: IPv6 Unicast
Update group 6, subgroup 6
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 1; dropped 0
Last reset 00:03:41, No AFI/SAFI activated for peer
Local host: fe80::1a5a:5820:61f:63a1, Local port: 179
Foreign host: fe80::1a5a:5810:83c:42a1, Foreign port: 57988
Nexthop local: fe80::1a5a:5820:61f:63a1
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Estimated round trip time: 2 ms
Read thread: on Write thread: on FD used: 25After completing the configuration, check BGP route on the switches.
admin@SwitchA# run show route bgp
RIB entry for bgp
=================
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, A - Babel, F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
B>* 45.45.45.45/32 [20/0] via fe80::1a5a:5810:83c:42a1, rif-1, weight 1, 02:03:58Show the brief information for BGP.
admin@SwitchA# run show bgp
show bgp ipv4 unicast
=====================
BGP table version is 10, local router ID is 49.49.49.49, vrf id 0
Default local pref 100, local AS 65001
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 45.45.45.45/32 rif-1 0 0 65002 i
Displayed 1 routes and 1 total paths
show bgp ipv6 unicast
=====================
No BGP prefixes displayed, 0 exist