Requirement:
This article discusses how to configure basic IPV4 BGP routing.
Solution:In the following example, switches Rack2sw1 and Rack2sw2 are configured for BGP routing.
• IP addresses are configured on the VLAN 1 and Loopback 0 interfaces.
• BGP routing is enable for the autonomous system ID 12.
• Connected interfaces are redistributed into BGP.
Configuration:
********** Configure IP interfaces **********
Rack2sw1(config)# interface loopback 0 ip address 1.1.1.1
Rack2sw1(config)# vlan 1 ip address 192.168.12.1/24
********** Configure BGP routing **********
SWITCH 1
Rack2sw1(config)# ip routing
Rack2sw1(config)# router bgp 12 neighbor 192.168.12.2 remote-as 12
Rack2sw1(config)# router bgp 12 enable
Rack2sw1(config)# router bgp 12 redistribute connected
SWITCH 2
Rack2sw2(config)# ip routing
Rack2sw2(config)# router bgp 12 neighbor 192.168.12.1 remote-as 12
Rack2sw2(config)# router bgp 12 enable
Rack2sw2(config)# router bgp 12 redistribute connected
VerificationSWITCH 1
Rack2sw1# show ip bgp summary
Peer Information
Remote Address Remote-AS Local-AS State Admin Status
--------------- --------- -------- ------------- ------------
192.168.12.2 12 12 Established Start
Rack2sw1# show ip bgp neighbor 192.168.12.2 advertised-routes
Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Nexthop Metric LocalPref Weight AsPath
------------------ --------------- ---------- ---------- ------ ---------
*>i 1.1.1.1/32 192.168.12.1 0 100 32768 ?
*>i 192.168.12.0/24 192.168.12.1 0 100 32768 ?
Rack2sw1# show ip bgp neighbor 192.168.12.2 received-routes
Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Nexthop Metric LocalPref Weight AsPath
------------------ --------------- ---------- ---------- ------ ---------
*>i 2.2.2.2/32 192.168.12.2 0 100 0 ?
i 192.168.12.0/24 192.168.12.2 0 100 0 ?
Rack2sw1# show ip route bgp
IP Route Entries
Destination Gateway VLAN Type Sub-Type Metric Dist.
------------------ --------------- ---- --------- ---------- ---------- -----
2.2.2.2/32 192.168.12.2 1 bgp internal 0 200
SWITCH 2
Rack2sw2# show ip bgp summary
Peer Information
Remote Address Remote-AS Local-AS State Admin Status
--------------- --------- -------- ------------- ------------
192.168.12.1 12 12 Established Start
Rack2sw2# show ip bgp neighbor 192.168.12.1 advertised-routes
Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Nexthop Metric LocalPref Weight AsPath
------------------ --------------- ---------- ---------- ------ ---------
*>i 2.2.2.2/32 192.168.12.2 0 100 32768 ?
*>i 192.168.12.0/24 192.168.12.2 0 100 32768 ?
Rack2sw2# show ip bgp neighbor 192.168.12.1 received-routes
Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Nexthop Metric LocalPref Weight AsPath
------------------ --------------- ---------- ---------- ------ ---------
*>i 1.1.1.1/32 192.168.12.1 0 100 0 ?
i 192.168.12.0/24 192.168.12.1 0 100 0 ?
Rack2sw2# show ip route bgp
IP Route Entries
Destination Gateway VLAN Type Sub-Type Metric Dist.
------------------ --------------- ---- --------- ---------- ---------- -----
1.1.1.1/32 192.168.12.1 1 bgp internal 0 170
CONNECTIVITY VERIFICATION
Rack2sw1# ping 2.2.2.2
2.2.2.2 is alive, time = 1 ms
Rack2sw2# ping 1.1.1.1
1.1.1.1 is alive, time = 2 ms