BGP for IPv6
前回がBGPだったので、このタイミングでIPv6もやってみた。
構成はR1→AS1、R2→AS2、R3→AS3、R4→AS4
R1のConfig(BGP部分のみ)
router bgp 1
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
neighbor 2000::FFFF remote-as 2
no neighbor 2000::FFFF activate ・・・①
no auto-summary
!
address-family ipv6
neighbor 2000::FFFF activate ・・・②
neighbor 2000::FFFF soft-reconfiguration inbound
network 2004::/64
exit-address-family
!
BGPでは、ルータコンフィグレーションモードでのネイバー指定は、
①IPv6アドレスで設定したとしても基本的にIPv4のルート情報を通知するために用いる模様。 なので、②address-familyモードでネイバーをactivateする必要があるっぽい。
show ipv6 routeでの結果
R1#sho ipv6 route
B 2003::/64 [20/0]
via FE80::2, FastEthernet0/0
#FE80::2はR2のリンクローカルアドレス
BGPはIPv4のみで、経験もそこまで多くなかったから色々ちょっと調べておこう。
とりあえずおわり
マルチホームの非トランジットでのBGP
今回BGPでマルチホーム接続をすることになったので、メモ
構成はこんな感じで、今回はR1を自ASとする。
R1→AS1、R2→AS2、R3→AS3、R4→AS4
何も考えずに適当にBGPのConfigを作るとたぶんこんな感じ。
R1#sho run | sec router bgp
router bgp 1
no synchronization
bgp log-neighbor-changes
network 10.1.1.1 mask 255.255.255.255
neighbor 192.168.1.254 remote-as 2
neighbor 192.168.1.254 soft-reconfiguration inbound
neighbor 192.168.2.254 remote-as 3
neighbor 192.168.2.254 soft-reconfiguration inbound
no auto-summary
R1#
そうすると、当然R2のルータにはR4のloop0への経路が分かる。
R2#sho ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.1/32 192.168.1.1 0 0 1 i
*> 10.1.2.1/32 192.168.1.1 0 1 3 4 i
R2#
今回はR1はマルチホーム接続だけど、非トランジットにしたいからR4の経路は流したくない。 なので、AS-pathを使う。
router bgp 1
no synchronization
bgp log-neighbor-changes
network 10.1.1.1 mask 255.255.255.255
neighbor 192.168.1.254 remote-as 2
neighbor 192.168.1.254 soft-reconfiguration inbound
neighbor 192.168.1.254 filter-list 1 out
neighbor 192.168.2.254 remote-as 3
neighbor 192.168.2.254 soft-reconfiguration inbound
neighbor 192.168.2.254 filter-list 1 out
no auto-summary
!
ip as-path access-list 1 permit ^$
再び、R2での確認
R2#show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.1/32 192.168.1.1 0 0 1 i
R2#
とりあえず確認おわり
・・・と思ったけど、prefix-listの方が楽な気がした。
router bgp 1
no synchronization
bgp log-neighbor-changes
network 10.1.1.1 mask 255.255.255.255
neighbor 192.168.1.254 remote-as 2
neighbor 192.168.1.254 soft-reconfiguration inbound
neighbor 192.168.1.254 prefix-list origin out
neighbor 192.168.2.254 remote-as 3
neighbor 192.168.2.254 soft-reconfiguration inbound
neighbor 192.168.2.254 prefix-list origin out
no auto-summary
!
ip prefix-list origin seq 5 permit 10.1.1.1/32
R2の結果は同じなので、略
正規表現に抵抗なければ気にはならないだろうけど、マルチホームで非トランジットってだけなら、逆にprefix-listの方が分かりやすい気がするな。
とりあえずおわり