The network you are building
The company is AS 64500 with two border routers. R1 connects to ISP A (AS 64501) and R2 connects to ISP B (AS 64502). R1 and R2 are joined by an internal link, and both connect to the company LAN 198.51.100.0/24. All addresses and AS numbers are documentation values.
Device key: ISP A, ISP B, R1, R2 (router) · Company LAN, AS 64500 (network / site)
Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. Read the numbered steps for traffic direction and changes.
Reading the addresses
IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.
An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.
- ISP A: AS 64501
- ISP B: AS 64502
- R1: RID 1.1.1.1
- R2: RID 2.2.2.2
- Company LAN, AS 64500: Subnet 198.51.100.0/24
- 1. Provider sessions: Each company router peers with its own ISP.
- 2. Internal session: R1 and R2 exchange what each learned.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
The provider routers use their own router IDs so that no two routers in the lab share one. Both ISPs carry the same example destination, 203.0.113.0/24 on a Loopback10, because it stands for a remote network reachable through either provider. The company advertises 198.51.100.0/24 to both.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Stages 1 and 2: addresses and loopbacks
Configure the interfaces from the table first and ping every directly connected neighbour. Then run OSPF between R1 and R2 so each can reach the other's loopback. BGP is not used for this reachability; the iBGP session needs it to exist.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
interface Loopback0
ip address 10.255.0.1 255.255.255.255
interface GigabitEthernet0/1
ip address 10.0.12.1 255.255.255.252
no shutdown
router ospf 1
router-id 1.1.1.1
network 10.0.12.0 0.0.0.3 area 0
network 10.255.0.1 0.0.0.0 area 0R1 internal reachability. R2 is the mirror: 10.0.12.2/30, Loopback0 10.255.0.2/32 and router-id 2.2.2.2. Do not advertise the provider links or the company LAN into OSPF.
Check with show ip route ospf on each router and ping 10.255.0.2 source Loopback0 from R1. Do not move on until that loopback-to-loopback ping works.
Stage 3: the two provider sessions
Each router gets prefix lists so only the intended prefixes move in each direction, the same pattern as the first eBGP lesson.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
ip prefix-list COMPANY-ONLY seq 10 permit 198.51.100.0/24
ip prefix-list PROVIDER-ONLY seq 10 permit 203.0.113.0/24
router bgp 64500
bgp router-id 1.1.1.1
no bgp default ipv4-unicast
neighbor 192.0.2.1 remote-as 64501
address-family ipv4 unicast
network 198.51.100.0 mask 255.255.255.0
neighbor 192.0.2.1 activate
neighbor 192.0.2.1 prefix-list PROVIDER-ONLY in
neighbor 192.0.2.1 prefix-list COMPANY-ONLY out
exit-address-familyR1: eBGP to ISP A. On R2 use neighbor 192.0.2.5 remote-as 64502 and bgp router-id 2.2.2.2; both routers originate the company prefix.
ip prefix-list COMPANY-ONLY seq 10 permit 198.51.100.0/24
ip prefix-list PROVIDER-ONLY seq 10 permit 203.0.113.0/24
interface Loopback10
ip address 203.0.113.1 255.255.255.0
router bgp 64501
bgp router-id 11.11.11.11
no bgp default ipv4-unicast
neighbor 192.0.2.2 remote-as 64500
address-family ipv4 unicast
network 203.0.113.0 mask 255.255.255.0
neighbor 192.0.2.2 activate
neighbor 192.0.2.2 prefix-list COMPANY-ONLY in
neighbor 192.0.2.2 prefix-list PROVIDER-ONLY out
exit-address-familyISP A. ISP B is the same with AS 64502, router-id 12.12.12.12, interface address 192.0.2.5 and neighbor 192.0.2.6 remote-as 64500.
Stage 4: iBGP on loopbacks with next-hop-self
On small screens, swipe sideways or focus the diagram and use the arrow keys.
router bgp 64500
neighbor 10.255.0.2 remote-as 64500
neighbor 10.255.0.2 update-source Loopback0
address-family ipv4 unicast
neighbor 10.255.0.2 activate
neighbor 10.255.0.2 next-hop-self
exit-address-familyR1. On R2, the neighbour is 10.255.0.1. update-source makes the session use the loopback; next-hop-self makes R1 present itself as the next hop for ISP A routes.
Stage 5: verify what each router chose
R1#show ip bgp summary | begin Neighbor Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.255.0.2 4 64500 22 21 5 0 0 00:08:41 2 192.0.2.1 4 64501 27 25 5 0 0 00:11:03 1
R1#show ip bgp Network Next Hop Metric LocPrf Weight Path *> 198.51.100.0 0.0.0.0 0 32768 i * i 10.255.0.2 0 100 0 i *> 203.0.113.0 192.0.2.1 0 0 64501 i * i 10.255.0.2 0 100 0 64502 i
From the company LAN side, ping 203.0.113.1 source 198.51.100.2 on R1 should succeed through ISP A, and the same ping on R2 through ISP B. On each ISP, show ip bgp should show the company prefix.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Three faults to find
Break the lab on purpose, one fault at a time, and use the output to find the cause before you reveal the answer.
Fault 1: remove next-hop-self from R1
On R2, show ip bgp 203.0.113.0 lists the R1 path with next hop 192.0.2.1 marked inaccessible, and it is not a valid path. R2 still uses ISP B, so traffic keeps working, but the backup through R1 is gone. Restore next-hop-self and confirm the path returns with next hop 10.255.0.1.
Fault 2: the COMPANY-ONLY prefix list says 198.51.100.0/23
The session stays Established, but R1's outbound filter no longer matches the company /24, so ISP A never learns it. show ip bgp neighbors 192.0.2.1 advertised-routes on R1 is empty. Prefix lists match exactly unless you add ge or le, so the fix is the right length, not a wider list.
Fault 3: shut down R1 Gi0/1 for a minute
OSPF loses the route to R2's loopback, the iBGP session drops and R1 and R2 stop sharing paths. Each keeps its own ISP, so the company stays reachable. The session returns once the link and the OSPF route are back. A route that BGP needs to build a session cannot come from BGP itself.
Technical references: Cisco IOS XE 17.x BGP configuration guide. All output is illustrative, written for this lesson.
Check what you built
R2 shows the path learned from R1 without a valid marker and the next hop 192.0.2.1. What is missing?
Both routers have an eBGP and an iBGP path to 203.0.113.0/24 with identical attributes. Which wins on each router?
The iBGP session is down but both eBGP sessions are up. Does company traffic stop?