SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Inter-AS環境におけるボーダールータとして 
Ryu BGP機能を試してみた 
2014.8.31 
@ttsubo 
1
試してみたいこと 
Ryu BGPを使ったポリシールーティングが 
どの程度、動作するのか? 
これまでの経緯は、 
こちらのブログ記事を参考にしてください 
http://ttsubo.hatenablog.com/entry/2014/08/16/000248 
2
まずは、実際のCiscoルータの挙動を確認してみました 
GNS3によるCisco 
エミュレータですけど 
3
■まずは、目標感 
-> InterAS MPLS VPNでのポリシールーティングの動作確認 
通常時は、AS間のトラフィックを片側リンクに寄せたい 
AS間での故障時は、もう片側のリンクに迂回させたい 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(増設) CE5 
LocalPreference 
で制御 
MED 
で制御 
LocalPreference 
で制御 
4 ポリシールーティング実現方法
■検証構成 
-> InterAS MPLS VPNにおける各BGPルータでのBGPテーブルを 
 確認してみる 
eBGP 
eBGP 
Static経路 
Static経路 
Static経路 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(増設) 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(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(増設) 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(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(増設) 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(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(増設) 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(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(増設) 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(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
ASBR1 
ASBR2 
AS 65011(増設) CE5 
10
つぎに、ASBRにRyuBGPを適用した場合、 
BGPの挙動を確認してみました 
11
■Ryu BGPを適用した検証構成 
-> AS:65011のボーダールータとしてRyu BGPを配意してみる。 
通常時は、AS間のトラフィックを片側リンクに寄せたい 
AS間での故障時は、もう片側のリンクに迂回させたい 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
Ryu BGP1 
Ryu BGP2 
AS 65011(増設) CE5 
MED 
で制御 
LocalPreference 
で制御 
LocalPreference 
で制御 
ポリシールーティング実現方法 
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
■BGP経路構成(Ryu BGP起動後) 
eBGP 
eBGP 
Ryu BGP1 
Ryu BGP2 
Static経路 
Static経路 
Static経路 
PE1 P1 
PE2 
P2 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(既設) 
AS 65001 
AS 65002 
ASBR4 
Ryu BGP1 
Ryu BGP2 
PE3 
15 AS 65011(増設) 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(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
Ryu BGP1 
Ryu BGP2 
AS 65011(増設) 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で生成した経路情報 
に限り、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で生成した経路情報 
に限り、MED値が表示さ 
れない 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
AS 65011(増設) 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(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
AS 65011(増設) 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側で生成した経路情報を、i-BGP経由 
で受信した場合には、MED値が表示されない 
ASBR3 
CE4 
CE3 
CE1 
CE2 
RR 
AS 65010(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
Ryu BGP1 
Ryu BGP2 
AS 65011(増設) 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(既設) 
AS 65001 
AS 65002 
ASBR4 
PE3 
Ryu BGP1 
Ryu BGP2 
AS 65011(増設) 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側で生成し 
た経路情報の最適パスが 
表示されない 
20 
AS65010から受信した 
経路情報に対して、 
LoopBackアドレスへ 
の書き換えが行われてい 
ない
わかったこと、 
> 現段階のRyu BGPは、i-BGPピアに関わる機能配備には 
 適用が困難そうだと感じた。 
> 現段階のRyu BGPは、BGPピアの終端点への配備を 
 前提とした機能具備がなされている。 
> BGPピアの中継点に配備する場合には、BGPパラメータ 
 の伝搬に関わる留意点を想定する必要がある。 
> OSPFルーティングドメイン等との連携については、 
 使い手が自前で準備する必要がある。 
 -> NextHopへの到達性への対応も別途必要 
 -> データプレーン連携に関わる対応も別途必要 
 ちなみに、今回は、すべて静的ルーティング設定を事前に 
 行うことで対応した。

Weitere ähnliche Inhalte

Was ist angesagt?

Proyecto: Rehabilitación de un rack de comunicaciones - Práctica OSPF vs RIPv2
Proyecto: Rehabilitación de un rack de comunicaciones - Práctica OSPF vs RIPv2Proyecto: Rehabilitación de un rack de comunicaciones - Práctica OSPF vs RIPv2
Proyecto: Rehabilitación de un rack de comunicaciones - Práctica OSPF vs RIPv2
Francesc Perez
 
Semana 5-redes
Semana 5-redesSemana 5-redes
Semana 5-redes
Taringa!
 
Sesion 7 - 1
Sesion 7 - 1Sesion 7 - 1
Sesion 7 - 1
Taringa!
 

Was ist angesagt? (16)

Proyecto: Rehabilitación de un rack de comunicaciones - Práctica OSPF vs RIPv2
Proyecto: Rehabilitación de un rack de comunicaciones - Práctica OSPF vs RIPv2Proyecto: Rehabilitación de un rack de comunicaciones - Práctica OSPF vs RIPv2
Proyecto: Rehabilitación de un rack de comunicaciones - Práctica OSPF vs RIPv2
 
Configuraciones examen 3
Configuraciones examen 3Configuraciones examen 3
Configuraciones examen 3
 
Semana 5-redes
Semana 5-redesSemana 5-redes
Semana 5-redes
 
Configuracion de los router clase 04 agosto.ppt
Configuracion de los router clase 04 agosto.pptConfiguracion de los router clase 04 agosto.ppt
Configuracion de los router clase 04 agosto.ppt
 
Teknik Hacking untuk pemula
Teknik Hacking untuk pemulaTeknik Hacking untuk pemula
Teknik Hacking untuk pemula
 
Placar UOL: Copa do Mundo e Eleições ao vivo com Node.js e WebSockets
Placar UOL: Copa do Mundo e Eleições ao vivo com Node.js e WebSocketsPlacar UOL: Copa do Mundo e Eleições ao vivo com Node.js e WebSockets
Placar UOL: Copa do Mundo e Eleições ao vivo com Node.js e WebSockets
 
Tugas e learning2 jarkom3 - Dynamic Routing (RIP)
Tugas e learning2 jarkom3 - Dynamic Routing (RIP)Tugas e learning2 jarkom3 - Dynamic Routing (RIP)
Tugas e learning2 jarkom3 - Dynamic Routing (RIP)
 
Configuracion rip en packet tracer
Configuracion rip en packet tracerConfiguracion rip en packet tracer
Configuracion rip en packet tracer
 
淺談編譯器最佳化技術
淺談編譯器最佳化技術淺談編譯器最佳化技術
淺談編譯器最佳化技術
 
Configuracion rip
Configuracion ripConfiguracion rip
Configuracion rip
 
Sesion 7 - 1
Sesion 7 - 1Sesion 7 - 1
Sesion 7 - 1
 
Ep3 ff994
Ep3 ff994Ep3 ff994
Ep3 ff994
 
Dobrica Pavlinušić - Rest (IT Showoff)
Dobrica Pavlinušić - Rest (IT Showoff)Dobrica Pavlinušić - Rest (IT Showoff)
Dobrica Pavlinušić - Rest (IT Showoff)
 
Tugas e learning1 jarkom3 - Static Routing
Tugas e learning1 jarkom3 - Static RoutingTugas e learning1 jarkom3 - Static Routing
Tugas e learning1 jarkom3 - Static Routing
 
6 - Custom Mininet Topology Experiment by Dwina Fitriyandini Siswanto & Siti ...
6 - Custom Mininet Topology Experiment by Dwina Fitriyandini Siswanto & Siti ...6 - Custom Mininet Topology Experiment by Dwina Fitriyandini Siswanto & Siti ...
6 - Custom Mininet Topology Experiment by Dwina Fitriyandini Siswanto & Siti ...
 
Cn lab
Cn labCn lab
Cn lab
 

Mehr von Toshiki Tsuboi

SDN Lab環境でのRobotFramework実践活用
SDN Lab環境でのRobotFramework実践活用SDN Lab環境でのRobotFramework実践活用
SDN Lab環境でのRobotFramework実践活用
Toshiki Tsuboi
 
BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料
Toshiki Tsuboi
 

Mehr von Toshiki Tsuboi (15)

GoBGP活用によるSD-WANプラクティス
GoBGP活用によるSD-WANプラクティスGoBGP活用によるSD-WANプラクティス
GoBGP活用によるSD-WANプラクティス
 
SDNアプローチによるBGP経路監視の提案
SDNアプローチによるBGP経路監視の提案SDNアプローチによるBGP経路監視の提案
SDNアプローチによるBGP経路監視の提案
 
BMP活用による SDN時代のオーバレイNW監視手法の提案
BMP活用による SDN時代のオーバレイNW監視手法の提案BMP活用による SDN時代のオーバレイNW監視手法の提案
BMP活用による SDN時代のオーバレイNW監視手法の提案
 
SDN Lab環境でのRobotFramework実践活用
SDN Lab環境でのRobotFramework実践活用SDN Lab環境でのRobotFramework実践活用
SDN Lab環境でのRobotFramework実践活用
 
BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料
 
RyuBGPSpeakerを活用したOpenFlow簡易ルータを試してみた
RyuBGPSpeakerを活用したOpenFlow簡易ルータを試してみたRyuBGPSpeakerを活用したOpenFlow簡易ルータを試してみた
RyuBGPSpeakerを活用したOpenFlow簡易ルータを試してみた
 
Technical report for IPv6 Routing w/ bgp4+ (part2)
Technical report for IPv6 Routing w/ bgp4+ (part2)Technical report for IPv6 Routing w/ bgp4+ (part2)
Technical report for IPv6 Routing w/ bgp4+ (part2)
 
Technical report for IPv6 Routing w/ bgp4+
Technical report for IPv6 Routing w/ bgp4+Technical report for IPv6 Routing w/ bgp4+
Technical report for IPv6 Routing w/ bgp4+
 
OpenFlow in Raspberry Pi
OpenFlow in Raspberry PiOpenFlow in Raspberry Pi
OpenFlow in Raspberry Pi
 
Evaluation of OpenFlow in RB750GL
Evaluation of OpenFlow in RB750GLEvaluation of OpenFlow in RB750GL
Evaluation of OpenFlow in RB750GL
 
RouterBOARD with OpenFlow
RouterBOARD with OpenFlowRouterBOARD with OpenFlow
RouterBOARD with OpenFlow
 
Echo server implementation for Python
Echo server implementation for PythonEcho server implementation for Python
Echo server implementation for Python
 
OpenStack with OpenFlow
OpenStack with OpenFlowOpenStack with OpenFlow
OpenStack with OpenFlow
 
OpenFlow Group Table
OpenFlow Group TableOpenFlow Group Table
OpenFlow Group Table
 
TremaDay #2
TremaDay #2TremaDay #2
TremaDay #2
 

InterAS MPLS-VPN with RyuBgp

  • 2. 試してみたいこと Ryu BGPを使ったポリシールーティングが どの程度、動作するのか? これまでの経緯は、 こちらのブログ記事を参考にしてください http://ttsubo.hatenablog.com/entry/2014/08/16/000248 2
  • 4. ■まずは、目標感 -> InterAS MPLS VPNでのポリシールーティングの動作確認 通常時は、AS間のトラフィックを片側リンクに寄せたい AS間での故障時は、もう片側のリンクに迂回させたい PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(既設) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(増設) CE5 LocalPreference で制御 MED で制御 LocalPreference で制御 4 ポリシールーティング実現方法
  • 5. ■検証構成 -> InterAS MPLS VPNにおける各BGPルータでのBGPテーブルを  確認してみる eBGP eBGP Static経路 Static経路 Static経路 PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(既設) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(増設) 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(既設) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(増設) 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(既設) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(増設) 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(既設) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(増設) 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(既設) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(増設) 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(既設) AS 65001 AS 65002 ASBR4 PE3 ASBR1 ASBR2 AS 65011(増設) CE5 10
  • 12. ■Ryu BGPを適用した検証構成 -> AS:65011のボーダールータとしてRyu BGPを配意してみる。 通常時は、AS間のトラフィックを片側リンクに寄せたい AS間での故障時は、もう片側のリンクに迂回させたい PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(既設) AS 65001 AS 65002 ASBR4 PE3 Ryu BGP1 Ryu BGP2 AS 65011(増設) CE5 MED で制御 LocalPreference で制御 LocalPreference で制御 ポリシールーティング実現方法 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. ■BGP経路構成(Ryu BGP起動後) eBGP eBGP Ryu BGP1 Ryu BGP2 Static経路 Static経路 Static経路 PE1 P1 PE2 P2 ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(既設) AS 65001 AS 65002 ASBR4 Ryu BGP1 Ryu BGP2 PE3 15 AS 65011(増設) 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(既設) AS 65001 AS 65002 ASBR4 PE3 Ryu BGP1 Ryu BGP2 AS 65011(増設) 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で生成した経路情報 に限り、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で生成した経路情報 に限り、MED値が表示さ れない CE4 CE3 CE1 CE2 RR AS 65010(既設) AS 65001 AS 65002 ASBR4 PE3 AS 65011(増設) 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(既設) AS 65001 AS 65002 ASBR4 PE3 AS 65011(増設) 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側で生成した経路情報を、i-BGP経由 で受信した場合には、MED値が表示されない ASBR3 CE4 CE3 CE1 CE2 RR AS 65010(既設) AS 65001 AS 65002 ASBR4 PE3 Ryu BGP1 Ryu BGP2 AS 65011(増設) 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(既設) AS 65001 AS 65002 ASBR4 PE3 Ryu BGP1 Ryu BGP2 AS 65011(増設) 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側で生成し た経路情報の最適パスが 表示されない 20 AS65010から受信した 経路情報に対して、 LoopBackアドレスへ の書き換えが行われてい ない
  • 21. わかったこと、 > 現段階のRyu BGPは、i-BGPピアに関わる機能配備には  適用が困難そうだと感じた。 > 現段階のRyu BGPは、BGPピアの終端点への配備を  前提とした機能具備がなされている。 > BGPピアの中継点に配備する場合には、BGPパラメータ  の伝搬に関わる留意点を想定する必要がある。 > OSPFルーティングドメイン等との連携については、  使い手が自前で準備する必要がある。  -> NextHopへの到達性への対応も別途必要  -> データプレーン連携に関わる対応も別途必要  ちなみに、今回は、すべて静的ルーティング設定を事前に  行うことで対応した。