Saturday, 1 July 2017
BGP on XR
IOS XR အပေါ်မှာ BGP ကိုစမ်းကြည့်ဖို့အတွက် iBGP နဲ့ EBGP ပါဝင်တဲ့ ရှင်းလင်းတဲ့ LAB တစ်ခု လုပ်ကြည့်တာပေါ့။ Router ၃ လုံးကို အသုံးပြုထားပြီး ISP အတွက် တစ်လုံး ISP ကိုတိုက်ရိုက်ချိတ်ဆက် ထားတဲ့ CE အနေနဲ့ တစ်လုံး၊ CE ကနေ အတွင်းကို iBGP နဲ့ ပြန်သွားတဲ့ Core အနေနဲ့တစ်လုံး သုံးထား ပါတယ်။ ISP Router ကနေ Public Routes တွေအဖြစ် 10.xx.xx.xx ကနေ 50.xx.xx.xx အထိ ကြေညာ ထားပါတယ်။ CE ဖက်ကလည်း အတွင်းမှာ အသုံးပြုတဲ့ Public Routes တွေ ဖြစ်တဲ့ 100.xx.xx.xx နဲ့ 192.1.1.x. ကို ပြန်လည် ကြေညာမှာ ဖြစ်ပါတယ်။ CE နဲ့ Core အကြားမှာတော့ iBGP အပြင် အောက်ခံ အဖြစ် ISIS ကို အသုံးပြုထားပါတယ်။ ဒါမှသာ iBGP အချင်းချင်း Loopback Interface တွေကနေ တစ်လုံးနဲ့ တစ်လုံး စကားပြောနိုင်မှာ ဖြစ်ပါတယ်။
Configuration ပိုင်းအနေနဲ့ကတော့ သိပ်မကွာပါဘူး။ Address-family တွေရဲ့ အောက်မှာပဲ ရေးပေး ရပါတယ်။ အခြေခံဖြစ်တဲ့ Configuration မှာ သိသိသာသာ ကွာခြားသွားတာကတော့ eBGP အသုံးပြုတဲ့ ပုံပါ။ ရိုးရိုး IOS မှာ BGP Neighbour ဖြစ်ပြီဆိုတာနဲ့ တစ်ဖက်နဲ့ တစ်ဖက် Configuration မှာ ရေးထားတဲ့ အတိုင်း၊ BGP advertisement တွေအတိုင်း Routes တွေ ဖလှယ်ကြပါတယ်။ အဲဒါကို အလွယ်တကူ ကြည့် ချင်ရင် summary နဲ့ ကြည့်လိုက်ယုံပါပဲ။ Prefix ဘယ်နှစ်ခုရတယ် ဆိုတာ ချက်ချင်းသိနိုင်ပါတယ်။ XR မှာတော့ ဒီအတိုင်းဆိုရင် 0 Prefix အနေနဲ့မြင်ရပါလိမ့်မယ်။ တစ်ဖက်နဲ့ တစ်ဖက် Routes တွေ အပြန်အလှန် ပို့ဖို့အတွက် RPL လို့ ခေါ်တဲ့ Route policy ထည့်ပေးမှသာ Routes တွေကိုမြင်ရမှာ ဖြစ်ပါတယ်။ iBGP အချင်းချင်းဆိုရင်တော့ မလိုပါဘူး။
IOS မှာ အဲဒီလိုမျိုး ထိန်းချုပ်ဖို့ အတွက် Route-map တွေနဲ့ အသုံးပြုရပါတယ်။ RPL က route-map ထက် ပိုမိုကောင်းမွန်ပြီး လိုချင်တဲ့ Route attributes တွေပေါ်မူတည်ပြီး ဘာလုပ်မလဲဆိုတာမျိုးကို If/else statement တွေနဲ့ တွဲပြီး ဘာဖြစ်ရင် ဘာလုပ်မယ်၊ ဘယ်လိုပြောင်းမယ် ဆိုပြီး ကိုယ်ကြိုက်တဲ့ ပုံစံအတိုင်း အသုံးပြုလို့ ရပါတယ်။ RPL ကိုတော့ အစုံသုံးတတ်အောင် သီးသန့်ထပ်ပြီး လေ့လာရပါလိမ့်မယ်။ အခု LAB မှာတော့ ISP က လာတဲ့ Routes တွေကနေ 10.xx.xx.xx ကို လက်မခံပဲ တခြား Routes များကိုသာ လက်ခံတဲ့ ပုံစံ အနေနဲ့ စမ်းထားပါတယ်။ BGP ရဲ့ အလုပ်လုပ်ပုံ၊ IOS မှာ အသုံးပြုခဲ့တဲ့ အခြေခံတွေကိုသာ သိထားမယ် ဆိုရင် XR ပေါ်မှာလည်း လိုအပ်တဲ့ Configuration တွေကို လိုက်လုပ်နိုင်မှာ ဖြစ်ပါတယ်။
အခုအခြေအနေက CE နဲ့ CORE အကြားမှာ ISIS သုံးထားပြီး CORE မှာ ရှိတဲ့ Public routes ဖြစ်တဲ့ 192.168.1.2 နဲ့ 192.168.1.3 ကို ISIS ကနေ ပို့ထားတာဖြစ်ပါတယ်။ 100.100.100.1 နဲ့ .2 ကိုတော့ BGP ကနေ တင်မှာဖြစ်ပါတယ်။
RP/0/0/CPU0:CExrv#sh ip route
L 192.1.1.1/32 is directly connected, 00:05:23, Loopback1
i L2 192.1.1.2/32 [115/10] via 192.168.1.2, 00:02:16, GigabitEthernet0/0/0/1
i L2 192.1.1.3/32 [115/10] via 192.168.1.2, 00:02:16, GigabitEthernet0/0/0/1
C 192.168.1.0/30 is directly connected, 00:05:23, GigabitEthernet0/0/0/1
L 192.168.1.1/32 is directly connected, 00:05:23, GigabitEthernet0/0/0/1
C 200.200.200.0/30 is directly connected, 00:07:53, GigabitEthernet0/0/0/0
L 200.200.200.2/32 is directly connected, 00:07:53, GigabitEthernet0/0/0/0
Core-VXR#sh ip route
100.0.0.0/32 is subnetted, 2 subnets
C 100.100.100.1 is directly connected, Loopback3
C 100.100.100.2 is directly connected, Loopback4
192.1.1.0/32 is subnetted, 3 subnets
i L2 192.1.1.1 [115/10] via 192.168.1.1, 00:19:42, FastEthernet0/0
C 192.1.1.2 is directly connected, Loopback1
C 192.1.1.3 is directly connected, Loopback2
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/30 is directly connected, FastEthernet0/0
L 192.168.1.2/32 is directly connected, FastEthernet0/0
iBGP တက်သွားရင်တော့ 100.x.x.x routes တွေကို BGP Routes တွေအနေနဲ့ တွေ့ရမှာဖြစ်ပါတယ်။ အပြင် ISP ကို summary routes အနေနဲ့ ပို့ဖို့အတွက် Null0 ကို ထောက်ထားတဲ့ Static routes တွေကို တွေ့ပါလိမ့်မယ်။ XR မှာ Static route ကိုလည်း address-family ပုံစံမျိုးနဲ့ပဲ ရေးပါတယ်။
router static
address-family ipv4 unicast
100.100.100.0/30 Null0
192.1.1.0/24 Null0
RP/0/0/CPU0:CExrv#sh ip route
S 100.100.100.0/30 is directly connected, 00:00:07, Null0
B 100.100.100.1/32 [200/0] via 192.1.1.2, 00:04:13
B 100.100.100.2/32 [200/0] via 192.1.1.2, 00:04:13
S 192.1.1.0/24 is directly connected, 00:00:07, Null0
L 192.1.1.1/32 is directly connected, 00:45:03, Loopback1
i L2 192.1.1.2/32 [115/10] via 192.168.1.2, 00:41:55, GigabitEthernet0/0/0/1
i L2 192.1.1.3/32 [115/10] via 192.168.1.2, 00:41:55, GigabitEthernet0/0/0/1
C 192.168.1.0/30 is directly connected, 00:45:03, GigabitEthernet0/0/0/1
L 192.168.1.1/32 is directly connected, 00:45:03, GigabitEthernet0/0/0/1
C 200.200.200.0/30 is directly connected, 00:47:32, GigabitEthernet0/0/0/0
L 200.200.200.2/32 is directly connected, 00:47:32, GigabitEthernet0/0/0/0
BGP အားလုံးတက်သွားပြီဆိုရင် iBGP က ရတဲ့ Prefix count 2 ကိုမြင်ရပေမယ့် eBGP မှာတော့ 0 ကိုပဲ တွေ့ နေရမှာပါ။ ဒါကတော့ RPL အသုံးမပြုရသေးလို့ ဖြစ်ပါတယ်။
RP/0/0/CPU0:CExrv#sh bgp ipv4 unicast summary
BGP router identifier 192.1.1.1, local AS number 192
BGP generic scan interval 60 secs
BGP table state: Active
Table ID: 0xe0000000 RD version: 6
BGP main routing table version 6
BGP scan interval 60 secs
BGP is operating in STANDALONE mode.
Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer
Speaker 6 6 6 6 6 6
Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd
192.1.1.2 0 192 15 13 6 0 0 00:09:43 2
200.200.200.1 0 200 29 27 6 0 0 00:00:05 0!
RPL အသုံးပြုပြီးသွားရင်တော့ eBGP ကနေ ရလာတဲ့ Prefix counts 5 ကိုမြင်ရပါလိမ့်မယ်။ AS 200 ကနေလာတဲ့ Routes ၅ ခုတွေ့ရပါတယ်။ လက်ရှိပုံစံမှာ ဘာလာလာ အကုန်လက်ခံတဲ့ ပုံစံမျိုးနဲ့ သုံးထားတဲ့ Pass All RPL ဖြစ်ပါတယ်။
P/0/0/CPU0:CExrv#sh bgp ipv4 unicast summary
Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd
192.1.1.2 0 192 16 15 11 0 0 00:10:59 2
200.200.200.1 0 200 31 29 11 0 0 00:01:21 5
RP/0/0/CPU0:CExrv#sh bgp ipv4 unicast
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.10.10.0/24 200.200.200.1 0 0 200 ?
*> 20.20.20.0/24 200.200.200.1 0 0 200 ?
*> 30.30.30.0/24 200.200.200.1 0 0 200 ?
*> 40.40.40.0/24 200.200.200.1 0 0 200 ?
*> 100.100.100.0/30 0.0.0.0 0 32768 i
*>i100.100.100.1/32 192.1.1.2 0 100 0 i
*>i100.100.100.2/32 192.1.1.2 0 100 0 i
*> 192.1.1.0/24 0.0.0.0 0 32768 i
*> 200.200.200.0/30 200.200.200.1 0 0 200 ?
အဲဒီကမှ တဆင့် eBGP ကလာတဲ့ Routes တွေကနေ 10.x.x.x ကို လက်မခံတော့ပဲ ကျန်တာတွေကိုသာ လက်ခံမယ်ဆိုတဲ့ RPL နဲ့ အစားထိုးလိုပါမယ်။ ဒါဆိုရင်တော့ 10.x.x.x ပျောက်သွားတာကိုတွေ့ရပါလိမ့်မယ်။
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 20.20.20.0/24 200.200.200.1 0 0 200 ?
*> 30.30.30.0/24 200.200.200.1 0 0 200 ?
*> 40.40.40.0/24 200.200.200.1 0 0 200 ?
*> 100.100.100.0/30 0.0.0.0 0 32768 i
*>i100.100.100.1/32 192.1.1.2 0 100 0 i
*>i100.100.100.2/32 192.1.1.2 0 100 0 i
*> 192.1.1.0/24 0.0.0.0 0 32768 i
*> 200.200.200.0/30 200.200.200.1 0 0 200 ?
CE router မှာ အသုံးပြုထားတဲ့ RPL နဲ့ BGP Configuration ပုံစံပါ။ CE config ကိုကြည့်လိုက်တာနဲ့ ISP Router ကို အလွယ်တကူ ခန့်မှန်းလို့ ရနိုင်သလို CORE ကလည်း IOS အသုံးပြုထားတဲ့အတွက် မဖော်ပြတော့ပါဘူး။
CExrv
prefix-set 10Route
10.10.10.0/24
end-set
!
route-policy PASS
pass
end-policy
!
route-policy Block10
if destination in 10Route then
drop
else
pass
endif
end-policy
!
router bgp 192
address-family ipv4 unicast
network 100.100.100.0/30
network 192.1.1.0/24
!
neighbor 192.1.1.2
remote-as 192
update-source Loopback1
address-family ipv4 unicast
next-hop-self
soft-reconfiguration inbound
!
!
neighbor 200.200.200.1
remote-as 200
address-family ipv4 unicast
route-policy Block10 in
route-policy PASS out
ကိုဖြိုး
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment