VyOS における BGP の概要
このレッスンでは、VyOS 1.4.x/1.5 rolling release での BGP(Border Gateway Protocol)設定を解説します。BGP は大規模ネットワーク、ISP、マルチプロバイダー接続で標準的に使われる動的ルーティングプロトコルです。
1. BGP の基礎知識
- AS (Autonomous System): 自律システム。
- iBGP vs eBGP: iBGP(内部)、eBGP(外部ピアリング)。
- Path Selection: 最適経路を選択するルール。
2. BGP の基本設定
set protocols bgp 65001 parameters router-id 1.1.1.1
set protocols bgp 65001 neighbor 2.2.2.2 remote-as 65002
set protocols bgp 65001 neighbor 2.2.2.2 address-family ipv4-unicast
set protocols bgp 65001 network 192.168.10.0/24
set protocols bgp 65001 network 10.10.10.0/24
- Route-map、prefix-list、AS-path:
set policy prefix-list PL-OUT rule 10 action permit prefix 192.168.10.0/24
set policy route-map RM-OUT rule 10 action permit
set policy route-map RM-OUT rule 10 match ip address prefix-list PL-OUT
set protocols bgp 65001 neighbor 2.2.2.2 route-map export RM-OUT
set protocols bgp 65001 neighbor 2.2.2.2 as-path-prepend '65001 65001'
3. BGP Communities、Route Reflector、IPv6
set protocols bgp 65001 neighbor 3.3.3.3 remote-as 65001
set protocols bgp 65001 neighbor 3.3.3.3 route-reflector-client
set protocols bgp 65001 neighbor 2.2.2.2 address-family ipv6-unicast
set protocols bgp 65001 neighbor 2.2.2.2 extended-nexthop
set protocols bgp 65001 neighbor 2.2.2.2 soft-reconfiguration inbound
4. BGP 状態の確認
show ip bgp summary
show ip bgp
show ip bgp neighbors
5. ネットワーク構成例
+---------+ +---------+
| VyOS 1 |-----| VyOS 2 |
| AS65001| | AS65002|
+---------+ +---------+
6. ハンズオンラボ: 2 AS 間 BGP Peering
- 異なる AS を持つ 2 台の VyOS に BGP を設定します。
- neighbor、route-map、prefix-list、as-path-prepend を設定します。
- 設定を commit / save します。
commit
save
- BGP 状態とルートを確認します。
show ip bgp summary
show ip bgp
7. まとめ
このレッスンで、VyOS 上の BGP 設定と、大規模・マルチプロバイダー環境における動的ルーティングポリシー制御の適用方法を理解できました。