このページの内容
BGP自動検出ネイバー
BGP自動検出ネイバーについて
BGP自動検出ネイバーを使用して、リモートまたはローカルのネイバーIPアドレスを指定するのではなく、インターフェイスごとにBGPピアリングを設定します。
ルーター間で BGP セッションを確立するには、BGP グループとピアをアドレス別に明示的に設定する必要があります。BGP ピアリング セッションでは、TCP 通信のエンドポイントの送信元と宛先の IP アドレスを特定する必要があります。そのため、これらのアドレスを明示的に設定することは、ネットワークのスケールアウトの障害となり、誤設定の機会となります。
BGP設定を効率化するため、BGPからピアごとのアドレスを設定する必要がなくなりました。BGP自動検出ネイバーを使用して、リモートまたはローカルのネイバーIPアドレスを指定するのではなく、インターフェイスごとにBGPピアリングを設定します。これには、TCPピアリングセッションで使用するIPアドレスを検出するための暗黙的またはプロトコルメカニズムの使用が含まれます。
ピアリングの動作とアドレスの使用は、設定またはアドレスの有効性(IPv6重複アドレス検出(DAD)など)によるインターフェイスアドレスの変更に基づくピアリングの変更を回避するために明示的に設定する必要があります。
BGPは、設定に基づいてピアオーバーするアドレスファミリーを決定します。ピアリングセッションは、決定されたファミリーのインターフェイスアドレスの可用性に基づいて起動します。ピアリンクローカルアドレスは、IPv6ネイバーディスカバリー(RFC4861)を使用して検出され、そのネイバーに向けてBGPセッションを作成します。IPv6インターフェイスにアドレスが設定されていない場合でも、リンクローカルアドレスが生成されます。
この機能を有効にするには、IPv6ネイバー検出を有効にする必要があります。
BGP自動検出ネイバーのメリット
-
シングルホップの外部 BGP(EBGP)への IGP 導入を簡素化
-
IPアドレスではなく、インターフェイスとインターフェイス範囲でネイバーを設定します
-
動的ネイバーグループにより、両側の設定を最小化
制限事項
この機能には以下の制限があります。
-
スコープ付き BGP リンクローカルアドレスは、現在、許可ネイバー範囲をサポートしていません。
-
BGP自動検出ネイバー機能は、IBGPまたはマルチホップEBGPをサポートしていません。
-
BGP自動検出ネイバーは、特定のインターフェイス上の複数のリモートネイバーとの検出またはピアリングをサポートしていません。
例:BGP自動検出ネイバーの設定
この例では、BGP自動検出ネイバーを設定する方法を示します。
概要
Junos OSリリース21.1R1以降、IPv6ネイバーディスカバリプロトコル(ND)を使用したBGP自動検出ネイバーがサポートされています。この機能により、BGPは直接接続されたネイバールーターのリンクローカルIPv6アドレスを使用してピアネイバーセッションを作成できます。リモートまたはローカルのネイバーIPアドレスを指定する必要はありません。
トポロジー
次の図は、簡略化されたサンプルトポロジーを示しています。
要件
この例では、以下のハードウェアおよびソフトウェアコンポーネントを使用しています。
MXシリーズルーター
Junos OSリリース21.1R1以降
エンドホストサーバーを表すVM1とVM2
設定
CLIクイックコンフィグレーション
この例をすばやく設定するには、以下のコマンドをコピーしてテキストファイルに貼り付け、改行を削除して、ネットワーク構成に合わせて必要な詳細を変更し、[edit]階層レベルのCLIにコマンドをコピー&ペーストします。
VM1
set interfaces interface-range tor-to-leaf member ge-0/0/4 set interfaces interface-range tor-to-leaf unit 0 family inet6 set interfaces ge-0/0/4 unit 0 family inet address 192.168.1.1/24 set interfaces lo0 unit 0 family inet address 192.168.30.1/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:70::1/128 set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement lb then load-balance per-packet set policy-options as-list a-list members 1-65535 set routing-options autonomous-system 64500 set routing-options forwarding-table export lb set routing-options forwarding-table ecmp-fast-reroute set protocols router-advertisement interface tor-to-leaf set protocols bgp group autodisc family inet unicast extended-nexthop set protocols bgp group autodisc family inet6 unicast set protocols bgp group autodisc export DIRECT-RTS set protocols bgp group autodisc multipath multiple-as set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery family inet6 ipv6-nd set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery interface tor-to-leaf set protocols bgp group autodisc peer-as-list a-list set protocols bgp group to-leaf-v4 family inet unicast extended-nexthop set protocols bgp group to-leaf-v4 export DIRECT-RTS set protocols bgp group to-leaf-v4 local-as 64500 set protocols bgp group to-leaf-v4 neighbor 192.168.1.2 peer-as 64496
VM2
set interfaces interface-range tor-to-leaf member ge-0/0/4 set interfaces interface-range tor-to-leaf unit 0 family inet6 set interfaces ge-0/0/4 unit 0 family inet address 192.168.2.1/24 set interfaces lo0 unit 0 family inet address 192.168.30.2/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:60::1/128 set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement lb then load-balance per-packet set policy-options as-list a-list members 1-65535 set routing-options autonomous-system 64501 set routing-options forwarding-table export lb set routing-options forwarding-table ecmp-fast-reroute set protocols router-advertisement interface tor-to-leaf set protocols bgp group autodisc family inet unicast extended-nexthop set protocols bgp group autodisc family inet6 unicast set protocols bgp group autodisc export DIRECT-RTS set protocols bgp group autodisc multipath multiple-as set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery family inet6 ipv6-nd set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery interface tor-to-leaf set protocols bgp group autodisc peer-as-list a-list set protocols bgp group to-leaf-v4 family inet unicast extended-nexthop set protocols bgp group to-leaf-v4 export DIRECT-RTS set protocols bgp group to-leaf-v4 local-as 64501 set protocols bgp group to-leaf-v4 neighbor 192.168.2.2 peer-as 64497
リーフ1
set interfaces interface-range to-spine member "ge-0/0/[0-3]" set interfaces interface-range to-spine unit 0 family inet set interfaces interface-range to-spine unit 0 family inet6 set interfaces ge-0/0/4 unit 0 family inet address 192.168.1.2/24 set interfaces lo0 unit 0 family inet address 192.168.10.1/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:90::1/128 set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement lb then load-balance per-packet set policy-options as-list a-list members 1-65535 set routing-options autonomous-system 64496 set routing-options forwarding-table export lb set routing-options forwarding-table ecmp-fast-reroute set protocols router-advertisement interface to-spine max-advertisement-interval 9 set protocols router-advertisement interface to-spine min-advertisement-interval 3 set protocols bgp group autodisc family inet unicast extended-nexthop set protocols bgp group autodisc family inet6 unicast set protocols bgp group autodisc export DIRECT-RTS set protocols bgp group autodisc multipath multiple-as set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery family inet6 ipv6-nd set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery interface to-spine set protocols bgp group autodisc peer-as-list a-list set protocols bgp group to-crpd-v4 family inet unicast extended-nexthop set protocols bgp group to-crpd-v4 export DIRECT-RTS set protocols bgp group to-crpd-v4 neighbor 192.168.1.1 peer-as 64500
リーフ2
set interfaces interface-range to-spine member "ge-0/0/[0-3]" set interfaces interface-range to-spine unit 0 family inet set interfaces interface-range to-spine unit 0 family inet6 set interfaces ge-0/0/4 unit 0 family inet address 192.168.2.2/24 set interfaces lo0 unit 0 family inet address 192.168.10.2/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:90::2/128 set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement lb then load-balance per-packet set policy-options as-list a-list members 1-65535 set routing-options autonomous-system 64497 set routing-options forwarding-table export lb set routing-options forwarding-table ecmp-fast-reroute set protocols router-advertisement interface to-spine max-advertisement-interval 9 set protocols router-advertisement interface to-spine min-advertisement-interval 3 set protocols bgp group autodisc family inet unicast extended-nexthop set protocols bgp group autodisc family inet6 unicast set protocols bgp group autodisc export DIRECT-RTS set protocols bgp group autodisc multipath multiple-as set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery family inet6 ipv6-nd set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery interface to-spine set protocols bgp group autodisc peer-as-list a-list set protocols bgp group to-crpd-v4 family inet unicast extended-nexthop set protocols bgp group to-crpd-v4 export DIRECT-RTS set protocols bgp group to-crpd-v4 neighbor 192.168.2.1 peer-as 64501
スパイン1
set interfaces interface-range to-leaf member "ge-0/0/[0-3]" set interfaces interface-range to-leaf unit 0 family inet set interfaces interface-range to-leaf unit 0 family inet6 set interfaces lo0 unit 0 family inet address 192.168.20.1/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:80::1/128 set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement lb then load-balance per-packet set policy-options as-list a-list members 1-65535 set routing-options autonomous-system 64498 set routing-options forwarding-table export lb set routing-options forwarding-table ecmp-fast-reroute set protocols router-advertisement interface to-leaf max-advertisement-interval 9 set protocols router-advertisement interface to-leaf min-advertisement-interval 3 set protocols bgp group autodisc family inet unicast extended-nexthop set protocols bgp group autodisc family inet6 unicast set protocols bgp group autodisc export DIRECT-RTS set protocols bgp group autodisc multipath multiple-as set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery family inet6 ipv6-nd set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery interface to-leaf set protocols bgp group autodisc peer-as-list a-list
スパイン2
set interfaces interface-range to-leaf member "ge-0/0/[0-3]" set interfaces interface-range to-leaf unit 0 family inet set interfaces interface-range to-leaf unit 0 family inet6 set interfaces lo0 unit 0 family inet address 192.168.20.2/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:80::2/128 set policy-options policy-statement DIRECT-RTS from protocol direct set policy-options policy-statement DIRECT-RTS then accept set policy-options policy-statement lb then load-balance per-packet set policy-options as-list a-list members 1-65535 set routing-options autonomous-system 64499 set routing-options forwarding-table export lb set routing-options forwarding-table ecmp-fast-reroute set protocols router-advertisement interface to-leaf max-advertisement-interval 9 set protocols router-advertisement interface to-leaf min-advertisement-interval 3 set protocols bgp group autodisc family inet unicast extended-nexthop set protocols bgp group autodisc family inet6 unicast set protocols bgp group autodisc export DIRECT-RTS set protocols bgp group autodisc multipath multiple-as set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery family inet6 ipv6-nd set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery interface to-leaf set protocols bgp group autodisc peer-as-list a-list
VM1の設定
BGP自動検出ネイバーを設定するには、VM1で以下の手順を実行します。
デバイスインターフェイスを設定します。
user@VM1# set interfaces interface-range tor-to-leaf member ge-0/0/4 user@VM1# set interfaces interface-range tor-to-leaf unit 0 family inet6ループバックインターフェイスを作成し、IPアドレスを設定します。
user@VM1# set interfaces lo0 unit 0 family inet address 192.168.30.1/32 user@VM1# set interfaces lo0 unit 0 family inet6 address 2001:db8:70::1/128
ルーティングポリシーを有効にします。
user@VM1# set policy-options policy-statement DIRECT-RTS from protocol direct user@VM1# set policy-options policy-statement DIRECT-RTS then accept user@VM1# set policy-options policy-statement lb then load-balance per-packet user@VM1# set policy-options as-list a-list members 1-65535
自律システム(AS)番号を設定します
user@VM1# set routing-options autonomous-system 64500
パケットごとのポリシーを適用して、トラフィックとECMPのロードバランシングを有効にします。
user@VM1# set routing-options forwarding-table export lb user@VM1# set routing-options forwarding-table ecmp-fast-reroute
BGPを設定して、内部および外部のピアリングセッションを確立します。
autodiscとto-leaf-v4の2つのグループが設定されています。BGPグループautodiscは動的ピアリング(IPv6ピア)を使用したBGPセッション用でありBGPグループto-leaf-v4はVM1とリーフ1間の静的BGPセッション(IPv4ピア)用です。user@VM1# set protocols bgp group autodisc family inet unicast extended-nexthop user@VM1# set protocols bgp group autodisc family inet6 unicast user@VM1# set protocols bgp group autodisc export DIRECT-RTS user@VM1# set protocols bgp group autodisc multipath multiple-as user@VM1# set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery family inet6 ipv6-nd user@VM1# set protocols bgp group autodisc dynamic-neighbor ndp peer-auto-discovery interface tor-to-leaf user@VM1# set protocols bgp group autodisc peer-as-list a-list user@VM1# set protocols bgp group to-leaf-v4 family inet unicast extended-nexthop user@VM1# set protocols bgp group to-leaf-v4 export DIRECT-RTS user@VM1# set protocols bgp group to-leaf-v4 local-as 5 user@VM1# set protocols bgp group to-leaf-v4 neighbor 192.168.1.2 peer-as 1
デバイスの設定が完了したら、設定をコミットします。
user@VM1# commit
結果
設定モードから、show interfaces、show protocols、show policy-options、show routing-optionsコマンドを入力して、設定を確認します。出力に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
[edit]
user@VM1# show interfaces
interface-range tor-to-leaf {
member ge-0/0/4;
unit 0 {
family inet6;
}
}
ge-0/0/4 {
unit 0 {
family inet {
address 192.168.1.1/24;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.30.1/32;
}
family inet6 {
address 2001:db8:70::1/128;
}
}
}
[edit]
user@VM1# show protocols
router-advertisement {
interface tor-to-leaf;
}
bgp {
group autodisc {
family inet {
unicast {
extended-nexthop;
}
}
family inet6 {
unicast;
}
export DIRECT-RTS;
multipath {
multiple-as;
}
dynamic-neighbor ndp {
peer-auto-discovery {
family inet6 {
ipv6-nd;
}
interface tor-to-leaf;
}
}
peer-as-list a-list;
}
group to-leaf-v4 {
family inet {
unicast {
extended-nexthop;
}
}
export DIRECT-RTS;
local-as 64500;
neighbor 192.168.1.2 {
peer-as 64496;
}
}
}
[edit]
user@VM1# show policy-options
policy-statement DIRECT-RTS {
from protocol direct;
then accept;
}
policy-statement lb {
then {
load-balance per-packet;
}
}
as-list a-list members 1-65535;
[edit]
user@VM1# show policy-options
policy-statement DIRECT-RTS {
from protocol direct;
then accept;
}
policy-statement lb {
then {
load-balance per-packet;
}
}
as-list a-list members 1-65535;
[
edit]
user@VM1# show routing-options
autonomous-system 64500;
forwarding-table {
export lb;
ecmp-fast-reroute;
}
検証
設定が正常に機能していることを確認します。
自動検出されたネイバーの検証
目的
自動検出されたBGPネイバーを検証します。
アクション
動作モードから、 show bgp summary auto-discovered コマンドを実行します
リーフ1について
user@Leaf1> show bgp summary auto-discovered
Threading mode: BGP I/O
Default eBGP mode: advertise - accept, receive - accept
Groups: 2 Peers: 5 Down peers: 1
Auto-discovered peers: 4
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0
24 20 0 0 0 0
inet6.0
16 16 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
fe80::5668:a3ff:fe16:1049%ge-0/0/3.0 64499 194 195 0 1 1:25:18 Establ
inet.0: 5/6/6/0
inet6.0: 4/4/4/0
fe80::5668:a3ff:fe16:104c%ge-0/0/4.0 64499 193 195 0 1 1:25:18 Establ
inet.0: 5/6/6/0
inet6.0: 4/4/4/0
fe80::5668:a3ff:fe16:12c9%ge-0/0/1.0 64498 217 223 0 1 1:35:53 Establ
inet.0: 5/6/6/0
inet6.0: 4/4/4/0
fe80::5668:a3ff:fe16:12ce%ge-0/0/2.0 64498 218 223 0 1 1:35:57 Establ
inet.0: 5/6/6/0
inet6.0: 4/4/4/0
On Spine1
user@Spine1> show bgp summary auto-discovered
Threading mode: BGP I/O
Default eBGP mode: advertise - accept, receive - accept
Groups: 1 Peers: 4 Down peers: 0
Auto-discovered peers: 4
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0
24 20 0 0 0 0
inet6.0
16 16 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
fe80::5668:a3ff:fe16:2e7%ge-0/0/0.0 64496 245 237 0 0 1:45:19 Establ
inet.0: 5/6/6/0
inet6.0: 4/4/4/0
fe80::5668:a3ff:fe16:2f2%ge-0/0/1.0 64496 245 238 0 0 1:45:23 Establ
inet.0: 5/6/6/0
inet6.0: 4/4/4/0
fe80::5668:a3ff:fe16:e49%ge-0/0/2.0 64497 245 243 0 0 1:45:19 Establ
inet.0: 5/6/6/0
inet6.0: 4/4/4/0
fe80::5668:a3ff:fe16:e59%ge-0/0/3.0 64497 247 248 0 0 1:45:23 Establ
inet.0: 5/6/6/0
inet6.0: 4/4/4/0
意味
出力には、自動検出されたBGPネイバーの概要が表示されます。自動検出されたピアの数とその詳細を確認できます。
BGP自動検出ピアの検証
目的
自動検出されたBGPネイバーを検証します。
アクション
動作モードから、 show bgp neighbor auto-discovered コマンドを実行します。
リーフ1について
user@Leaf1> show bgp neighbor auto-discovered Peer: fe80::5668:a3ff:fe16:1049%ge-0/0/3.0+65265 AS 64499 Local: fe80::5668:a3ff:fe16:2f6%ge-0/0/3.0+179 AS 64496 Group: autodisc Routing-Instance: master Forwarding routing-instance: master Type: External State: Established Flags: <Sync PeerAsList AutoDiscoveredNdp> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ DIRECT-RTS ] Options: <AddressFamily Multipath Refresh> Options: <MultipathAs> Options: <GracefulShutdownRcv> Address families configured: inet-unicast inet6-unicast Holdtime: 90 Preference: 170 Graceful Shutdown Receiver local-preference: 0 Number of flaps: 1 Last flap event: RecvNotify Error: 'Cease' Sent: 0 Recv: 1 Peer ID: 128.49.102.24 Local ID: 128.49.102.139 Active Holdtime: 90 Keepalive Interval: 30 Group index: 2 Peer index: 2 SNMP index: 9 I/O Session Thread: bgpio-0 State: Enabled BFD: disabled, down Local Interface: ge-0/0/3.0 NLRI for restart configured on peer: inet-unicast inet6-unicast NLRI advertised by peer: inet-unicast inet6-unicast NLRI for this session: inet-unicast inet6-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality Restart flag received from the peer: Notification NLRI that restart is negotiated for: inet-unicast inet6-unicast NLRI of received end-of-rib markers: inet-unicast inet6-unicast NLRI of all end-of-rib markers sent: inet-unicast inet6-unicast ....................
On Spine1
user@Spine1> show bgp neighbor auto-discovered Peer: fe80::5668:a3ff:fe16:2e7%ge-0/0/0.0+60458 AS 64496 Local: fe80::5668:a3ff:fe16:12c9%ge-0/0/0.0+179 AS 64498 Group: autodisc Routing-Instance: master Forwarding routing-instance: master Type: External State: Established Flags: <Sync PeerAsList AutoDiscoveredNdp> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ DIRECT-RTS ] Options: <AddressFamily Multipath Refresh> Options: <MultipathAs> Options: <GracefulShutdownRcv> Address families configured: inet-unicast inet6-unicast Holdtime: 90 Preference: 170 Graceful Shutdown Receiver local-preference: 0 Number of flaps: 0 Peer ID: 128.49.102.139 Local ID: 128.49.103.129 Active Holdtime: 90 Keepalive Interval: 30 Group index: 1 Peer index: 3 SNMP index: 7 I/O Session Thread: bgpio-0 State: Enabled BFD: disabled, down Local Interface: ge-0/0/0.0 NLRI for restart configured on peer: inet-unicast inet6-unicast NLRI advertised by peer: inet-unicast inet6-unicast NLRI for this session: inet-unicast inet6-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality Restart flag received from the peer: Notification NLRI that restart is negotiated for: inet-unicast inet6-unicast NLRI of received end-of-rib markers: inet-unicast inet6-unicast NLRI of all end-of-rib markers sent: inet-unicast inet6-unicast Peer does not support LLGR Restarter functionality Peer supports 4 byte AS extension (peer-as 64496) Peer does not support Addpath NLRI that we support extended nexthop encoding for: inet-unicast NLRI that peer supports extended nexthop encoding for: inet-unicast Table inet.0 Bit: 20000 ....................
意味
出力には、自動検出された BGP ネイバーに関する情報が表示されます。