BGP နဲ့ပက်သက်ပြီး LAB တစ်ခုကို လုပ်ကြည့်ရအောင်။ ဒီ LAB ကို ပြီးခဲ့တဲ့ Workshop တုန်းက လုပ်ဖို့ အတွက် စီစဉ်ထားတာဖြစ်ပါတယ်။ BGP အကြောင်းအရာဖက်က ကြည့်မယ်ဆိုရင် အခြေခံ သဘောတရား လောက်သာပါမှာ ဖြစ်ပါတယ်။ ဒါပေမဲ့ BGP အတွက် လုပ်ရင်းနဲ့ တခြားသိထား လေ့လာထားတဲ့ အရာတွေဟာ ဘယ်လို အသုံးဝင်လာမလဲ ဆိုတာတွေကို ပြန်ပြီး ပေါင်းစပ်မိဖို့အတွက်ကိုလည်း ရည်ရွယ် ထားပါတယ်။
ဒီပုံမှာ အဖွဲ့အစည်း နှစ်ခုဟာ ISP ကို BGP နဲ့ ချိတ်ဆက်ထားပြီးတော့ သူတို့ရဲ့ Public IP Address တွေကို ISP ကနေ တဆင့် Advertise လုပ်ထားပါတယ်။ AS100 နဲ့ AS200 ဟာ Public IP အချင်းချင်းသာ ဆက်သွယ်လို့ ရမှာ ဖြစ်ပါတယ်။ ပေးထားတဲ့ နမူနာ အတိုင်း လိုက်လုပ်ကြည့်ရင်း တခြား စဉ်းစားစရာ တွေကို စဉ်းစားကြည့်ရင်း သိထားတာတွေကို ပြန်အသုံးချကြည့်တာပေါ့။
- EIGRP မှာ no auto-summary မပါရင် ဘယ်လိုအကျိုးသက်ရောက်မှုတွေ ဖြစ်လာနိုင်သလဲ။
- AS100/AS200 နဲ့ ကြားက Subnet ကို အတွင်းက Router တွေက သိဖို့လိုသလား။
- Static IP route ကို Null 0 သုံးထားခြင်းဟာ Routing ကိုထိခိုက်စေနိုင်လား။ ဘာကြောင့် သုံးထားသလဲ။
- အတွင်းက Router တွေကနေ Source IP မပါပဲနဲ့ ဘာကြောင့် အပြင်ထွက်လို့ မရသလဲ။ အပြင်ထွက်လို့ရဖို့အတွက် ဘာကို အသုံးပြုရမလဲ။
BGP နဲ့ ပက်သက်ပြီး တော့ စဉ်းစားစရာတွေကတော့
- ISP နဲ့ Peer လုပ်တဲ့အခါမှာ တိုက်ရိုက်ချိတ်ထားတဲ့ Interface IP အစား Loopback IP သုံးမယ်ဆိုရင် ဘယ်လိုလုပ်ရမလဲ။
- Network statement နဲ့ Advertise လုပ်လိုက်တာနဲ့ Network advertisement အတွက် လုံလောက်ပြီလား။
- BGP default weight နဲ့ Local preference Value က ဘာလဲ။ ဘယ်လို သိနိုင်မလဲ။
- AS200 မှာ Route-reflector သုံးထားတဲ့ အကျိုးကျေးဇူးက ဘာဖြစ်နိင်မလဲ။
- iBGP တွေမှာ next-hop-self ဘာကြောင့် သုံးရတာလဲ။
- Neighbour ကနေ Prefix ဘယ်နှစ်ခု လက်ခံရသလဲဆိုတာကို ဘယ်လိုသိနိုင်မလဲ။
- BGP best route ဖြစ်ကြောင်းကို ဘာကိုကြည့်ရင် သိနိုင်သလဲ။
- Prefix တစ်ခုဟာ ဘယ် AS ကနေ အစပြုလာသလဲဆိုတာ ဘယ်လိုသိနိုင်မလဲ။
ဒီမေးခွန်းတွေကို ဖြေနိုင်ပြီဆိုရင် Routing နဲ့ BGP အခြေခံကို နားလည်သဘောပေါက်ထားပြီလို့ ယူဆလို့ ရပါပြီ။
ကိုဖြိုး။
Configuring Interfaces IP address for IGP and BGP
ISP
interface FastEthernet0/0
ip address 121.121.121.1 255.255.255.252
interface FastEthernet0/1
ip address 122.122.122.1 255.255.255.252
A1
interface Loopback1
ip address 100.100.100.1 255.255.255.255
interface FastEthernet0/0
ip address 192.168.100.1 255.255.255.0
interface FastEthernet0/1
ip address 121.121.121.2 255.255.255.252
A2
interface Loopback1
ip address 100.100.100.2 255.255.255.255
interface FastEthernet0/0
ip address 192.168.100.2 255.255.255.0
B1
interface Loopback1
ip address 200.200.200.1 255.255.255.255
interface FastEthernet0/0
ip address 192.168.200.1 255.255.255.0
interface FastEthernet0/1
ip address 122.122.122.2 255.255.255.252
B2
interface Loopback1
ip address 200.200.200.2 255.255.255.255
interface FastEthernet0/0
ip address 192.168.200.2 255.255.255.0
B3
interface Loopback1
ip address 200.200.200.3 255.255.255.255
interface FastEthernet0/0
ip address 192.168.200.3 255.255.255.0
Configuring IGP in AS 100 and AS 200 and verify peers/routes
AS100 (EIGRP)
A1(config)#router eigrp 100
A1(config-router)#network 100.100.100.1 0.0.0.0
A1(config-router)#network 192.168.100.1 0.0.0.0
A1(config-router)#no auto-summary
A2(config)#router eigrp 100
A2(config-router)#network 100.100.100.2 0.0.0.0
A2(config-router)#network 192.168.100.2 0.0.0.0
A2(config-router)#no auto-summary
A1#sh ip eigrp neighbors
IP-EIGRP neighbors for process 100
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 192.168.100.2 Fa0/0 13 00:01:38 20 200 0 9
A1#sh ip route eigrp
100.0.0.0/32 is subnetted, 2 subnets
D 100.100.100.2 [90/409600] via 192.168.100.2, 00:00:15, FastEthernet0/0
A2#sh ip eigrp neighbors
IP-EIGRP neighbors for process 100
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 192.168.100.1 Fa0/0 14 00:02:00 432 2592 0 10
A2#sh ip route eigrp
100.0.0.0/32 is subnetted, 2 subnets
D 100.100.100.1 [90/409600] via 192.168.100.1, 00:00:56, FastEthernet0/0
AS200 (OSPF)
B1(config)#router ospf 1
B1(config-router)#router-id 200.200.200.1
B1(config-router)#network 200.200.200.1 0.0.0.0 are 0
B1(config-router)#network 192.168.200.1 0.0.0.0 are 0
B2(config)#router ospf 1
B2(config-router)#router-id 200.200.200.2
B2(config-router)#network 200.200.200.2 0.0.0.0 are 0
B2(config-router)#network 192.168.200.2 0.0.0.0 are 0
B3(config)#router ospf 1
B3(config-router)#router-id 200.200.200.3
B3(config-router)#network 200.200.200.3 0.0.0.0 are 0
B3(config-router)#network 192.168.200.3 0.0.0.0 are 0
B1#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
200.200.200.2 1 FULL/BDR 00:00:34 192.168.200.2 FastEthernet0/0
200.200.200.3 1 FULL/DROTHER 00:00:37 192.168.200.3 FastEthernet0/0
B1#sh ip route ospf
200.200.200.0/32 is subnetted, 3 subnets
O 200.200.200.2 [110/11] via 192.168.200.2, 00:01:46, FastEthernet0/0
O 200.200.200.3 [110/11] via 192.168.200.3, 00:01:06, FastEthernet0/0
B2#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
200.200.200.1 1 FULL/DR 00:00:38 192.168.200.1 FastEthernet0/0
200.200.200.3 1 FULL/DROTHER 00:00:30 192.168.200.3 FastEthernet0/0
B2#sh ip route ospf
200.200.200.0/32 is subnetted, 3 subnets
O 200.200.200.1 [110/11] via 192.168.200.1, 00:01:59, FastEthernet0/0
O 200.200.200.3 [110/11] via 192.168.200.3, 00:01:19, FastEthernet0/0
B3#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
200.200.200.1 1 FULL/DR 00:00:35 192.168.200.1 FastEthernet0/0
200.200.200.2 1 FULL/BDR 00:00:34 192.168.200.2 FastEthernet0/0
B3#sh ip route ospf
200.200.200.0/32 is subnetted, 3 subnets
O 200.200.200.1 [110/11] via 192.168.200.1, 00:01:51, FastEthernet0/0
O 200.200.200.2 [110/11] via 192.168.200.2, 00:01:51, FastEthernet0/0
Configuring EBGP between ISP and AS 100, AS 200
ISP(config)#int l1
ISP(config-if)#ip add 120.120.120.120 255.255.255.255
ISP(config)#router bgp 120
ISP(config-router)#bgp router-id 120.120.120.120
ISP(config-router)#neighbor 121.121.121.2 remote-as 100
ISP(config-router)#neighbor 122.122.122.2 remote-as 200
ISP(config-router)#network 120.120.120.120 mask 255.255.255.255
A1(config)#router bgp 100
A1(config-router)#bgp router-id 100.100.100.1
A1(config-router)#neighbor 121.121.121.1 remote-as 120
B1(config)#router bgp 200
B1(config-router)#bgp router-id 200.200.200.1
B1(config-router)#neighbor 122.122.122.1 remote-as 120
ISP#sh ip bgp summary | B Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
121.121.121.2 4 100 14 16 2 0 0 00:02:46 0
122.122.122.2 4 200 5 6 2 0 0 00:01:05 0
A1#sh ip bgp su | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
121.121.121.1 4 120 17 15 2 0 0 00:03:10 1
B1#sh ip bgp su | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
122.122.122.1 4 120 6 5 2 0 0 00:01:49 1
Configuring iBGP in AS 100 and AS 200
A1(config)#router bgp 100
A1(config-router)#neighbor 192.168.100.2 remote-as 100
A1(config-router)#neighbor 192.168.100.2 next-hop-self
A2(config)#router bgp 100
A2(config-router)#bgp router-id 100.100.100.2
A2(config-router)#neighbor 192.168.100.1 remote-as 100
A2(config-router)#neighbor 192.168.100.1 next-hop-self
A1#sh ip bgp summary | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
121.121.121.1 4 120 69 67 2 0 0 00:55:21 1
192.168.100.2 4 100 4 5 2 0 0 00:00:45 0
A2#sh ip bgp summary | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.100.1 4 100 5 4 2 0 0 00:00:50 1
B1(config)#router bgp 200
B1(config-router)#neighbor 192.168.200.2 remote-as 200
B1(config-router)#neighbor 192.168.200.2 next-hop-self
B1(config-router)#neighbor 192.168.200.2 route-reflector-client
B1(config-router)#
B1(config-router)#neighbor 192.168.200.3 remote-as 200
B1(config-router)#neighbor 192.168.200.3 next-hop-self
B1(config-router)#neighbor 192.168.200.3 route-reflector-client
B2(config)#router bgp 200
B2(config-router)#bgp router-id 200.200.200.2
B2(config-router)#neighbor 192.168.200.1 remote-as 200
B2(config-router)#neighbor 192.168.200.1 next-hop-self
B3(config)#router bgp 200
B3(config-router)#bgp router-id 200.200.200.3
B3(config-router)#neighbor 192.168.200.1 remote-as 200
B3(config-router)#neighbor 192.168.200.1 next-hop-self
B1#sh ip bgp su | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
122.122.122.1 4 120 62 61 2 0 0 00:57:34 1
192.168.200.2 4 200 5 6 2 0 0 00:01:29 0
192.168.200.3 4 200 4 5 2 0 0 00:00:33 0
B3#sh ip bgp summary | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.200.1 4 200 5 4 2 0 0 00:00:51 1
B2#sh ip bgp summary | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.200.1 4 200 7 6 2 0 0 00:02:04 1
Advertise Public IP range to ISP and verify routing test between AS100 and 200
A1(config)#router bgp 100
A1(config-router)#network 100.100.100.0 mask 255.255.255.0
A1(config-router)#exit
A1(config)#
A1(config)#ip route 100.100.100.0 255.255.255.0 null 0
B1(config)#router bgp 200
B1(config-router)#network 200.200.200.0 mask 255.255.255.0
B1(config-router)#exit
B1(config)#
B1(config)#ip route 200.200.200.0 255.255.255.0 null 0
ISP#sh ip bgp su | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
121.121.121.2 4 100 75 78 4 0 0 01:02:50 1
122.122.122.2 4 200 66 68 4 0 0 01:01:10 1
ISP#sh ip bgp
BGP table version is 4, local
router ID is 120.120.120.120
Status codes: s suppressed, d
damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 121.121.121.2 0 0 100 i
*> 120.120.120.120/32
0.0.0.0 0 32768 i
*> 200.200.200.0 122.122.122.2 0 0 200 i
A2#sh ip bgp
BGP table version is 4, local
router ID is 100.100.100.2
Status codes: s suppressed, d
damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP,? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i100.100.100.0/24 192.168.100.1 0 100 0 i
*>i120.120.120.120/32
192.168.100.1 0 100 0 120 i
*>i200.200.200.0 192.168.100.1 0 100 0 120 200 i
B3#sh ip bgp
BGP table version is 4, local
router ID is 200.200.200.3
Status codes: s suppressed, d
damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP,? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i100.100.100.0/24 192.168.200.1 0 100 0 120 100 i
*>i120.120.120.120/32
192.168.200.1 0 100 0 120 i
*>i200.200.200.0 192.168.200.1 0 100 0 i
A2#ping 200.200.200.3 source
100.100.100.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echosto 200.200.200.3, timeout is 2 seconds:
Packet sent with a sourceaddress of 100.100.100.2
!!!!!
Success rate is 100 percent
(5/5), round-trip min/avg/max = 40/49/56 ms
B3#ping 100.100.100.2 source 200.200.200.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.2, timeout is 2 seconds:
Packet sent with a source address of 200.200.200.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/56/68 ms