On R1:
router bgp 100
neighbor 10.1.13.3 remote-as 65042
network 4.2.2.2 mask 255.255.255.255
On R2:
router bgp 200
neighbor 10.1.24.4 remote-as 65042
network 4.2.2.2 mask 255.255.255.255
On R3
router ospf 1
network 10.1.35.3 0.0.0.0 are 0
network 3.3.3.3 0.0.0.0 are 0
router bgp 65042
neighbor 10.1.13.1 remote-as 100
neighbor 4.4.4.4 remote-as 65042
neighbor 4.4.4.4 update-source l0
neighbor 4.4.4.4 next-hop-self
neighbor 5.5.5.5 remote-as 65042
neighbor 5.5.5.5 update-source l0
neighbor 5.5.5.5 next-hop-self
On R5
router ospf 1
network 10.1.35.5 0.0.0.0 are 0
network 10.1.45.5 0.0.0.0 are 0
network 5.5.5.5 0.0.0.0 are 0
router bgp 65042
neighbor 3.3.3.3 remote-as 65042
neighbor 3.3.3.3 update-source l0
neighbor 4.4.4.4 remote-as 65042
neighbor 4.4.4.4 update-source l0
network 5.5.5.5 mask 255.255.255.255
On R4
router ospf 1
network 10.1.45.4 0.0.0.0 are 0
network 4.4.4.4 0.0.0.0 are 0
router bgp 65042
neighbor 10.1.24.2 remote-as 200
neighbor 3.3.3.3 remote-as 65042
neighbor 3.3.3.3 update-source l0
neighbor 3.3.3.3 next-hop-self
neighbor 5.5.5.5 remote-as 65042
neighbor 5.5.5.5 update-source l0
neighbor 5.5.5.5 next-hop-self
Verification commands:
show ip bgp summary:
This command is used to verify peer status in brief, which shows neighbor address, table version, bgp version and number of prefixes learned through BGP. Active/idle refers neighbor relationship is not formed.
show ip bgp neighbor:
This command shows bgp neighbor status in detail. You can see various attributes using this commands. Anything other than "Established" state refers that there can be issue in bgp peering.
Clear ip bgp *
(Hard clear, which enforces bgp to reset neighbor relationships)
Clear ip bgp * soft
(Generally , we use soft clear in production environment. This doesn't enforces bgp peers to be down when you are clearing bgp.)
Step:4
On R3:
route-map LOCAL_PREF
set local-preference 150
router bgp 65042
neighbor 10.1.13.1 route-map LOCAL_PREF in
Remember: you have to clear bgp session to get proper output.( soft clear :))
Step 5:
On R1/R2
Here we have various loopback interfaces which are to be redistributed into BGP. So, first of all create a route-map with deny statement which blockes the serial interface to be redistributed into BGP and rest of the network are redistributed.
route-map RED deny 10
match interface s1/0
route-map RED deny 20
match interface l0
route-map RED permit 30
router bgp 100
redistribute connected route-map RED
clear ip bgp * soft
Step 6:
On R5:
ip prefix-list BLOCK seq 5 172.0.0.0/8 le 23
route-map FILTER deny 10
match ip address prefix-list BLOCK
route-map FILTER permit 20
router bgp 65042
neighbor 3.3.3.3 route-map FILTER in
neighbor 4.4.4.4 route-map FILTER in
Important !!!!! Do not forget "clear ip bgp * soft"
Check and verify all the pering are ok and also check the bgp table with "show ip bgp and show ip route bgp" commands.
Step 7:
ping 4.2.2.2 source l0
ping 10.1.1.1 source l0
Successful!!!!!
0 comments:
Post a Comment