OcNOS-SP : Segment Routing Guide : Path Computation Element Communication Protocol Configuration Guide : BGP Link State with OSPF Segment Routing : Topology
Topology
Here we have taken 7 nodes out of which 6 nodes are OSPF-SR enabled routers and node 7 will act as controller. R3 belong to autonomous-system-100 and R5 belong to autonomous-system-200. R1's xe3 and R3's xe3 belong to Area-1. R2, R4 and R3 belong to Area-0 . R5 and R6 belong to Area-0 . We shall configure OSPF-SR on every node. We shall give distribute-BGP-LS on R3 and R5, after that we will make an E- BGP session between R3 and Controller and R5 and controller. Under link-state link-state address family we will activate the neighbors. Verification will be done on ASBRS which are R3 and R5.
All NLRIs (Node, Link and Prefix) should display proper SR information of nodes belong to other AS.
Figure 3-5: BGP link state with OSPF segment routing
R1
 
R1#configure terminal
Entering to config mode
R1(config)# hostname R1
Configure hostname
R1(config)#interface lo
Going to interface mode for loopback interface.
R1(config-if)#ip address 1.1.1.1/32 secondary
Configure IPv4 address.
R1(config-if)#prefix-sid absolute 18001
Configure Prefix-sid absolute
R1(config-if)#exit
Exit from interface mode.
R1(config)#interface xe3
Going to interface mode for xe3 interface.
R1(config-if)#ip address 10.1.1.1/24
Configure IPv4 address.
R1(config-if)# label-switching
Configure Label-Switching.
R1(config-if)#exit
Exit from interface mode.
R1(config)# router ospf 100
Entering router ospf.
R1(config-router)# ospf router-id 1.1.1.1
Configure OSPF router-id.
R1(config-router)# network 1.1.1.1/32 area 0.0.0.1
Configure network.
R1(config-router)# network 10.1.1.0/24 area 0.0.0.1
Configure network.
R1(config-router)# segment-routing mpls
Configure segment-routing MPLS.
R1(config-router)#exit
Exit from router-ospf mode.
R2
 
R2#configure terminal
Entering to config mode
R2(config)# hostname R2
Configure hostname
R2(config)#interface lo
Going to interface mode for loopback interface.
R2(config-if)#ip address 2.2.2.2/32 secondary
Configure IPv4 address.
R2(config-if)#prefix-sid absolute 18002
Configure Prefix-sid
R2(config-if)#exit
Exit from interface mode.
R2(config)# interface xe1
Going to interface mode for xe1 interface.
R2(config-if)#ip address 11.1.1.1/24
Configure IPv4 address.
R2(config-if)# label-switching
Configure Label-Switching.
R2(config-if)#exit
Exit from interface mode.
R2(config)#router ospf 100
Entering router ospf.
R2(config-router)# ospf router-id 2.2.2.2
Configure OSPF Router-id.
R2(config-router)# network 2.2.2.2/32 area 0.0.0.0
Configure Network.
R2(config-router)# network 11.1.1.0/24 area 0.0.0.0
Configure Network.
R2(config-router)# segment-routing mpls
Configure segment-routing MPLS.
R2(config-router)#exit
Exit from router-ospf mode.
R3
 
R3#configure terminal
Entering to config mode
R3(config)# hostname R3
Configure hostname
R3(config)#interface lo
Going to interface mode for loopback interface.
R3(config-if)#ip address 3.3.3.3/32 secondary
Configure IPv4 address.
R1(config-if)#prefix-sid absolute 18003
Configure Prefix-sid
R3(config-if)#exit
Exit from interface mode.
R3(config)#interface xe3
Going to interface mode for xe3 interface.
R3(config-if)#ip address 10.1.1.2/24
Configure IPv4 address.
R3(config-if)# label-switching
Configure Label-Switching.
R3(config-if)#exit
Exit from interface mode.
R3(config)#interface xe1
Going to interface mode for xe1 interface.
R3(config-if)#ip address 11.1.1.2/24
Configure IPv4 address.
R3(config-if)# label-switching
Configure Label-Switching.
R3(config-if)#exit
Exit from interface mode.
R3(config)#interface xe8
Going to interface mode for xe8 interface.
R3(config-if)#ip address 12.1.1.2/24
Configure IPv4 address.
R3(config-if)# label-switching
Configure Label-Switching
R3(config-if)#exit
Exit from interface mode.
R3(config)#interface xe4
Going to interface mode for xe4 interface.
R3(config-if)#ip address 13.1.1.1/24
Configure IPv4 address.
R3(config-if)#exit
Exit from interface mode.
R3(config)# router ospf 100
Entering router ospf.
R3(config-router)# ospf router-id 3.3.3.3
Configure OSPF Router-ID.
R3(config-router)# distribute bgp-ls
Configure Distribute BGP-LS.
R3(config-router)# network 3.3.3.3/32 area 0.0.0.0
Configure Network.
R3(config-router)# network 10.1.1.0/24 area 0.0.0.1
Configure Network.
R3(config-router)# network 11.1.1.0/24 area 0.0.0.0
Configure Network.
R3(config-router)# network 12.1.1.0/24 area 0.0.0.0
Configure Network
R3(config-router)# segment-routing mpls
Configure segment-routing MPLS.
R3(config-router)#exit
Exit from router-ospf mode.
R3(config)#router bgp 100
Entering router bgp.
R3(config)# bgp router-id 3.3.3.3
Configure BGP router-id
R3(config-router)# neighbor 13.1.1.2 remote-as 300
Configure E-BGP neighbor with remote-as.
R3(config-router)# address-family link-state link-state
Configure link-state link-state address-family.
R3(config-router-af)# neighbor 13.1.1.2 activate
Activating controller's interface address as neighbor in link-state link-state address family.
R3(config-router-af)#exit
Exit from router bgp-address-family mode
R3(config-router)#exit
Exit from router bgp mode
R4
 
R4#configure terminal
Entering to config mode
R4(config)# hostname R4
Configure hostname
R4(config)#interface lo
Going to interface mode for loopback interface.
R4(config-if)#ip address 4.4.4.4/32 secondary
Configure IPv4 address.
R4(config-if)#prefix-sid absolute 18004
Configure Prefix-sid
R4(config-if)#exit
Exit from interface mode.
R4(config)#interface xe8
Going to interface mode for xe8 interface.
R4(config-if)#ip address 12.1.1.1/24
Configure IPv4 address.
R4(config-if)# label-switching
Configure Label-Switching.
R4(config-if)#exit
Exit from interface mode.
R4(config)#router ospf 100
Entering router ospf.
R4(config-router)# ospf router-id 4.4.4.4
Configure OSPF Router-ID.
R4(config-router)# network 4.4.4.4/32 area 0.0.0.0
Configure network.
R4(config-router)# network 12.1.1.0/24 area 0.0.0.0
Configure network.
R4(config-router)#segment-routing mpls
Enabling Segment-Routing.
R4(config-router)#exit
Exit from router-ospf mode.
R5
 
R5#configure terminal
Entering to config mode
R5(config)# hostname R5
Configure hostname
R5(config)#interface lo
Going to interface mode for loopback interface.
R5(config-if)#ip address 5.5.5.5/32 secondary
Configure IPv4 address.
R4(config-if)#prefix-sid absolute 18005
Configure Prefix-sid
R5(config-if)#exit
Exit from interface mode.
R5(config)#interface xe17
Going to interface mode for xe17 interface.
R5(config-if)#ip address 15.1.1.1/24
Configure IPv4 address.
R5(config-if)# label-switching
Configure Label-Switching.
R5(config-if)#exit
Exit from interface mode.
R5(config)#interface xe8
Going to interface mode for xe8 interface.
R5(config-if)#ip address 14.1.1.1/24
Configure IPv4 address.
R5(config-if)#exit
Exit from interface mode.
R5(config)# router ospf 100
Entering router OSPF.
R5(config-router)# ospf router-id 5.5.5.5
Configure OSPF router-id.
R5(config-router)# distribute bgp-ls
Distributing BGP-LS.
R5(config-router)# network 5.5.5.5/32 area 0.0.0.0
Configure network.
R5(config-router)# network 15.1.1.0/24 area 0.0.0.0
Configure network.
R5(config-router)# segment-routing mpls
Enabling Segment-Routing.
R5(config-router)#exit
Exit from router-ospf mode.
R5(config)#router bgp 200
Entering router bgp.
R5(config)# bgp router-id 5.5.5.5
Configure BGP router-id
R5(config-router)# neighbor 14.1.1.2 remote-as 300
Configure E-BGP neighbor with remote-as.
R5(config-router)#address-family link-state link-state
Entering link-state link-state address family.
R5(config-router-af)# neighbor 14.1.1.2 activate
Activating controller's interface address as neighbor in link-state link-state address family.
R5(config-router-af)#exit
Exit from router bgp-address-family mode.
R5(config-router)#exit
Exit from router bgp mode.
R6
 
R6#configure terminal
Entering to config mode
R6(config)# hostname R6
Configure hostname
R6(config)#interface lo
Going to interface mode for loopback interface.
R6(config-if)#ip address 6.6.6.6/32 secondary
Configure IPv4 address.
R6(config-if)#prefix-sid absolute 18006
Configure Prefix-sid
R6(config-if)#exit
Exit from interface mode.
R6(config)#interface xe17
Going to interface mode for xe17 interface.
R6(config-if)#ip address 15.1.1.2/24
Configure IPv4 address.
R6(config-if)# label-switching
Configure Label-Switching.
R6(config-if)#exit
Exit from interface mode.
R6(config)# router ospf 100
Entering router OSPF.
R6(config-router)# ospf router-id 6.6.6.6
Configure OSPF Router-id.
R6(config-router)# network 6.6.6.6/32 area 0.0.0.0
Configure network.
R6(config-router)# network 15.1.1.0/24 area 0.0.0.0
Configure network.
R6(config-router)#segment-routing mpls
Enabling Segment-Routing.
R6(config-router)#exit
Exit from router-ospf mode.
Controller (R7)
 
Controller#configure terminal
Entering to config mode
Controller(config)# hostname Controller
Configure hostname
Controller(config)#in eth1
Entering to interface eth1.
Controller(config-if)#ip address 13.1.1.2/24
Configure IPv4 address.
Controller(config-if)#in eth2
Entering to interface eth2.
Controller(config-if)#ip address 14.1.1.2/24
Configure IPv4 address.
Controller(config-if)#exit
Exit from interface mode.
Controller(config-if)#router bgp 300
Entering to router bgp mode.
Controller(config-router)# neighbor 13.1.1.1 remote-as 100
Configure neighbor with remote-as.
Controller(config-router)# neighbor 14.1.1.1 remote-as 200
Configure neighbor with remote-as.
Controller(config-router)#address-family link-state link-state
Entering link-state link-state address family.
Controller(config-router-af)# neighbor 13.1.1.1 activate
Activating R3's interface address as neighbor in link-state link-state address family.
Controller(config-router-af)# neighbor 14.1.1.1 activate
Activating R5's interface address as neighbor in link-state link-state address family.
Controller(config-router-af)#exit
Exit from bgp address-family mode
Controller(config-router)#exit
Exit from router bgp mode.
Last modified date: 10/20/2023