際際滷

際際滷Share a Scribd company logo
Inter-ASh廠におけるボ`ダ`ル`タとして 
Ryu BGPC嬬をしてみた 
2014.8.31 
@ttsubo 
1
してみたいこと 
Ryu BGPを聞ったポリシ`ル`ティングが 
どの殻業、嘛するのか 
これまでのUは、 
こちらのブログ並を歌深にしてください 
http://ttsubo.hatenablog.com/entry/2014/08/16/000248 
2
まずは、gHのCiscoル`タの咾魎_Jしてみました 
GNS3によるCisco 
エミュレ`タですけど 
3
*まずは、朕妨 
-> InterAS MPLS VPNでのポリシ`ル`ティングの嘛_J 
宥械rは、ASgのトラフィックを頭肇螢鵐に篠せたい 
ASgでの絞嬾rは、もう頭箸離螢鵐に嗹指させたい 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(O) CE5 
LocalPreference 
で崙囮 
MED 
で崙囮 
LocalPreference 
で崙囮 
4 ポリシ`ル`ティングgF圭隈
*編^撹 
-> InterAS MPLS VPNにおける光BGPル`タでのBGPテ`ブルを 
 _Jしてみる 
eBGP 
eBGP 
StaticU揃 
StaticU揃 
StaticU揃 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(O) CE5 
5
PE1#show bgp vpnv4 unicast all 
BGP table version is 34, local router ID is 10.0.0.1 
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(O) CE5 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 
! 
Network Next Hop Metric LocPrf Weight Path 
Route Distinguisher: 65010:101 (default for vrf customerA) 
*> 10.10.10.1/32 192.168.1.1 0 0 65001 ? 
*>i 10.10.10.2/32 10.0.0.4 0 100 0 65002 ? 
*>i 10.10.10.3/32 10.0.0.3 100 200 0 65011 ? 
*>i 10.10.10.4/32 10.0.0.3 100 200 0 65011 ? 
*>i 10.10.10.5/32 10.0.0.3 100 200 0 65011 ? 
* 192.168.1.0/30 192.168.1.1 0 0 65001 ? 
*> 0.0.0.0 0 32768 ? 
*>i 192.168.2.0/30 10.0.0.4 0 100 0 ? 
*>i 192.168.3.0/30 10.0.0.3 100 200 0 65011 ? 
*>i 192.168.4.0/30 10.0.0.3 100 200 0 65011 ? 
*>i 192.168.5.0/30 10.0.0.3 100 200 0 65011 ? 
*> 192.168.201.0 192.168.1.1 0 0 65001 i 
*>i 192.168.202.0 10.0.0.4 0 100 0 65002 i 
*>i 192.168.203.0 10.0.0.3 100 200 0 65011 ? 
*>i 192.168.204.0 10.0.0.3 100 200 0 65011 ? 
*>i 192.168.205.0 10.0.0.3 100 200 0 65011 ? 
PE1# 
6
ASBR3#show bgp vpnv4 unicast all 
BGP table version is 22, local router ID is 10.0.0.3 
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 
! 
Network Next Hop Metric LocPrf Weight Path 
Route Distinguisher: 65010:101 
*>i 10.10.10.1/32 10.0.0.1 0 100 0 65001 ? 
*>i 10.10.10.2/32 10.0.0.4 0 100 0 65002 ? 
*> 10.10.10.3/32 192.168.101.102 100 200 0 65011 ? 
*> 10.10.10.4/32 192.168.101.102 100 200 0 65011 ? 
*> 10.10.10.5/32 192.168.101.102 100 200 0 65011 ? 
*>i 192.168.1.0/30 10.0.0.1 0 100 0 ? 
*>i 192.168.2.0/30 10.0.0.4 0 100 0 ? 
*> 192.168.3.0/30 192.168.101.102 100 200 0 65011 ? 
*> 192.168.4.0/30 192.168.101.102 100 200 0 65011 ? 
*> 192.168.5.0/30 192.168.101.102 100 200 0 65011 ? 
*>i 192.168.201.0 10.0.0.1 0 100 0 65001 i 
*>i 192.168.202.0 10.0.0.4 0 100 0 65002 i 
*> 192.168.203.0 192.168.101.102 100 200 0 65011 ? 
*> 192.168.204.0 192.168.101.102 100 200 0 65011 ? 
*> 192.168.205.0 192.168.101.102 100 200 0 65011 ? 
ASBR3# 
PE1 P1 
PE2 
P2 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(O) CE5 
7
ASBR1#show bgp vpnv4 unicast all 
BGP table version is 34, local router ID is 10.0.1.1 
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 
! 
Network Next Hop Metric LocPrf Weight Path 
Route Distinguisher: 65010:101 (default for vrf customerA) 
*> 10.10.10.1/32 192.168.101.101 100 200 0 65010 65001 ? 
*> 10.10.10.2/32 192.168.101.101 100 200 0 65010 65002 ? 
*>i 10.10.10.3/32 10.0.1.3 0 100 0 ? 
*> 10.10.10.4/32 192.168.4.2 0 32768 ? 
*>i 10.10.10.5/32 10.0.1.2 0 100 0 ? 
*> 192.168.1.0/30 192.168.101.101 100 200 0 65010 ? 
*> 192.168.2.0/30 192.168.101.101 100 200 0 65010 ? 
*>i 192.168.3.0/30 10.0.1.3 0 100 0 ? 
*> 192.168.4.0/30 0.0.0.0 0 32768 ? 
*>i 192.168.5.0/30 10.0.1.2 0 100 0 ? 
*> 192.168.201.0 192.168.101.101 100 200 0 65010 65001 i 
*> 192.168.202.0 192.168.101.101 100 200 0 65010 65002 i 
*>i 192.168.203.0 10.0.1.3 0 100 0 ? 
*> 192.168.204.0 192.168.4.2 0 32768 ? 
*>i 192.168.205.0 10.0.1.2 0 100 0 ? 
ASBR1# 
PE1 P1 
PE2 
P2 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(O) CE5 
8
ASBR2#show bgp vpnv4 unicast all 
BGP table version is 34, local router ID is 10.0.1.2 
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 
! 
Network Next Hop Metric LocPrf Weight Path 
Route Distinguisher: 65010:101 (default for vrf customerA) 
*>i 10.10.10.1/32 10.0.1.1 100 200 0 65010 65001 ? 
* 192.168.102.101 200 100 0 65010 65001 ? 
*>i 10.10.10.2/32 10.0.1.1 100 200 0 65010 65002 ? 
* 192.168.102.101 200 100 0 65010 65002 ? 
*>i 10.10.10.3/32 10.0.1.3 0 100 0 ? 
*>i 10.10.10.4/32 10.0.1.1 0 100 0 ? 
*> 10.10.10.5/32 192.168.5.2 0 32768 ? 
*>i 192.168.1.0/30 10.0.1.1 100 200 0 65010 ? 
* 192.168.102.101 200 100 0 65010 ? 
*>i 192.168.2.0/30 10.0.1.1 100 200 0 65010 ? 
* 192.168.102.101 200 100 0 65010 ? 
*>i 192.168.3.0/30 10.0.1.3 0 100 0 ? 
*>i 192.168.4.0/30 10.0.1.1 0 100 0 ? 
*> 192.168.5.0/30 0.0.0.0 0 32768 ? 
*>i 192.168.201.0 10.0.1.1 100 200 0 65010 65001 i 
* 192.168.102.101 200 100 0 65010 65001 i 
*>i 192.168.202.0 10.0.1.1 100 200 0 65010 65002 i 
* 192.168.102.101 200 100 0 65010 65002 i 
*>i 192.168.203.0 10.0.1.3 0 100 0 ? 
*>i 192.168.204.0 10.0.1.1 0 100 0 ? 
*> 192.168.205.0 192.168.5.2 0 32768 ? 
ASBR2# 
PE1 P1 
PE2 
P2 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(O) CE5 
9
PE3#show bgp vpnv4 unicast all 
BGP table version is 34, local router ID is 10.0.1.3 
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 
! 
Network Next Hop Metric LocPrf Weight Path 
Route Distinguisher: 65010:101 (default for vrf customerA) 
*>i 10.10.10.1/32 10.0.1.1 100 200 0 65010 65001 ? 
*>i 10.10.10.2/32 10.0.1.1 100 200 0 65010 65002 ? 
*> 10.10.10.3/32 192.168.3.2 0 32768 ? 
*>i 10.10.10.4/32 10.0.1.1 0 100 0 ? 
*>i 10.10.10.5/32 10.0.1.2 0 100 0 ? 
*>i 192.168.1.0/30 10.0.1.1 100 200 0 65010 ? 
*>i 192.168.2.0/30 10.0.1.1 100 200 0 65010 ? 
*> 192.168.3.0/30 0.0.0.0 0 32768 ? 
*>i 192.168.4.0/30 10.0.1.1 0 100 0 ? 
*>i 192.168.5.0/30 10.0.1.2 0 100 0 ? 
*>i 192.168.201.0 10.0.1.1 100 200 0 65010 65001 i 
*>i 192.168.202.0 10.0.1.1 100 200 0 65010 65002 i 
*> 192.168.203.0 192.168.3.2 0 32768 ? 
*>i 192.168.204.0 10.0.1.1 0 100 0 ? 
*>i 192.168.205.0 10.0.1.2 0 100 0 ? 
PE3# 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(O) CE5 
10
つぎに、ASBRにRyuBGPをm喘した栽、 
BGPの咾魎_Jしてみました 
11
*Ryu BGPをm喘した編^撹 
-> AS:65011のボ`ダ`ル`タとしてRyu BGPを塘吭してみる。 
宥械rは、ASgのトラフィックを頭肇螢鵐に篠せたい 
ASgでの絞嬾rは、もう頭箸離螢鵐に嗹指させたい 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
Ryu BGP1 
Ryu BGP2 
AS 65011(O) CE5 
MED 
で崙囮 
LocalPreference 
で崙囮 
LocalPreference 
で崙囮 
ポリシ`ル`ティングgF圭隈 
12
Ryu BGP1のサンプルコ`ド 
import eventlet 
import time 
! 
eventlet.monkey_patch() 
! 
import logging 
import sys 
logging.basicConfig(level=logging.INFO) 
! 
from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker 
! 
def dump_remote_best_path_change(event): 
print 'the best path changed:', event.remote_as, event.prefix, 
event.nexthop, event.is_withdraw 
! 
if __name__ == "__main__": 
speaker = BGPSpeaker(as_number=65011, router_id='10.0.1.1', 
best_path_change_handler=dump_remote_best_path_change, ssh_console=True, 
label_range=(1000,1999)) 
! 
speaker.neighbor_add('192.168.101.101', 65010, enable_ipv4=True, enable_vpnv4=True, 
multi_exit_disc=100) 
speaker.neighbor_add('192.168.104.102', 65011, enable_ipv4=True, enable_vpnv4=True, 
next_hop='10.0.1.1') 
speaker.neighbor_add('10.0.1.3', 65011, enable_ipv4=True, enable_vpnv4=True, next_hop='10.0.1.1') 
speaker.vrf_add('65010:101', ['65010:101'], ['65010:101']) 
eventlet.sleep(5) 
speaker.prefix_add('192.168.4.0/30', next_hop='0.0.0.0', route_dist='65010:101') 
speaker.prefix_add('10.10.10.4/32', next_hop='192.168.4.2', route_dist='65010:101') 
speaker.prefix_add('192.168.204.0/30', next_hop='192.168.4.2', route_dist='65010:101') 
! 
while True: 
eventlet.sleep(5) 
13
Ryu BGP2のサンプルコ`ド 
import eventlet 
import time 
! 
eventlet.monkey_patch() 
! 
import logging 
import sys 
logging.basicConfig(level=logging.INFO) 
! 
from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker 
! 
def dump_remote_best_path_change(event): 
print 'the best path changed:', event.remote_as, event.prefix, 
event.nexthop, event.is_withdraw 
! 
if __name__ == "__main__": 
speaker = BGPSpeaker(as_number=65011, router_id='10.0.1.2', 
best_path_change_handler=dump_remote_best_path_change, ssh_console=True, 
label_range=(2000,2999)) 
! 
speaker.neighbor_add('192.168.102.101', 65010, enable_ipv4=True, enable_vpnv4=True, 
multi_exit_disc=200) 
speaker.neighbor_add('192.168.104.101', 65011, enable_ipv4=True, enable_vpnv4=True, 
next_hop='10.0.1.2') 
speaker.neighbor_add('10.0.1.3', 65011, enable_ipv4=True, enable_vpnv4=True, next_hop='10.0.1.2') 
speaker.vrf_add('65010:101', ['65010:101'], ['65010:101']) 
eventlet.sleep(5) 
speaker.prefix_add('192.168.5.0/30', next_hop='0.0.0.0', route_dist='65010:101') 
speaker.prefix_add('10.10.10.5/32', next_hop='192.168.5.2', route_dist='65010:101') 
speaker.prefix_add('192.168.205.0/30', next_hop='192.168.5.2', route_dist='65010:101') 
! 
while True: 
eventlet.sleep(5) 
14
*BGPU揃撹Ryu BGP軟噤瓧 
eBGP 
eBGP 
Ryu BGP1 
Ryu BGP2 
StaticU揃 
StaticU揃 
StaticU揃 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
Ryu BGP1 
Ryu BGP2 
PE3 
15 AS 65011(O) CE5
PE1#show bgp vpnv4 unicast all 
BGP table version is 466, local router ID is 10.0.0.1 
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
Ryu BGP1 
Ryu BGP2 
AS 65011(O) CE5 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 
! 
Network Next Hop Metric LocPrf Weight Path 
Route Distinguisher: 65010:101 (default for vrf customerA) 
*> 10.10.10.1/32 192.168.1.1 0 0 65001 ? 
*>i 10.10.10.2/32 10.0.0.4 0 100 0 65002 ? 
*>i 10.10.10.3/32 10.0.0.3 0 200 0 65011 ? 
*>i 10.10.10.4/32 10.0.0.3 100 200 0 65011 ? 
*>i 10.10.10.5/32 10.0.0.3 100 200 0 65011 ? 
* 192.168.1.0/30 192.168.1.1 0 0 65001 ? 
*> 0.0.0.0 0 32768 ? 
*>i 192.168.2.0/30 10.0.0.4 0 100 0 ? 
*>i 192.168.3.0/30 10.0.0.3 0 200 0 65011 ? 
*>i 192.168.4.0/30 10.0.0.3 100 200 0 65011 ? 
*>i 192.168.5.0/30 10.0.0.3 100 200 0 65011 ? 
*> 192.168.201.0 192.168.1.1 0 0 65001 i 
*>i 192.168.202.0 10.0.0.4 0 100 0 65002 i 
*>i 192.168.203.0 10.0.0.3 0 200 0 65011 ? 
*>i 192.168.204.0/30 10.0.0.3 100 200 0 65011 ? 
*>i 192.168.205.0/30 10.0.0.3 100 200 0 65011 ? 
PE1# 
PE3で伏撹したU揃秤 
に泙蝓MED、燕幣さ 
れない 
16
ASBR3#sh bgp vpnv4 unicast all 
BGP table version is 331, local router ID is 10.0.0.3 
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
PE1 P1 
PE2 
P2 
ASBR3 
PE3で伏撹したU揃秤 
に泙蝓MED、燕幣さ 
れない 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
AS 65011(O) CE5 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 
! 
Network Next Hop Metric LocPrf Weight Path 
Route Distinguisher: 65010:101 
*>i 10.10.10.1/32 10.0.0.1 0 100 0 65001 ? 
*>i 10.10.10.2/32 10.0.0.4 0 100 0 65002 ? 
*> 10.10.10.3/32 192.168.101.102 0 200 0 65011 ? 
*> 10.10.10.4/32 192.168.101.102 100 200 0 65011 ? 
*> 10.10.10.5/32 192.168.101.102 100 200 0 65011 ? 
*>i 192.168.1.0/30 10.0.0.1 0 100 0 ? 
*>i 192.168.2.0/30 10.0.0.4 0 100 0 ? 
*> 192.168.3.0/30 192.168.101.102 0 200 0 65011 ? 
*> 192.168.4.0/30 192.168.101.102 100 200 0 65011 ? 
*> 192.168.5.0/30 192.168.101.102 100 200 0 65011 ? 
*>i 192.168.201.0 10.0.0.1 0 100 0 65001 i 
*>i 192.168.202.0 10.0.0.4 0 100 0 65002 i 
*> 192.168.203.0 192.168.101.102 0 200 0 65011 ? 
*> 192.168.204.0/30 192.168.101.102 100 200 0 65011 ? 
*> 192.168.205.0/30 192.168.101.102 100 200 0 65011 ? 
ASBR3# 
Ryu BGP1 
Ryu BGP2 
17
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
AS 65011(O) CE5 
bgpd> show rib vpnv4 
Status codes: * valid, > best 
Origin codes: i - IGP, e - EGP, ? - incomplete 
Network Labels Next Hop Reason Metric LocPrf Path 
*> 65010:101:192.168.5.0/30 [2000] 10.0.1.2 Only Path 100 ? 
*> 65010:101:10.10.10.5/32 [2001] 10.0.1.2 Only Path 100 ? 
*> 65010:101:192.168.205.0/30 [2001] 10.0.1.2 Only Path 100 ? 
*> 65010:101:192.168.1.0/30 [28] 192.168.101.101 Only Path 100 65010 ? 
*> 65010:101:192.168.2.0/30 [29] 192.168.101.101 Only Path 100 65010 ? 
*> 65010:101:192.168.202.0/24 [30] 192.168.101.101 Only Path 100 65010 65002 i 
*> 65010:101:10.10.10.1/32 [31] 192.168.101.101 Only Path 100 65010 65001 ? 
*> 65010:101:10.10.10.2/32 [32] 192.168.101.101 Only Path 100 65010 65002 ? 
*> 65010:101:192.168.201.0/24 [33] 192.168.101.101 Only Path 100 65010 65001 i 
*> 65010:101:192.168.4.0/30 [1000] 0.0.0.0 Only Path ? 
*> 65010:101:10.10.10.4/32 [1001] 192.168.4.2 Only Path ? 
*> 65010:101:192.168.204.0/30 [1001] 192.168.4.2 Only Path ? 
*> 65010:101:192.168.3.0/30 [19] 10.0.1.3 Only Path 0 100 ? 
*> 65010:101:192.168.203.0/24 [20] 10.0.1.3 Only Path 0 100 ? 
*> 65010:101:10.10.10.3/32 [18] 10.0.1.3 Only Path 0 100 ? 
bgpd> 
Ryu BGP1 
Ryu BGP2 
LocalPreference 
が原嚥できない 
18
PE1 P1 
PE2 
P2 
AS65010箸派撹したU揃秤鵑髻i-BGPU喇 
で鞭佚した栽には、MED、燕幣されない 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
Ryu BGP1 
Ryu BGP2 
AS 65011(O) CE5 
bgpd> show rib vpnv4 
Status codes: * valid, > best 
Origin codes: i - IGP, e - EGP, ? - incomplete 
Network Labels Next Hop Reason Metric LocPrf Path 
*> 65010:101:192.168.3.0/30 [19] 10.0.1.3 Only Path 0 100 ? 
*> 65010:101:192.168.203.0/24 [20] 10.0.1.3 Only Path 0 100 ? 
*> 65010:101:10.10.10.3/32 [18] 10.0.1.3 Only Path 0 100 ? 
*> 65010:101:192.168.5.0/30 [2000] 0.0.0.0 Only Path ? 
*> 65010:101:10.10.10.5/32 [2001] 192.168.5.2 Only Path ? 
*> 65010:101:192.168.205.0/30 [2001] 192.168.5.2 Only Path ? 
*> 65010:101:192.168.202.0/24 [30] 192.168.101.101 MED 100 65010 65002 i 
* [33] 192.168.102.101 200 65010 65002 i 
*> 65010:101:192.168.201.0/24 [33] 192.168.101.101 MED 100 65010 65001 i 
* [36] 192.168.102.101 200 65010 65001 i 
*> 65010:101:192.168.204.0/30 [1001] 10.0.1.1 Only Path 100 ? 
*> 65010:101:10.10.10.4/32 [1001] 10.0.1.1 Only Path 100 ? 
*> 65010:101:192.168.2.0/30 [29] 192.168.101.101 MED 100 65010 ? 
* [29] 192.168.102.101 200 65010 ? 
*> 65010:101:10.10.10.1/32 [31] 192.168.101.101 MED 100 65010 65001 ? 
* [34] 192.168.102.101 200 65010 65001 ? 
*> 65010:101:192.168.1.0/30 [28] 192.168.101.101 MED 100 65010 ? 
* [28] 192.168.102.101 200 65010 ? 
*> 65010:101:10.10.10.2/32 [32] 192.168.101.101 MED 100 65010 65002 ? 
* [35] 192.168.102.101 200 65010 65002 ? 
*> 65010:101:192.168.4.0/30 [1000] 10.0.1.1 Only Path 100 ? 
bgpd> 
19
PE3#show bgp vpnv4 unicast all 
BGP table version is 58, local router ID is 10.0.1.3 
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(屡O) 
AS 65001 
AS 65002 
ASBR4 
PE3 
Ryu BGP1 
Ryu BGP2 
AS 65011(O) CE5 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 
! 
Network Next Hop Metric LocPrf Weight Path 
Route Distinguisher: 65010:101 (default for vrf customerA) 
* i 10.10.10.1/32 192.168.101.101 100 0 65010 65001 ? 
* i 10.10.10.2/32 192.168.101.101 100 0 65010 65002 ? 
*> 10.10.10.3/32 192.168.3.2 0 32768 ? 
*>i 10.10.10.4/32 10.0.1.1 100 0 ? 
*>i 10.10.10.5/32 10.0.1.2 100 0 ? 
* i 192.168.1.0/30 192.168.101.101 100 0 65010 ? 
* i 192.168.2.0/30 192.168.101.101 100 0 65010 ? 
*> 192.168.3.0/30 0.0.0.0 0 32768 ? 
*>i 192.168.4.0/30 10.0.1.1 100 0 ? 
*>i 192.168.5.0/30 10.0.1.2 100 0 ? 
* i 192.168.201.0 192.168.101.101 100 0 65010 65001 i 
* i 192.168.202.0 192.168.101.101 100 0 65010 65002 i 
*> 192.168.203.0 192.168.3.2 0 32768 ? 
*>i 192.168.204.0/30 10.0.1.1 100 0 ? 
*>i 192.168.205.0/30 10.0.1.2 100 0 ? 
PE3# 
AS65010箸派撹し 
たU揃秤鵑臨釼mパスが 
燕幣されない 
20 
AS65010から鞭佚した 
U揃秤鵑して、 
LoopBackアドレスへ 
のきQえが佩われてい 
ない
わかったこと、 
> F粁AのRyu BGPは、i-BGPピアにvわるC嬬塘笋砲 
 m喘が是yそうだと湖じた。 
> F粁AのRyu BGPは、BGPピアのK極泣への塘笋 
 念戻としたC嬬醤笋なされている。 
> BGPピアの嶄@泣に塘笋垢栽には、BGPパラメ`タ 
 の三瓩哩vわる藻吭泣を覿┐垢覬慴がある。 
> OSPFル`ティングドメイン吉とのB亊については、 
 聞い返が徭念で笋垢覬慴がある。 
 -> NextHopへの欺_來への鬉e余駅勣 
 -> デ`タプレ`ンB亊にvわる鬉e余駅勣 
 ちなみに、書指は、すべて床議ル`ティングO協を並念に 
 佩うことで鬉靴拭

More Related Content

InterAS MPLS-VPN with RyuBgp

  • 2. してみたいこと Ryu BGPを聞ったポリシ`ル`ティングが どの殻業、嘛するのか これまでのUは、 こちらのブログ並を歌深にしてください http://ttsubo.hatenablog.com/entry/2014/08/16/000248 2
  • 4. *まずは、朕妨 -> InterAS MPLS VPNでのポリシ`ル`ティングの嘛_J 宥械rは、ASgのトラフィックを頭肇螢鵐に篠せたい ASgでの絞嬾rは、もう頭箸離螢鵐に嗹指させたい PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(O) CE5 LocalPreference で崙囮 MED で崙囮 LocalPreference で崙囮 4 ポリシ`ル`ティングgF圭隈
  • 5. *編^撹 -> InterAS MPLS VPNにおける光BGPル`タでのBGPテ`ブルを  _Jしてみる eBGP eBGP StaticU揃 StaticU揃 StaticU揃 PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(O) CE5 5
  • 6. PE1#show bgp vpnv4 unicast all BGP table version is 34, local router ID is 10.0.0.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(O) CE5 Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found ! Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 65010:101 (default for vrf customerA) *> 10.10.10.1/32 192.168.1.1 0 0 65001 ? *>i 10.10.10.2/32 10.0.0.4 0 100 0 65002 ? *>i 10.10.10.3/32 10.0.0.3 100 200 0 65011 ? *>i 10.10.10.4/32 10.0.0.3 100 200 0 65011 ? *>i 10.10.10.5/32 10.0.0.3 100 200 0 65011 ? * 192.168.1.0/30 192.168.1.1 0 0 65001 ? *> 0.0.0.0 0 32768 ? *>i 192.168.2.0/30 10.0.0.4 0 100 0 ? *>i 192.168.3.0/30 10.0.0.3 100 200 0 65011 ? *>i 192.168.4.0/30 10.0.0.3 100 200 0 65011 ? *>i 192.168.5.0/30 10.0.0.3 100 200 0 65011 ? *> 192.168.201.0 192.168.1.1 0 0 65001 i *>i 192.168.202.0 10.0.0.4 0 100 0 65002 i *>i 192.168.203.0 10.0.0.3 100 200 0 65011 ? *>i 192.168.204.0 10.0.0.3 100 200 0 65011 ? *>i 192.168.205.0 10.0.0.3 100 200 0 65011 ? PE1# 6
  • 7. ASBR3#show bgp vpnv4 unicast all BGP table version is 22, local router ID is 10.0.0.3 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found ! Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 65010:101 *>i 10.10.10.1/32 10.0.0.1 0 100 0 65001 ? *>i 10.10.10.2/32 10.0.0.4 0 100 0 65002 ? *> 10.10.10.3/32 192.168.101.102 100 200 0 65011 ? *> 10.10.10.4/32 192.168.101.102 100 200 0 65011 ? *> 10.10.10.5/32 192.168.101.102 100 200 0 65011 ? *>i 192.168.1.0/30 10.0.0.1 0 100 0 ? *>i 192.168.2.0/30 10.0.0.4 0 100 0 ? *> 192.168.3.0/30 192.168.101.102 100 200 0 65011 ? *> 192.168.4.0/30 192.168.101.102 100 200 0 65011 ? *> 192.168.5.0/30 192.168.101.102 100 200 0 65011 ? *>i 192.168.201.0 10.0.0.1 0 100 0 65001 i *>i 192.168.202.0 10.0.0.4 0 100 0 65002 i *> 192.168.203.0 192.168.101.102 100 200 0 65011 ? *> 192.168.204.0 192.168.101.102 100 200 0 65011 ? *> 192.168.205.0 192.168.101.102 100 200 0 65011 ? ASBR3# PE1 P1 PE2 P2 r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(O) CE5 7
  • 8. ASBR1#show bgp vpnv4 unicast all BGP table version is 34, local router ID is 10.0.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found ! Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 65010:101 (default for vrf customerA) *> 10.10.10.1/32 192.168.101.101 100 200 0 65010 65001 ? *> 10.10.10.2/32 192.168.101.101 100 200 0 65010 65002 ? *>i 10.10.10.3/32 10.0.1.3 0 100 0 ? *> 10.10.10.4/32 192.168.4.2 0 32768 ? *>i 10.10.10.5/32 10.0.1.2 0 100 0 ? *> 192.168.1.0/30 192.168.101.101 100 200 0 65010 ? *> 192.168.2.0/30 192.168.101.101 100 200 0 65010 ? *>i 192.168.3.0/30 10.0.1.3 0 100 0 ? *> 192.168.4.0/30 0.0.0.0 0 32768 ? *>i 192.168.5.0/30 10.0.1.2 0 100 0 ? *> 192.168.201.0 192.168.101.101 100 200 0 65010 65001 i *> 192.168.202.0 192.168.101.101 100 200 0 65010 65002 i *>i 192.168.203.0 10.0.1.3 0 100 0 ? *> 192.168.204.0 192.168.4.2 0 32768 ? *>i 192.168.205.0 10.0.1.2 0 100 0 ? ASBR1# PE1 P1 PE2 P2 r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(O) CE5 8
  • 9. ASBR2#show bgp vpnv4 unicast all BGP table version is 34, local router ID is 10.0.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found ! Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 65010:101 (default for vrf customerA) *>i 10.10.10.1/32 10.0.1.1 100 200 0 65010 65001 ? * 192.168.102.101 200 100 0 65010 65001 ? *>i 10.10.10.2/32 10.0.1.1 100 200 0 65010 65002 ? * 192.168.102.101 200 100 0 65010 65002 ? *>i 10.10.10.3/32 10.0.1.3 0 100 0 ? *>i 10.10.10.4/32 10.0.1.1 0 100 0 ? *> 10.10.10.5/32 192.168.5.2 0 32768 ? *>i 192.168.1.0/30 10.0.1.1 100 200 0 65010 ? * 192.168.102.101 200 100 0 65010 ? *>i 192.168.2.0/30 10.0.1.1 100 200 0 65010 ? * 192.168.102.101 200 100 0 65010 ? *>i 192.168.3.0/30 10.0.1.3 0 100 0 ? *>i 192.168.4.0/30 10.0.1.1 0 100 0 ? *> 192.168.5.0/30 0.0.0.0 0 32768 ? *>i 192.168.201.0 10.0.1.1 100 200 0 65010 65001 i * 192.168.102.101 200 100 0 65010 65001 i *>i 192.168.202.0 10.0.1.1 100 200 0 65010 65002 i * 192.168.102.101 200 100 0 65010 65002 i *>i 192.168.203.0 10.0.1.3 0 100 0 ? *>i 192.168.204.0 10.0.1.1 0 100 0 ? *> 192.168.205.0 192.168.5.2 0 32768 ? ASBR2# PE1 P1 PE2 P2 r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(O) CE5 9
  • 10. PE3#show bgp vpnv4 unicast all BGP table version is 34, local router ID is 10.0.1.3 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found ! Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 65010:101 (default for vrf customerA) *>i 10.10.10.1/32 10.0.1.1 100 200 0 65010 65001 ? *>i 10.10.10.2/32 10.0.1.1 100 200 0 65010 65002 ? *> 10.10.10.3/32 192.168.3.2 0 32768 ? *>i 10.10.10.4/32 10.0.1.1 0 100 0 ? *>i 10.10.10.5/32 10.0.1.2 0 100 0 ? *>i 192.168.1.0/30 10.0.1.1 100 200 0 65010 ? *>i 192.168.2.0/30 10.0.1.1 100 200 0 65010 ? *> 192.168.3.0/30 0.0.0.0 0 32768 ? *>i 192.168.4.0/30 10.0.1.1 0 100 0 ? *>i 192.168.5.0/30 10.0.1.2 0 100 0 ? *>i 192.168.201.0 10.0.1.1 100 200 0 65010 65001 i *>i 192.168.202.0 10.0.1.1 100 200 0 65010 65002 i *> 192.168.203.0 192.168.3.2 0 32768 ? *>i 192.168.204.0 10.0.1.1 0 100 0 ? *>i 192.168.205.0 10.0.1.2 0 100 0 ? PE3# PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(O) CE5 10
  • 12. *Ryu BGPをm喘した編^撹 -> AS:65011のボ`ダ`ル`タとしてRyu BGPを塘吭してみる。 宥械rは、ASgのトラフィックを頭肇螢鵐に篠せたい ASgでの絞嬾rは、もう頭箸離螢鵐に嗹指させたい PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 Ryu BGP1 Ryu BGP2 AS 65011(O) CE5 MED で崙囮 LocalPreference で崙囮 LocalPreference で崙囮 ポリシ`ル`ティングgF圭隈 12
  • 13. Ryu BGP1のサンプルコ`ド import eventlet import time ! eventlet.monkey_patch() ! import logging import sys logging.basicConfig(level=logging.INFO) ! from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker ! def dump_remote_best_path_change(event): print 'the best path changed:', event.remote_as, event.prefix, event.nexthop, event.is_withdraw ! if __name__ == "__main__": speaker = BGPSpeaker(as_number=65011, router_id='10.0.1.1', best_path_change_handler=dump_remote_best_path_change, ssh_console=True, label_range=(1000,1999)) ! speaker.neighbor_add('192.168.101.101', 65010, enable_ipv4=True, enable_vpnv4=True, multi_exit_disc=100) speaker.neighbor_add('192.168.104.102', 65011, enable_ipv4=True, enable_vpnv4=True, next_hop='10.0.1.1') speaker.neighbor_add('10.0.1.3', 65011, enable_ipv4=True, enable_vpnv4=True, next_hop='10.0.1.1') speaker.vrf_add('65010:101', ['65010:101'], ['65010:101']) eventlet.sleep(5) speaker.prefix_add('192.168.4.0/30', next_hop='0.0.0.0', route_dist='65010:101') speaker.prefix_add('10.10.10.4/32', next_hop='192.168.4.2', route_dist='65010:101') speaker.prefix_add('192.168.204.0/30', next_hop='192.168.4.2', route_dist='65010:101') ! while True: eventlet.sleep(5) 13
  • 14. Ryu BGP2のサンプルコ`ド import eventlet import time ! eventlet.monkey_patch() ! import logging import sys logging.basicConfig(level=logging.INFO) ! from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker ! def dump_remote_best_path_change(event): print 'the best path changed:', event.remote_as, event.prefix, event.nexthop, event.is_withdraw ! if __name__ == "__main__": speaker = BGPSpeaker(as_number=65011, router_id='10.0.1.2', best_path_change_handler=dump_remote_best_path_change, ssh_console=True, label_range=(2000,2999)) ! speaker.neighbor_add('192.168.102.101', 65010, enable_ipv4=True, enable_vpnv4=True, multi_exit_disc=200) speaker.neighbor_add('192.168.104.101', 65011, enable_ipv4=True, enable_vpnv4=True, next_hop='10.0.1.2') speaker.neighbor_add('10.0.1.3', 65011, enable_ipv4=True, enable_vpnv4=True, next_hop='10.0.1.2') speaker.vrf_add('65010:101', ['65010:101'], ['65010:101']) eventlet.sleep(5) speaker.prefix_add('192.168.5.0/30', next_hop='0.0.0.0', route_dist='65010:101') speaker.prefix_add('10.10.10.5/32', next_hop='192.168.5.2', route_dist='65010:101') speaker.prefix_add('192.168.205.0/30', next_hop='192.168.5.2', route_dist='65010:101') ! while True: eventlet.sleep(5) 14
  • 15. *BGPU揃撹Ryu BGP軟噤瓧 eBGP eBGP Ryu BGP1 Ryu BGP2 StaticU揃 StaticU揃 StaticU揃 PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 Ryu BGP1 Ryu BGP2 PE3 15 AS 65011(O) CE5
  • 16. PE1#show bgp vpnv4 unicast all BGP table version is 466, local router ID is 10.0.0.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 Ryu BGP1 Ryu BGP2 AS 65011(O) CE5 Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found ! Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 65010:101 (default for vrf customerA) *> 10.10.10.1/32 192.168.1.1 0 0 65001 ? *>i 10.10.10.2/32 10.0.0.4 0 100 0 65002 ? *>i 10.10.10.3/32 10.0.0.3 0 200 0 65011 ? *>i 10.10.10.4/32 10.0.0.3 100 200 0 65011 ? *>i 10.10.10.5/32 10.0.0.3 100 200 0 65011 ? * 192.168.1.0/30 192.168.1.1 0 0 65001 ? *> 0.0.0.0 0 32768 ? *>i 192.168.2.0/30 10.0.0.4 0 100 0 ? *>i 192.168.3.0/30 10.0.0.3 0 200 0 65011 ? *>i 192.168.4.0/30 10.0.0.3 100 200 0 65011 ? *>i 192.168.5.0/30 10.0.0.3 100 200 0 65011 ? *> 192.168.201.0 192.168.1.1 0 0 65001 i *>i 192.168.202.0 10.0.0.4 0 100 0 65002 i *>i 192.168.203.0 10.0.0.3 0 200 0 65011 ? *>i 192.168.204.0/30 10.0.0.3 100 200 0 65011 ? *>i 192.168.205.0/30 10.0.0.3 100 200 0 65011 ? PE1# PE3で伏撹したU揃秤 に泙蝓MED、燕幣さ れない 16
  • 17. ASBR3#sh bgp vpnv4 unicast all BGP table version is 331, local router ID is 10.0.0.3 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, PE1 P1 PE2 P2 ASBR3 PE3で伏撹したU揃秤 に泙蝓MED、燕幣さ れない CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 AS 65011(O) CE5 Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found ! Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 65010:101 *>i 10.10.10.1/32 10.0.0.1 0 100 0 65001 ? *>i 10.10.10.2/32 10.0.0.4 0 100 0 65002 ? *> 10.10.10.3/32 192.168.101.102 0 200 0 65011 ? *> 10.10.10.4/32 192.168.101.102 100 200 0 65011 ? *> 10.10.10.5/32 192.168.101.102 100 200 0 65011 ? *>i 192.168.1.0/30 10.0.0.1 0 100 0 ? *>i 192.168.2.0/30 10.0.0.4 0 100 0 ? *> 192.168.3.0/30 192.168.101.102 0 200 0 65011 ? *> 192.168.4.0/30 192.168.101.102 100 200 0 65011 ? *> 192.168.5.0/30 192.168.101.102 100 200 0 65011 ? *>i 192.168.201.0 10.0.0.1 0 100 0 65001 i *>i 192.168.202.0 10.0.0.4 0 100 0 65002 i *> 192.168.203.0 192.168.101.102 0 200 0 65011 ? *> 192.168.204.0/30 192.168.101.102 100 200 0 65011 ? *> 192.168.205.0/30 192.168.101.102 100 200 0 65011 ? ASBR3# Ryu BGP1 Ryu BGP2 17
  • 18. PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 AS 65011(O) CE5 bgpd> show rib vpnv4 Status codes: * valid, > best Origin codes: i - IGP, e - EGP, ? - incomplete Network Labels Next Hop Reason Metric LocPrf Path *> 65010:101:192.168.5.0/30 [2000] 10.0.1.2 Only Path 100 ? *> 65010:101:10.10.10.5/32 [2001] 10.0.1.2 Only Path 100 ? *> 65010:101:192.168.205.0/30 [2001] 10.0.1.2 Only Path 100 ? *> 65010:101:192.168.1.0/30 [28] 192.168.101.101 Only Path 100 65010 ? *> 65010:101:192.168.2.0/30 [29] 192.168.101.101 Only Path 100 65010 ? *> 65010:101:192.168.202.0/24 [30] 192.168.101.101 Only Path 100 65010 65002 i *> 65010:101:10.10.10.1/32 [31] 192.168.101.101 Only Path 100 65010 65001 ? *> 65010:101:10.10.10.2/32 [32] 192.168.101.101 Only Path 100 65010 65002 ? *> 65010:101:192.168.201.0/24 [33] 192.168.101.101 Only Path 100 65010 65001 i *> 65010:101:192.168.4.0/30 [1000] 0.0.0.0 Only Path ? *> 65010:101:10.10.10.4/32 [1001] 192.168.4.2 Only Path ? *> 65010:101:192.168.204.0/30 [1001] 192.168.4.2 Only Path ? *> 65010:101:192.168.3.0/30 [19] 10.0.1.3 Only Path 0 100 ? *> 65010:101:192.168.203.0/24 [20] 10.0.1.3 Only Path 0 100 ? *> 65010:101:10.10.10.3/32 [18] 10.0.1.3 Only Path 0 100 ? bgpd> Ryu BGP1 Ryu BGP2 LocalPreference が原嚥できない 18
  • 19. PE1 P1 PE2 P2 AS65010箸派撹したU揃秤鵑髻i-BGPU喇 で鞭佚した栽には、MED、燕幣されない ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 Ryu BGP1 Ryu BGP2 AS 65011(O) CE5 bgpd> show rib vpnv4 Status codes: * valid, > best Origin codes: i - IGP, e - EGP, ? - incomplete Network Labels Next Hop Reason Metric LocPrf Path *> 65010:101:192.168.3.0/30 [19] 10.0.1.3 Only Path 0 100 ? *> 65010:101:192.168.203.0/24 [20] 10.0.1.3 Only Path 0 100 ? *> 65010:101:10.10.10.3/32 [18] 10.0.1.3 Only Path 0 100 ? *> 65010:101:192.168.5.0/30 [2000] 0.0.0.0 Only Path ? *> 65010:101:10.10.10.5/32 [2001] 192.168.5.2 Only Path ? *> 65010:101:192.168.205.0/30 [2001] 192.168.5.2 Only Path ? *> 65010:101:192.168.202.0/24 [30] 192.168.101.101 MED 100 65010 65002 i * [33] 192.168.102.101 200 65010 65002 i *> 65010:101:192.168.201.0/24 [33] 192.168.101.101 MED 100 65010 65001 i * [36] 192.168.102.101 200 65010 65001 i *> 65010:101:192.168.204.0/30 [1001] 10.0.1.1 Only Path 100 ? *> 65010:101:10.10.10.4/32 [1001] 10.0.1.1 Only Path 100 ? *> 65010:101:192.168.2.0/30 [29] 192.168.101.101 MED 100 65010 ? * [29] 192.168.102.101 200 65010 ? *> 65010:101:10.10.10.1/32 [31] 192.168.101.101 MED 100 65010 65001 ? * [34] 192.168.102.101 200 65010 65001 ? *> 65010:101:192.168.1.0/30 [28] 192.168.101.101 MED 100 65010 ? * [28] 192.168.102.101 200 65010 ? *> 65010:101:10.10.10.2/32 [32] 192.168.101.101 MED 100 65010 65002 ? * [35] 192.168.102.101 200 65010 65002 ? *> 65010:101:192.168.4.0/30 [1000] 10.0.1.1 Only Path 100 ? bgpd> 19
  • 20. PE3#show bgp vpnv4 unicast all BGP table version is 58, local router ID is 10.0.1.3 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(屡O) AS 65001 AS 65002 ASBR4 PE3 Ryu BGP1 Ryu BGP2 AS 65011(O) CE5 Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found ! Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 65010:101 (default for vrf customerA) * i 10.10.10.1/32 192.168.101.101 100 0 65010 65001 ? * i 10.10.10.2/32 192.168.101.101 100 0 65010 65002 ? *> 10.10.10.3/32 192.168.3.2 0 32768 ? *>i 10.10.10.4/32 10.0.1.1 100 0 ? *>i 10.10.10.5/32 10.0.1.2 100 0 ? * i 192.168.1.0/30 192.168.101.101 100 0 65010 ? * i 192.168.2.0/30 192.168.101.101 100 0 65010 ? *> 192.168.3.0/30 0.0.0.0 0 32768 ? *>i 192.168.4.0/30 10.0.1.1 100 0 ? *>i 192.168.5.0/30 10.0.1.2 100 0 ? * i 192.168.201.0 192.168.101.101 100 0 65010 65001 i * i 192.168.202.0 192.168.101.101 100 0 65010 65002 i *> 192.168.203.0 192.168.3.2 0 32768 ? *>i 192.168.204.0/30 10.0.1.1 100 0 ? *>i 192.168.205.0/30 10.0.1.2 100 0 ? PE3# AS65010箸派撹し たU揃秤鵑臨釼mパスが 燕幣されない 20 AS65010から鞭佚した U揃秤鵑して、 LoopBackアドレスへ のきQえが佩われてい ない
  • 21. わかったこと、 > F粁AのRyu BGPは、i-BGPピアにvわるC嬬塘笋砲  m喘が是yそうだと湖じた。 > F粁AのRyu BGPは、BGPピアのK極泣への塘笋  念戻としたC嬬醤笋なされている。 > BGPピアの嶄@泣に塘笋垢栽には、BGPパラメ`タ  の三瓩哩vわる藻吭泣を覿┐垢覬慴がある。 > OSPFル`ティングドメイン吉とのB亊については、  聞い返が徭念で笋垢覬慴がある。  -> NextHopへの欺_來への鬉e余駅勣  -> デ`タプレ`ンB亊にvわる鬉e余駅勣  ちなみに、書指は、すべて床議ル`ティングO協を並念に  佩うことで鬉靴拭