BGP系统上的管理
通过逻辑系统,可配置内部BGP会话。有关详细信息,请参阅以下主题:
示例:在BGP系统上配置内部对等互连会话
此示例说明了如何在逻辑BGP 对等体上配置内部会话。
要求
此示例不需要除设备初始化之外的特殊配置。
概述
此示例将配置内部BGP (IBGP) 对等会话。
在样例网络中,第 17 AS中的设备在组 内部对等方中完全网状化。这些设备具有环路地址 192.168.6.5、192.163.6.4 和 192.168.40.4。
图 1 显示了具有内部对等会话的典型网络。

配置
CLI快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以匹配网络配置,然后将命令复制并粘贴到 层次结构级别的 CLI 中。 [edit]
set logical-systems A interfaces lt-0/1/0 unit 1 description to-B set logical-systems A interfaces lt-0/1/0 unit 1 encapsulation ethernet set logical-systems A interfaces lt-0/1/0 unit 1 peer-unit 2 set logical-systems A interfaces lt-0/1/0 unit 1 family inet address 10.10.10.1/30 set logical-systems A interfaces lo0 unit 1 family inet address 192.168.6.5/32 set logical-systems A protocols bgp group internal-peers type internal set logical-systems A protocols bgp group internal-peers local-address 192.168.6.5 set logical-systems A protocols bgp group internal-peers export send-direct set logical-systems A protocols bgp group internal-peers neighbor 192.163.6.4 set logical-systems A protocols bgp group internal-peers neighbor 192.168.40.4 set logical-systems A protocols ospf area 0.0.0.0 interface lo0.1 passive set logical-systems A protocols ospf area 0.0.0.0 interface lt-0/1/0.1 set logical-systems A policy-options policy-statement send-direct term 2 from protocol direct set logical-systems A policy-options policy-statement send-direct term 2 then accept set logical-systems A routing-options router-id 192.168.6.5 set logical-systems A routing-options autonomous-system 17 set logical-systems B interfaces lt-0/1/0 unit 2 description to-A set logical-systems B interfaces lt-0/1/0 unit 2 encapsulation ethernet set logical-systems B interfaces lt-0/1/0 unit 2 peer-unit 1 set logical-systems B interfaces lt-0/1/0 unit 2 family inet address 10.10.10.2/30 set logical-systems B interfaces lt-0/1/0 unit 5 description to-C set logical-systems B interfaces lt-0/1/0 unit 5 encapsulation ethernet set logical-systems B interfaces lt-0/1/0 unit 5 peer-unit 6 set logical-systems B interfaces lt-0/1/0 unit 5 family inet address 10.10.10.5/30 set logical-systems B interfaces lo0 unit 2 family inet address 192.163.6.4/32 set logical-systems B protocols bgp group internal-peers type internal set logical-systems B protocols bgp group internal-peers local-address 192.163.6.4 set logical-systems B protocols bgp group internal-peers export send-direct set logical-systems B protocols bgp group internal-peers neighbor 192.168.40.4 set logical-systems B protocols bgp group internal-peers neighbor 192.168.6.5 set logical-systems B protocols ospf area 0.0.0.0 interface lo0.2 passive set logical-systems B protocols ospf area 0.0.0.0 interface lt-0/1/0.2 set logical-systems B protocols ospf area 0.0.0.0 interface lt-0/1/0.5 set logical-systems B policy-options policy-statement send-direct term 2 from protocol direct set logical-systems B policy-options policy-statement send-direct term 2 then accept set logical-systems B routing-options router-id 192.163.6.4 set logical-systems B routing-options autonomous-system 17 set logical-systems C interfaces lt-0/1/0 unit 6 description to-B set logical-systems C interfaces lt-0/1/0 unit 6 encapsulation ethernet set logical-systems C interfaces lt-0/1/0 unit 6 peer-unit 5 set logical-systems C interfaces lt-0/1/0 unit 6 family inet address 10.10.10.6/30 set logical-systems C interfaces lo0 unit 3 family inet address 192.168.40.4/32 set logical-systems C protocols bgp group internal-peers type internal set logical-systems C protocols bgp group internal-peers local-address 192.168.40.4 set logical-systems C protocols bgp group internal-peers export send-direct set logical-systems C protocols bgp group internal-peers neighbor 192.163.6.4 set logical-systems C protocols bgp group internal-peers neighbor 192.168.6.5 set logical-systems C protocols ospf area 0.0.0.0 interface lo0.3 passive set logical-systems C protocols ospf area 0.0.0.0 interface lt-0/1/0.6 set logical-systems C policy-options policy-statement send-direct term 2 from protocol direct set logical-systems C policy-options policy-statement send-direct term 2 then accept set logical-systems C routing-options router-id 192.168.40.4 set logical-systems C routing-options autonomous-system 17
设备 A
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 用户指南 中的 在配置模式下CLI 编辑器。
要配置BGP 对等体 A 上的内部安全会话:
配置接口。
[edit logical-systems A interfaces lt-0/1/0 unit 1] user@R1# set description to-B user@R1# set encapsulation ethernet user@R1# set peer-unit 2 user@R1# set family inet address 10.10.10.1/30 user@R1# set family inet address 192.168.6.5/32 user@R1# up user@R1# up [edit logical-systems A interfaces] user@R1# set lo0 unit 1 family inet address 192.168.6.5/32 user@R1# exit [edit] user@R1# edit logical-systems B interfaces lt-0/1/0 [edit logical-systems B interfaces lt-0/1/0] user@R1# set unit 2 description to-A user@R1# set unit 2 encapsulation ethernet user@R1# set unit 2 peer-unit 1 user@R1# set unit 2 family inet address 10.10.10.2/30 user@R1# set unit 5 description to-C user@R1# set unit 5 encapsulation ethernet user@R1# set unit 5 peer-unit 6 user@R1# set family inet address 10.10.10.5/30 user@R1# up [edit logical-systems B interfaces] user@R1# set lo0 unit 2 family inet address 192.163.6.4/32 user@R1# exit [edit] user@R1# edit logical-systems C interfaces lt-0/1/0 unit 6 [edit logical-systems C interfaces lt-0/1/0 unit 6] set description to-B set encapsulation ethernet set peer-unit 5 set family inet address 10.10.10.6/30 user@R1# up user@R1# up [edit logical-systems C interfaces] set lo0 unit 3 family inet address 192.168.40.4/32
配置 BGP。
在逻辑系统 A 上,即使逻辑系统 A 未直接连接到设备 C,也包括设备 B 和设备 C 的
neighbor
语句。[edit logical-systems A protocols bgp group internal-peers] user@R1# set type internal user@R1# set local-address 192.168.6.5 user@R1# set export send-direct user@R1# set neighbor 192.163.6.4 user@R1# set neighbor 192.168.40.4 [edit logical-systems B protocols bgp group internal-peers] user@R1# set type internal user@R1# set local-address 192.163.6.4 user@R1# set export send-direct user@R1# set neighbor 192.168.40.4 user@R1# set neighbor 192.168.6.5 [edit logical-systems C protocols bgp group internal-peers] user@R1# set type internal user@R1# set local-address 192.168.40.4 user@R1# set export send-direct user@R1# set neighbor 192.163.6.4 user@R1# set neighbor 192.168.6.5
配置OSPF。
[edit logical-systems A protocols ospf area 0.0.0.0] user@R1# set interface lo0.1 passive user@R1# set interface lt-0/1/0.1 [edit logical-systems A protocols ospf area 0.0.0.0] user@R1# set interface lo0.2 passive user@R1# set interface lt-0/1/0.2 user@R1# set interface lt-0/1/0.5 [edit logical-systems A protocols ospf area 0.0.0.0] user@R1# set interface lo0.3 passive user@R1# set interface lt-0/1/0.6
配置接受直接路由的策略。
此情景的其他有用选项可能是接受通过路由或本地路由OSPF路由。
[edit logical-systems A policy-options policy-statement send-direct term 2] user@R1# set from protocol direct user@R1# set then accept [edit logical-systems B policy-options policy-statement send-direct term 2] user@R1# set from protocol direct user@R1# set then accept [edit logical-systems C policy-options policy-statement send-direct term 2] user@R1# set from protocol direct user@R1# set then accept
配置路由器 ID 和自治系统 (AS) 编号。
[edit logical-systems A routing-options] user@R1# set router-id 192.168.6.5 user@R1# set autonomous-system 17 [edit logical-systems B routing-options] user@R1# set router-id 192.163.6.4 user@R1# set autonomous-system 17 [edit logical-systems C routing-options] user@R1# set router-id 192.168.40.4 user@R1# set autonomous-system 17
结果
在配置模式下,输入 命令以确认 show logical-systems
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明进行更正。
user@R1# show logical-systems A { interfaces { lt-0/1/0 { unit 1 { description to-B; encapsulation ethernet; peer-unit 2; family inet { address 10.10.10.1/30; } } } lo0 { unit 1 { family inet { address 192.168.6.5/32; } } } } protocols { bgp { group internal-peers { type internal; local-address 192.168.6.5; export send-direct; neighbor 192.163.6.4; neighbor 192.168.40.4; } } ospf { area 0.0.0.0 { interface lo0.1 { passive; } interface lt-0/1/0.1; } } } policy-options { policy-statement send-direct { term 2 { from protocol direct; then accept; } } } routing-options { router-id 192.168.6.5; autonomous-system 17; } } B { interfaces { lt-0/1/0 { unit 2 { description to-A; encapsulation ethernet; peer-unit 1; family inet { address 10.10.10.2/30; } } unit 5 { description to-C; encapsulation ethernet; peer-unit 6; family inet { address 10.10.10.5/30; } } } lo0 { unit 2 { family inet { address 192.163.6.4/32; } } } } protocols { bgp { group internal-peers { type internal; local-address 192.163.6.4; export send-direct; neighbor 192.168.40.4; neighbor 192.168.6.5; } } ospf { area 0.0.0.0 { interface lo0.2 { passive; } interface lt-0/1/0.2; interface lt-0/1/0.5; } } } policy-options { policy-statement send-direct { term 2 { from protocol direct; then accept; } } } routing-options { router-id 192.163.6.4; autonomous-system 17; } } C { interfaces { lt-0/1/0 { unit 6 { description to-B; encapsulation ethernet; peer-unit 5; family inet { address 10.10.10.6/30; } } } lo0 { unit 3 { family inet { address 192.168.40.4/32; } } } } protocols { bgp { group internal-peers { type internal; local-address 192.168.40.4; export send-direct; neighbor 192.163.6.4; neighbor 192.168.6.5; } } ospf { area 0.0.0.0 { interface lo0.3 { passive; } interface lt-0/1/0.6; } } } policy-options { policy-statement send-direct { term 2 { from protocol direct; then accept; } } } routing-options { router-id 192.168.40.4; autonomous-system 17; } }
如果完成设备配置,请在配置 模式下输入 commit 。
验证
确认配置工作正常。
验证BGP邻里
目的
验证BGP接口是否运行以及每个邻接BGP会话是否处于活动状态。
行动
在操作模式下,输入 show bgp neighbor
命令。
user@R1> show bgp neighbor logical-system A Peer: 192.163.6.4+179 AS 17 Local: 192.168.6.5+58852 AS 17 Type: Internal State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ send-direct ] Options: <Preference LocalAddress Refresh> Local Address: 192.168.6.5 Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 192.163.6.4 Local ID: 192.168.6.5 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 0 BFD: disabled, down NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Restart time configured on the peer: 120 Stale routes from peer are kept for: 300 Restart time requested by this peer: 120 NLRI that peer supports restart for: inet-unicast NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 17) Peer does not support Addpath Table inet.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 3 Accepted prefixes: 3 Suppressed due to damping: 0 Advertised prefixes: 2 Last traffic (seconds): Received 16 Sent 1 Checked 63 Input messages: Total 15713 Updates 4 Refreshes 0 Octets 298622 Output messages: Total 15690 Updates 2 Refreshes 0 Octets 298222 Output Queue[0]: 0 Peer: 192.168.40.4+179 AS 17 Local: 192.168.6.5+56466 AS 17 Type: Internal State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ send-direct ] Options: <Preference LocalAddress Refresh> Local Address: 192.168.6.5 Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 192.168.40.4 Local ID: 192.168.6.5 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 1 BFD: disabled, down NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Restart time configured on the peer: 120 Stale routes from peer are kept for: 300 Restart time requested by this peer: 120 NLRI that peer supports restart for: inet-unicast NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 17) Peer does not support Addpath Table inet.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 2 Accepted prefixes: 2 Suppressed due to damping: 0 Advertised prefixes: 2 Last traffic (seconds): Received 15 Sent 22 Checked 68 Input messages: Total 15688 Updates 2 Refreshes 0 Octets 298111 Output messages: Total 15688 Updates 2 Refreshes 0 Octets 298184 Output Queue[0]: 0
验证BGP组
目的
验证BGP组是否正确配置。
行动
在操作模式下,输入 show bgp group
命令。
user@A> show bgp group logical-system A Group Type: Internal AS: 17 Local AS: 17 Name: internal-peers Index: 0 Flags: <Export Eval> Export: [ send-direct ] Holdtime: 0 Total peers: 2 Established: 2 192.163.6.4+179 192.168.40.4+179 inet.0: 0/5/5/0 Groups: 1 Peers: 2 External: 0 Internal: 2 Down peers: 0 Flaps: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 5 0 0 0 0 0
验证BGP摘要信息
目的
验证BGP配置是否正确。
行动
在操作模式下,输入 show bgp summary
命令。
user@A> show bgp summary logical-system A Groups: 1 Peers: 2 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 5 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 192.163.6.4 17 15723 15700 0 0 4d 22:13:15 0/3/3/0 0/0/0/0 192.168.40.4 17 15698 15699 0 0 4d 22:13:11 0/2/2/0 0/0/0/0
验证是否已BGP路由安装在路由表中
目的
验证导出策略配置是否工作。
行动
在操作模式下,输入 show route protocol bgp
命令。
user@A> show route protocol bgp logical-system A inet.0: 7 destinations, 12 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.10.10.0/30 [BGP/170] 4d 11:05:55, localpref 100, from 192.163.6.4 AS path: I > to 10.10.10.2 via lt-0/1/0.1 10.10.10.4/30 [BGP/170] 4d 11:05:55, localpref 100, from 192.163.6.4 AS path: I > to 10.10.10.2 via lt-0/1/0.1 [BGP/170] 4d 11:03:10, localpref 100, from 192.168.40.4 AS path: I > to 10.10.10.2 via lt-0/1/0.1 192.163.6.4/32 [BGP/170] 4d 11:05:55, localpref 100, from 192.163.6.4 AS path: I > to 10.10.10.2 via lt-0/1/0.1 192.168.40.4/32 [BGP/170] 4d 11:03:10, localpref 100, from 192.168.40.4 AS path: I > to 10.10.10.2 via lt-0/1/0.1
示例:在BGP IPv6 接口的逻辑系统上配置外部连接
此示例演示如何在具有 IPv6 接口的逻辑系统上配置外部路由 (EBGP) BGP点对点对等会话。
要求
此示例不需要除设备初始化之外的特殊配置。
概述
Junos OS IPv6 地址支持 EBGP 对等会话。当在 语句中指定 IPv6 地址时,可以配置 IPv6 对等 neighbor
会话。此示例使用 EUI-64 生成自动应用于接口的 IPv6 地址。EUI-64 地址是一个 IPv6 地址,用于地址的接口标识符部分(后 64 位IEEE EUI-64 格式。
或者,您可以使用手动分配的 128 位 IPv6 地址配置 EBGP 会话。
如果为接口使用 128 位链路本地地址,则必须包含 local-interface
语句。此语句仅适用于 128 位 IPv6 链路本地地址,是配置 IPv6 EBGP 链路本地对等会话的必需配置。
使用链路本地地址配置 EBGP 对等互连仅适用于直接连接接口。不支持多hop对等互连。
接口启动后,您可以使用 命令查看接口上由 show interfaces terse
EUI-64 生成的 IPv6 地址。您必须在 BGP 语句中使用这些BGP neighbor
地址。此示例演示了完整的端到端过程。
此示例将帧中继接口封装应用于逻辑隧道 (lt) 接口。这是一项要求,因为在 lt 接口上配置 IPv6 地址时,仅支持帧中继封装。
图 2 显示了具有 BGP 对等体 会话的网络。在示例网络中,路由器 R1 配置了五个逻辑系统。自治系统 (AS) 中的设备 E 17 将BGP 对等体组称为外部 对等方。对等方 A、B 和 C 驻留在 AS 22 中。此示例显示了逻辑系统 A 和逻辑系统 E 上的逐步配置。
拓扑

配置
程序
CLI快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以匹配网络配置,将命令复制并粘贴到 层次结构级别的 CLI 中,然后从配置模式进入 。 [edit]
commit
设备 A
set logical-systems A interfaces lt-0/1/0 unit 1 description to-E set logical-systems A interfaces lt-0/1/0 unit 1 encapsulation frame-relay set logical-systems A interfaces lt-0/1/0 unit 1 dlci 1 set logical-systems A interfaces lt-0/1/0 unit 1 peer-unit 25 set logical-systems A interfaces lt-0/1/0 unit 1 family inet6 address 2001:db8:0:1::/64 eui-64 set logical-systems A interfaces lo0 unit 1 family inet6 address 2001:db8::1/128 set logical-systems A protocols bgp group external-peers type external set logical-systems A protocols bgp group external-peers peer-as 17 set logical-systems A protocols bgp group external-peers neighbor 2001:db8:0:1:2a0:a502:0:19da set logical-systems A routing-options router-id 172.16.1.1 set logical-systems A routing-options autonomous-system 22
设备 B
set logical-systems B interfaces lt-0/1/0 unit 6 description to-E set logical-systems B interfaces lt-0/1/0 unit 6 encapsulation frame-relay set logical-systems B interfaces lt-0/1/0 unit 6 dlci 6 set logical-systems B interfaces lt-0/1/0 unit 6 peer-unit 5 set logical-systems B interfaces lt-0/1/0 unit 6 family inet6 address 2001:db8:0:2::/64 eui-64 set logical-systems B interfaces lo0 unit 2 family inet6 address 2001:db8::2/128 set logical-systems B protocols bgp group external-peers type external set logical-systems B protocols bgp group external-peers peer-as 17 set logical-systems B protocols bgp group external-peers neighbor 2001:db8:0:2:2a0:a502:0:5da set logical-systems B routing-options router-id 172.16.2.2 set logical-systems B routing-options autonomous-system 22
设备 C
set logical-systems C interfaces lt-0/1/0 unit 10 description to-E set logical-systems C interfaces lt-0/1/0 unit 10 encapsulation frame-relay set logical-systems C interfaces lt-0/1/0 unit 10 dlci 10 set logical-systems C interfaces lt-0/1/0 unit 10 peer-unit 9 set logical-systems C interfaces lt-0/1/0 unit 10 family inet6 address 2001:db8:0:3::/64 eui-64 set logical-systems C interfaces lo0 unit 3 family inet6 address 2001:db8::3/128 set logical-systems C protocols bgp group external-peers type external set logical-systems C protocols bgp group external-peers peer-as 17 set logical-systems C protocols bgp group external-peers neighbor 2001:db8:0:3:2a0:a502:0:9da set logical-systems C routing-options router-id 172.16.3.3 set logical-systems C routing-options autonomous-system 22
设备 D
set logical-systems D interfaces lt-0/1/0 unit 7 description to-E set logical-systems D interfaces lt-0/1/0 unit 7 encapsulation frame-relay set logical-systems D interfaces lt-0/1/0 unit 7 dlci 7 set logical-systems D interfaces lt-0/1/0 unit 7 peer-unit 21 set logical-systems D interfaces lt-0/1/0 unit 7 family inet6 address 2001:db8:0:4::/64 eui-64 set logical-systems D interfaces lo0 unit 4 family inet6 address 2001:db8::4/128 set logical-systems D protocols bgp group external-peers type external set logical-systems D protocols bgp group external-peers peer-as 17 set logical-systems D protocols bgp group external-peers neighbor 2001:db8:0:4:2a0:a502:0:15da set logical-systems D routing-options router-id 172.16.4.4 set logical-systems D routing-options autonomous-system 79
设备 E
set logical-systems E interfaces lt-0/1/0 unit 5 description to-B set logical-systems E interfaces lt-0/1/0 unit 5 encapsulation frame-relay set logical-systems E interfaces lt-0/1/0 unit 5 dlci 6 set logical-systems E interfaces lt-0/1/0 unit 5 peer-unit 6 set logical-systems E interfaces lt-0/1/0 unit 5 family inet6 address 2001:db8:0:2::/64 eui-64 set logical-systems E interfaces lt-0/1/0 unit 9 description to-C set logical-systems E interfaces lt-0/1/0 unit 9 encapsulation frame-relay set logical-systems E interfaces lt-0/1/0 unit 9 dlci 10 set logical-systems E interfaces lt-0/1/0 unit 9 peer-unit 10 set logical-systems E interfaces lt-0/1/0 unit 9 family inet6 address 2001:db8:0:3::/64 eui-64 set logical-systems E interfaces lt-0/1/0 unit 21 description to-D set logical-systems E interfaces lt-0/1/0 unit 21 encapsulation frame-relay set logical-systems E interfaces lt-0/1/0 unit 21 dlci 7 set logical-systems E interfaces lt-0/1/0 unit 21 peer-unit 7 set logical-systems E interfaces lt-0/1/0 unit 21 family inet6 address 2001:db8:0:4::/64 eui-64 set logical-systems E interfaces lt-0/1/0 unit 25 description to-A set logical-systems E interfaces lt-0/1/0 unit 25 encapsulation frame-relay set logical-systems E interfaces lt-0/1/0 unit 25 dlci 1 set logical-systems E interfaces lt-0/1/0 unit 25 peer-unit 1 set logical-systems E interfaces lt-0/1/0 unit 25 family inet6 address 2001:db8:0:1::/64 eui-64 set logical-systems E interfaces lo0 unit 5 family inet6 address 2001:db8::5/128 set logical-systems E protocols bgp group external-peers type external set logical-systems E protocols bgp group external-peers peer-as 22 set logical-systems E protocols bgp group external-peers neighbor 2001:db8:0:1:2a0:a502:0:1da set logical-systems E protocols bgp group external-peers neighbor 2001:db8:0:2:2a0:a502:0:6da set logical-systems E protocols bgp group external-peers neighbor 2001:db8:0:3:2a0:a502:0:ada set logical-systems E protocols bgp group external-peers neighbor 2001:db8:0:4:2a0:a502:0:7da peer-as 79 set logical-systems E routing-options router-id 172.16.5.5 set logical-systems E routing-options autonomous-system 17
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 用户指南 中的 在配置模式下使用 CLI编辑器。
要配置 BGP 对等体 会话:
运行
show interfaces terse
命令以验证物理路由器是否具有逻辑隧道 (lt) 接口。user@R1> show interfaces terse Interface Admin Link Proto Local Remote ... lt-0/1/0 up up ...
在逻辑系统 A 上,配置接口封装、对等方单元编号和 DLCI 以到达逻辑系统 E。
user@R1> set cli logical-system A Logical system: A [edit] user@R1:A> edit Entering configuration mode [edit] user@R1:A# edit interfaces [edit interfaces] user@R1:A# set lt-0/1/0 unit 1 encapsulation frame-relay user@R1:A# set lt-0/1/0 unit 1 dlci 1 user@R1:A# set lt-0/1/0 unit 1 peer-unit 25
在逻辑系统 A 上,配置到 Peer E 的链路的网络地址,以及配置环路接口。
[edit interfaces] user@R1:A# set lt-0/1/0 unit 1 description to-E user@R1:A# set lt-0/1/0 unit 1 family inet6 address 2001:db8:0:1::/64 eui-64 user@R1:A# set lo0 unit 1 family inet6 address 2001:db8::1/128
在逻辑系统 E 上,配置接口封装、对等方单元编号和 DLCI 以到达逻辑系统 A。
user@R1> set cli logical-system E Logical system: E [edit] user@R1:E> edit Entering configuration mode [edit] user@R1:E# edit interfaces [edit interfaces] user@R1:E# set lt-0/1/0 unit 25 encapsulation frame-relay user@R1:E# set lt-0/1/0 unit 25 dlci 1 user@R1:E# set lt-0/1/0 unit 25 peer-unit 1
在逻辑系统 E 上,配置到对等方 A 的链路的网络地址,并配置环路接口。
[edit interfaces] user@R1:E# set lt-0/1/0 unit 25 description to-A user@R1:E# set lt-0/1/0 unit 25 family inet6 address 2001:db8:0:1::/64 eui-64 user@R1:E# set lo0 unit 5 family inet6 address 2001:db8::5/128
运行
show interfaces terse
命令以查看 EUI-64 生成的 IPv6 地址。此示例在 BGP 语句中使用了 2001
neighbor
地址。注意:fe80 地址是链路本地地址,未在此例中使用。
user@R1:A> show interfaces terse Interface Admin Link Proto Local Remote Logical system: A betsy@tp8:A> show interfaces terse Interface Admin Link Proto Local Remote lt-0/1/0 lt-0/1/0.1 up up inet6 2001:db8:0:1:2a0:a502:0:1da/64 fe80::2a0:a502:0:1da/64 lo0 lo0.1 up up inet6 2001:db8::1 fe80::2a0:a50f:fc56:1da
user@R1:E> show interfaces terse Interface Admin Link Proto Local Remote lt-0/1/0 lt-0/1/0.25 up up inet6 2001:db8:0:1:2a0:a502:0:19da/64 fe80::2a0:a502:0:19da/64 lo0 lo0.5 up up inet6 2001:db8::5 fe80::2a0:a50f:fc56:1da
在其他逻辑系统上重复接口配置。
配置外部BGP会话
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 用户指南 中的 在配置模式下CLI 编辑器。
要配置BGP 对等体会话:
在逻辑系统 A 上,创建BGP组,然后添加外部邻接地址。
[edit protocols bgp group external-peers] user@R1:A# set neighbor 2001:db8:0:1:2a0:a502:0:19da
在逻辑系统 E 上,创建BGP组,然后添加外部邻接地址。
[edit protocols bgp group external-peers] user@R1:E# set neighbor 2001:db8:0:1:2a0:a502:0:1da
在逻辑系统 A 上,指定外部交换机的自治系统 (AS) AS。
[edit protocols bgp group external-peers] user@R1:A# set peer-as 17
在逻辑系统 E 上,指定外部交换机的自治系统 (AS) AS。
[edit protocols bgp group external-peers] user@R1:E# set peer-as 22
在逻辑系统 A 上,将对等类型设置为 EBGP。
[edit protocols bgp group external-peers] user@R1:A# set type external
在逻辑系统 E 上,将对等方类型设置为 EBGP。
[edit protocols bgp group external-peers] user@R1:E# set type external
在逻辑系统 A 上,设置自治系统 (AS) 编号和路由器 ID。
[edit routing-options] user@R1:A# set router-id 172.16.1.1 user@R1:A# set autonomous-system 22
在逻辑系统 E 上,设置AS编号和路由器 ID。
[edit routing-options] user@R1:E# set router-id 172.16.5.5 user@R1:E# set autonomous-system 17
对对等方 A、B、C 和 D 重复这些步骤。
结果
在配置模式下,输入 命令以确认 show logical-systems
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
[edit]
user@R1# show logical-systems
A {
interfaces {
lt-0/1/0 {
unit 1 {
description to-E;
encapsulation frame-relay;
dlci 1;
peer-unit 25;
family inet6 {
address 2001:db8:0:1::/64 {
eui-64;
}
}
}
}
lo0 {
unit 1 {
family inet6 {
address 2001:db8::1/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 17;
neighbor 2001:db8:0:1:2a0:a502:0:19da;
}
}
routing-options {
router-id 172.16.1.1;
autonomous-system 22;
}
}
B {
interfaces {
lt-0/1/0 {
unit 6 {
description to-E;
encapsulation frame-relay;
dlci 6;
peer-unit 5;
family inet6 {
address 2001:db8:0:2::/64 {
eui-64;
}
}
}
}
lo0 {
unit 2 {
family inet6 {
address 2001:db8::2/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 17;
neighbor 2001:db8:0:2:2a0:a502:0:5da;
}
}
routing-options {
router-id 172.16.2.2;
autonomous-system 22;
}
}
C {
interfaces {
lt-0/1/0 {
unit 10 {
description to-E;
encapsulation frame-relay;
dlci 10;
peer-unit 9;
family inet6 {
address 2001:db8:0:3::/64 {
eui-64;
}
}
}
}
lo0 {
unit 3 {
family inet6 {
address 2001:db8::3/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 17;
neighbor 2001:db8:0:3:2a0:a502:0:9da;
}
}
}
routing-options {
router-id 172.16.3.3;
autonomous-system 22;
}
}
D {
interfaces {
lt-0/1/0 {
unit 7 {
description to-E;
encapsulation frame-relay;
dlci 7;
peer-unit 21;
family inet6 {
address 2001:db8:0:4::/64 {
eui-64;
}
}
}
}
lo0 {
unit 4 {
family inet6 {
address 2001:db8::4/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 17;
neighbor 2001:db8:0:4:2a0:a502:0:15da;
}
}
routing-options {
router-id 172.16.4.4;
autonomous-system 79;
}
}
E {
interfaces {
lt-0/1/0 {
unit 5 {
description to-B;
encapsulation frame-relay;
dlci 6;
peer-unit 6;
family inet6 {
address 2001:db8:0:2::/64 {
eui-64;
}
}
}
unit 9 {
description to-C;
encapsulation frame-relay;
dlci 10;
peer-unit 10;
family inet6 {
address 2001:db8:0:3::/64 {
eui-64;
}
}
}
unit 21 {
description to-D;
encapsulation frame-relay;
dlci 7;
peer-unit 7;
family inet6 {
address 2001:db8:0:4::/64 {
eui-64;
}
}
}
unit 25 {
description to-A;
encapsulation frame-relay;
dlci 1;
peer-unit 1;
family inet6 {
address 2001:db8:0:1::/64 {
eui-64;
}
}
}
}
lo0 {
unit 5 {
family inet6 {
address 2001:db8::5/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 22;
neighbor 2001:db8:0:1:2a0:a502:0:1da;
neighbor 2001:db8:0:2:2a0:a502:0:6da;
neighbor 2001:db8:0:3:2a0:a502:0:ada;
neighbor 2001:db8:0:4:2a0:a502:0:7da {
peer-as 79;
}
}
}
}
routing-options {
router-id 172.16.5.5;
autonomous-system 17;
}
}
如果完成设备配置,请在配置 模式下输入 commit 。
验证
确认配置工作正常。
验证BGP邻居
目的
验证BGP接口是否运行以及每个邻接BGP会话是否处于活动状态。
行动
在操作模式下,运行 show bgp neighbor
命令。
user@R1:E> show bgp neighbor Peer: 2001:db8:0:1:2a0:a502:0:1da+54987 AS 22 Local: 2001:db8:0:1:2a0:a502:0:19da+179 AS 17 Type: External State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: Open Message Error Options: <Preference PeerAS Refresh> Holdtime: 90 Preference: 170 Number of flaps: 0 Error: 'Open Message Error' Sent: 20 Recv: 0 Peer ID: 172.16.1.1 Local ID: 172.16.5.5 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 0 BFD: disabled, down Local Interface: lt-0/1/0.25 NLRI for restart configured on peer: inet6-unicast NLRI advertised by peer: inet6-unicast NLRI for this session: inet6-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality NLRI that restart is negotiated for: inet6-unicast NLRI of received end-of-rib markers: inet6-unicast NLRI of all end-of-rib markers sent: inet6-unicast Peer supports 4 byte AS extension (peer-as 22) Peer does not support Addpath Table inet6.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 0 Accepted prefixes: 0 Suppressed due to damping: 0 Advertised prefixes: 0 Last traffic (seconds): Received 7 Sent 18 Checked 81 Input messages: Total 1611 Updates 1 Refreshes 0 Octets 30660 Output messages: Total 1594 Updates 0 Refreshes 0 Octets 30356 Output Queue[0]: 0 Peer: 2001:db8:0:2:2a0:a502:0:6da+179 AS 22 Local: 2001:db8:0:2:2a0:a502:0:5da+55502 AS 17 Type: External State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: Open Message Error Options: <Preference PeerAS Refresh> Holdtime: 90 Preference: 170 Number of flaps: 0 Error: 'Open Message Error' Sent: 26 Recv: 0 Peer ID: 172.16.2.2 Local ID: 172.16.5.5 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 2 BFD: disabled, down Local Interface: lt-0/1/0.5 NLRI for restart configured on peer: inet6-unicast NLRI advertised by peer: inet6-unicast NLRI for this session: inet6-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality NLRI that restart is negotiated for: inet6-unicast NLRI of received end-of-rib markers: inet6-unicast NLRI of all end-of-rib markers sent: inet6-unicast Peer supports 4 byte AS extension (peer-as 22) Peer does not support Addpath Table inet6.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 0 Accepted prefixes: 0 Suppressed due to damping: 0 Advertised prefixes: 0 Last traffic (seconds): Received 15 Sent 8 Checked 8 Input messages: Total 1610 Updates 1 Refreshes 0 Octets 30601 Output messages: Total 1645 Updates 0 Refreshes 0 Octets 32417 Output Queue[0]: 0 Peer: 2001:db8:0:3:2a0:a502:0:ada+55983 AS 22 Local: 2001:db8:0:3:2a0:a502:0:9da+179 AS 17 Type: External State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Options: <Preference PeerAS Refresh> Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 172.16.3.3 Local ID: 172.16.5.5 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 3 BFD: disabled, down Local Interface: lt-0/1/0.9 NLRI for restart configured on peer: inet6-unicast NLRI advertised by peer: inet6-unicast NLRI for this session: inet6-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality NLRI that restart is negotiated for: inet6-unicast NLRI of received end-of-rib markers: inet6-unicast NLRI of all end-of-rib markers sent: inet6-unicast Peer supports 4 byte AS extension (peer-as 22) Peer does not support Addpath Table inet6.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 0 Accepted prefixes: 0 Suppressed due to damping: 0 Advertised prefixes: 0 Last traffic (seconds): Received 21 Sent 21 Checked 67 Input messages: Total 1610 Updates 1 Refreshes 0 Octets 30641 Output messages: Total 1587 Updates 0 Refreshes 0 Octets 30223 Output Queue[0]: 0 Peer: 2001:db8:0:4:2a0:a502:0:7da+49255 AS 79 Local: 2001:db8:0:4:2a0:a502:0:15da+179 AS 17 Type: External State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Options: <Preference PeerAS Refresh> Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 172.16.4.4 Local ID: 172.16.5.5 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 1 BFD: disabled, down Local Interface: lt-0/1/0.21 NLRI for restart configured on peer: inet6-unicast NLRI advertised by peer: inet6-unicast NLRI for this session: inet6-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality NLRI that restart is negotiated for: inet6-unicast NLRI of received end-of-rib markers: inet6-unicast NLRI of all end-of-rib markers sent: inet6-unicast Peer supports 4 byte AS extension (peer-as 79) Peer does not support Addpath Table inet6.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 0 Accepted prefixes: 0 Suppressed due to damping: 0 Advertised prefixes: 0 Last traffic (seconds): Received 6 Sent 17 Checked 25 Input messages: Total 1615 Updates 1 Refreshes 0 Octets 30736 Output messages: Total 1593 Updates 0 Refreshes 0 Octets 30337 Output Queue[0]: 0
意义
IPv6 单播网络层可达性信息 (NLRI) 正在邻居之间交换。
验证BGP组
目的
验证BGP组是否正确配置。
行动
在操作模式下,运行 show bgp group
命令。
user@R1:E> show bgp group Group Type: External Local AS: 17 Name: external-peers Index: 0 Flags: <> Holdtime: 0 Total peers: 4 Established: 4 2001:db8:0:1:2a0:a502:0:1da+54987 2001:db8:0:2:2a0:a502:0:6da+179 2001:db8:0:3:2a0:a502:0:ada+55983 2001:db8:0:4:2a0:a502:0:7da+49255 inet6.0: 0/0/0/0 Groups: 1 Peers: 4 External: 4 Internal: 0 Down peers: 0 Flaps: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet6.0 0 0 0 0 0 0 inet6.2 0 0 0 0 0 0
意义
组类型为外部,组有四个对等方。
验证BGP摘要信息
目的
验证是否BGP 对等体关系。
行动
在操作模式下,运行 show bgp summary
命令。
user@R1:E> show bgp summary Groups: 1 Peers: 4 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet6.0 0 0 0 0 0 0 inet6.2 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 2001:db8:0:1:2a0:a502:0:1da 22 1617 1600 0 0 12:07:00 Establ inet6.0: 0/0/0/0 2001:db8:0:2:2a0:a502:0:6da 22 1616 1651 0 0 12:06:56 Establ inet6.0: 0/0/0/0 2001:db8:0:3:2a0:a502:0:ada 22 1617 1594 0 0 12:04:32 Establ inet6.0: 0/0/0/0 2001:db8:0:4:2a0:a502:0:7da 79 1621 1599 0 0 12:07:00 Establ inet6.0: 0/0/0/0
意义
Down 对等方: 0 输出显示该BGP对等方已建立状态。
检查路由表
目的
验证 inet6.0 路由表是否已填充本地和直接路由。
行动
在操作模式下,运行 show route
命令。
user@R1:E> show route inet6.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2001:db8::5/128 *[Direct/0] 12:41:18 > via lo0.5 2001:db8:0:1::/64 *[Direct/0] 14:40:01 > via lt-0/1/0.25 2001:db8:0:1:2a0:a502:0:19da/128 *[Local/0] 14:40:01 Local via lt-0/1/0.25 2001:db8:0:2::/64 *[Direct/0] 14:40:02 > via lt-0/1/0.5 2001:db8:0:2:2a0:a502:0:5da/128 *[Local/0] 14:40:02 Local via lt-0/1/0.5 2001:db8:0:3::/64 *[Direct/0] 14:40:02 > via lt-0/1/0.9 2001:db8:0:3:2a0:a502:0:9da/128 *[Local/0] 14:40:02 Local via lt-0/1/0.9 2001:db8:0:4::/64 *[Direct/0] 14:40:01 > via lt-0/1/0.21 2001:db8:0:4:2a0:a502:0:15da/128 *[Local/0] 14:40:01 Local via lt-0/1/0.21 fe80::/64 *[Direct/0] 14:40:02 > via lt-0/1/0.5 [Direct/0] 14:40:02 > via lt-0/1/0.9 [Direct/0] 14:40:01 > via lt-0/1/0.21 [Direct/0] 14:40:01 > via lt-0/1/0.25 fe80::2a0:a502:0:5da/128 *[Local/0] 14:40:02 Local via lt-0/1/0.5 fe80::2a0:a502:0:9da/128 *[Local/0] 14:40:02 Local via lt-0/1/0.9 fe80::2a0:a502:0:15da/128 *[Local/0] 14:40:01 Local via lt-0/1/0.21 fe80::2a0:a502:0:19da/128 *[Local/0] 14:40:01 Local via lt-0/1/0.25 fe80::2a0:a50f:fc56:1da/128 *[Direct/0] 12:41:18 > via lo0.5
意义
inet6.0 路由表包含本地和直接路由。要填充路由表的其他类型的路由,您必须配置路由策略。
示例:在内部或对等BGP上配置 BFD
此示例展示如何使用双向转发检测 (BFD) 协议BGP内部路由 (IBGP) 对等会话以检测网络故障。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
在 IBGP 会话上启用 BFD 的最低配置是,在参与 BFD 会话的所有邻BGP的配置中包括 bfd-liveness-detection minimum-interval
该语句。语句 minimum-interval
指定故障检测的最小传输和接收间隔。具体而言,此值表示本地路由设备在之后传输 hello 数据包的最小间隔,以及路由设备希望接收其已建立 BFD 会话的邻接方发送回复的最小间隔。您可以配置 1 到 255,000 毫秒的值。
或者,您也可使用 和 语句单独指定最小传输和接收 transmit-interval minimum-interval
minimum-receive-interval
间隔。有关这些语句和其他可选 BFD 配置语句的信息,请参阅 bfd-liveness-detection
。
BFD 是一种消耗系统资源的密集协议。为基于 路由引擎 的会话指定 BFD 小于 100 毫秒的最低间隔时间,对于分布式 BFD 会话指定不到 10 毫秒可能会导致 BFD 翻动。
根据您的网络环境,可能会应用以下其他建议:
为防止 BFD 在常规切换路由引擎翻动,请为基于该端口的会话指定最低 5000 毫秒路由引擎间隔。此最低值是必需的,因为路由引擎切换事件期间,RPD、MIBD 和 SNMPD 等进程占用 CPU 资源超过指定的阈值。因此,BFD 处理和计划因 CPU 资源缺乏而受到影响。
对于在双机箱群集控制链路情景中保持启用的 BFD 会话,当第一个控制链路出现故障时,请指定 6000 毫秒的最小间隔,以防止 LACP 在基于 路由引擎 的会话的辅助节点上翻动。
对于具有大量 BFD 会话的大型网络部署,请为基于 路由引擎 的会话指定最低 300 毫秒的间隔,为分布式 BFD 会话指定 100 毫秒。
对于具有大量 BFD 会话的大规模网络部署,请联系瞻博网络客户支持以了解更多信息。
对于配置了不间断活动路由 (NSR) 时在 路由引擎 切换事件期间保持开启的 BFD 会话,请为基于 路由引擎 的会话指定最低 2500 毫秒的间隔。对于配置了 NSR 的分布式 BFD 会话,不会更改最小间隔建议,并且仅取决于网络部署。
默认路由实例(主路由器)、路由实例和逻辑系统支持 BFD。此示例显示逻辑系统上 BFD。
图 3 显示了具有内部对等会话的典型网络。

配置
CLI快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以匹配网络配置,然后将命令复制并粘贴到 层次结构级别的 CLI 中 [edit]
。
设备 A
set logical-systems A interfaces lt-1/2/0 unit 1 description to-B set logical-systems A interfaces lt-1/2/0 unit 1 encapsulation ethernet set logical-systems A interfaces lt-1/2/0 unit 1 peer-unit 2 set logical-systems A interfaces lt-1/2/0 unit 1 family inet address 10.10.10.1/30 set logical-systems A interfaces lo0 unit 1 family inet address 192.168.6.5/32 set logical-systems A protocols bgp group internal-peers type internal set logical-systems A protocols bgp group internal-peers traceoptions file bgp-bfd set logical-systems A protocols bgp group internal-peers traceoptions flag bfd detail set logical-systems A protocols bgp group internal-peers local-address 192.168.6.5 set logical-systems A protocols bgp group internal-peers export send-direct set logical-systems A protocols bgp group internal-peers bfd-liveness-detection minimum-interval 1000 set logical-systems A protocols bgp group internal-peers neighbor 192.163.6.4 set logical-systems A protocols bgp group internal-peers neighbor 192.168.40.4 set logical-systems A protocols ospf area 0.0.0.0 interface lo0.1 passive set logical-systems A protocols ospf area 0.0.0.0 interface lt-1/2/0.1 set logical-systems A policy-options policy-statement send-direct term 2 from protocol direct set logical-systems A policy-options policy-statement send-direct term 2 then accept set logical-systems A routing-options router-id 192.168.6.5 set logical-systems A routing-options autonomous-system 17
设备 B
set logical-systems B interfaces lt-1/2/0 unit 2 description to-A set logical-systems B interfaces lt-1/2/0 unit 2 encapsulation ethernet set logical-systems B interfaces lt-1/2/0 unit 2 peer-unit 1 set logical-systems B interfaces lt-1/2/0 unit 2 family inet address 10.10.10.2/30 set logical-systems B interfaces lt-1/2/0 unit 5 description to-C set logical-systems B interfaces lt-1/2/0 unit 5 encapsulation ethernet set logical-systems B interfaces lt-1/2/0 unit 5 peer-unit 6 set logical-systems B interfaces lt-1/2/0 unit 5 family inet address 10.10.10.5/30 set logical-systems B interfaces lo0 unit 2 family inet address 192.163.6.4/32 set logical-systems B protocols bgp group internal-peers type internal set logical-systems B protocols bgp group internal-peers local-address 192.163.6.4 set logical-systems B protocols bgp group internal-peers export send-direct set logical-systems B protocols bgp group internal-peers bfd-liveness-detection minimum-interval 1000 set logical-systems B protocols bgp group internal-peers neighbor 192.168.40.4 set logical-systems B protocols bgp group internal-peers neighbor 192.168.6.5 set logical-systems B protocols ospf area 0.0.0.0 interface lo0.2 passive set logical-systems B protocols ospf area 0.0.0.0 interface lt-1/2/0.2 set logical-systems B protocols ospf area 0.0.0.0 interface lt-1/2/0.5 set logical-systems B policy-options policy-statement send-direct term 2 from protocol direct set logical-systems B policy-options policy-statement send-direct term 2 then accept set logical-systems B routing-options router-id 192.163.6.4 set logical-systems B routing-options autonomous-system 17
设备 C
set logical-systems C interfaces lt-1/2/0 unit 6 description to-B set logical-systems C interfaces lt-1/2/0 unit 6 encapsulation ethernet set logical-systems C interfaces lt-1/2/0 unit 6 peer-unit 5 set logical-systems C interfaces lt-1/2/0 unit 6 family inet address 10.10.10.6/30 set logical-systems C interfaces lo0 unit 3 family inet address 192.168.40.4/32 set logical-systems C protocols bgp group internal-peers type internal set logical-systems C protocols bgp group internal-peers local-address 192.168.40.4 set logical-systems C protocols bgp group internal-peers export send-direct set logical-systems C protocols bgp group internal-peers bfd-liveness-detection minimum-interval 1000 set logical-systems C protocols bgp group internal-peers neighbor 192.163.6.4 set logical-systems C protocols bgp group internal-peers neighbor 192.168.6.5 set logical-systems C protocols ospf area 0.0.0.0 interface lo0.3 passive set logical-systems C protocols ospf area 0.0.0.0 interface lt-1/2/0.6 set logical-systems C policy-options policy-statement send-direct term 2 from protocol direct set logical-systems C policy-options policy-statement send-direct term 2 then accept set logical-systems C routing-options router-id 192.168.40.4 set logical-systems C routing-options autonomous-system 17
配置设备 A
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 用户指南 中的 在配置模式下使用 CLI编辑器。
要配置设备 A:
将 CLI设置为逻辑系统 A。
user@host> set cli logical-system A
配置接口。
[edit interfaces lt-1/2/0 unit 1] user@host:A# set description to-B user@host:A# set encapsulation ethernet user@host:A# set peer-unit 2 user@host:A# set family inet address 10.10.10.1/30 [edit interfaces lo0 unit 1] user@host:A# set family inet address 192.168.6.5/32
配置 BGP。
包括设备 B 和设备 C 的语句,即使设备
neighbor
A 未直接连接到设备 C。[edit protocols bgp group internal-peers] user@host:A# set type internal user@host:A# set local-address 192.168.6.5 user@host:A# set export send-direct user@host:A# set neighbor 192.163.6.4 user@host:A# set neighbor 192.168.40.4
配置 BFD。
[edit protocols bgp group internal-peers] user@host:A# set bfd-liveness-detection minimum-interval 1000
您必须在连接对等方上配置相同的最小间隔。
(可选)配置 BFD 追踪。
[edit protocols bgp group internal-peers] user@host:A# set traceoptions file bgp-bfd user@host:A# set traceoptions flag bfd detail
配置 OSPF。
[edit protocols ospf area 0.0.0.0] user@host:A# set interface lo0.1 passive user@host:A# set interface lt-1/2/0.1
配置接受直接路由的策略。
此情景的其他有用选项可能是接受通过路由或OSPF路由学到的路由。
[edit policy-options policy-statement send-direct term 2] user@host:A# set from protocol direct user@host:A# set then accept
配置路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@host:A# set router-id 192.168.6.5 user@host:A# set autonomous-system 17
如果完成设备配置,请从配置
commit
模式输入 。 重复这些步骤以配置设备 B 和设备 C。
结果
在配置模式下,输入 、 和 show interfaces
命令 show policy-options
以确认 show protocols
您的 show routing-options
配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host:A# show interfaces lt-1/2/0 { unit 1 { description to-B; encapsulation ethernet; peer-unit 2; family inet { address 10.10.10.1/30; } } } lo0 { unit 1 { family inet { address 192.168.6.5/32; } } }
user@host:A# show policy-options policy-statement send-direct { term 2 { from protocol direct; then accept; } }
user@host:A# show protocols bgp { group internal-peers { type internal; traceoptions { file bgp-bfd; flag bfd detail; } local-address 192.168.6.5; export send-direct; bfd-liveness-detection { minimum-interval 1000; } neighbor 192.163.6.4; neighbor 192.168.40.4; } } ospf { area 0.0.0.0 { interface lo0.1 { passive; } interface lt-1/2/0.1; } }
user@host:A# show routing-options router-id 192.168.6.5; autonomous-system 17;
验证
确认配置工作正常。
验证是否启用了 BFD
目的
验证 IBGP 对等方之间是否启用了 BFD。
行动
在操作模式下,输入 show bgp neighbor
命令。您可以使用过滤器 | match bfd
缩小输出范围。
user@host:A> show bgp neighbor | match bfd Options: <BfdEnabled> BFD: enabled, up Trace file: /var/log/A/bgp-bfd size 131072 files 10 Options: <BfdEnabled> BFD: enabled, up Trace file: /var/log/A/bgp-bfd size 131072 files 10
意义
输出显示逻辑系统 A 有两个启用了 BFD 的邻设备。未启用 BFD 时,输出显示 BFD: disabled, down
, <BfdEnabled>
且缺少选项。如果 BFD 启用且会话关闭,则输出显示 BFD: enabled, down
。输出还显示,BFD 相关事件正在写入日志文件,因为已配置追踪操作。
验证 BFD 会话是否启动
目的
验证 BFD 会话是否已启动,并查看有关 BFD 会话的详细信息。
行动
在操作模式下,输入 show bfd session extensive
命令。
user@host:A> show bfd session extensive Detect Transmit Address State Interface Time Interval Multiplier 192.163.6.4 Up 3.000 1.000 3 Client BGP, TX interval 1.000, RX interval 1.000 Session up time 00:54:40 Local diagnostic None, remote diagnostic None Remote state Up, version 1 Logical system 12, routing table index 25 Min async interval 1.000, min slow interval 1.000 Adaptive async TX interval 1.000, RX interval 1.000 Local min TX interval 1.000, minimum RX interval 1.000, multiplier 3 Remote min TX interval 1.000, min RX interval 1.000, multiplier 3 Local discriminator 10, remote discriminator 9 Echo mode disabled/inactive Multi-hop route table 25, local-address 192.168.6.5 Detect Transmit Address State Interface Time Interval Multiplier 192.168.40.4 Up 3.000 1.000 3 Client BGP, TX interval 1.000, RX interval 1.000 Session up time 00:48:03 Local diagnostic None, remote diagnostic None Remote state Up, version 1 Logical system 12, routing table index 25 Min async interval 1.000, min slow interval 1.000 Adaptive async TX interval 1.000, RX interval 1.000 Local min TX interval 1.000, minimum RX interval 1.000, multiplier 3 Remote min TX interval 1.000, min RX interval 1.000, multiplier 3 Local discriminator 14, remote discriminator 13 Echo mode disabled/inactive Multi-hop route table 25, local-address 192.168.6.5 2 sessions, 2 clients Cumulative transmit rate 2.0 pps, cumulative receive rate 2.0 pps
意义
输出 TX interval 1.000, RX interval 1.000
表示使用 语句配置的 minimum-interval
设置。所有其他输出都表示 BFD 的默认设置。要修改默认设置,请添加 语句下的可选 bfd-liveness-detection
语句。
查看详细的 BFD 事件
目的
查看 BFD 追踪文件的内容,帮助进行故障排除(如有必要)。
行动
在操作模式下,输入 file show /var/log/A/bgp-bfd
命令。
user@host:A> file show /var/log/A/bgp-bfd Aug 15 17:07:25 trace_on: Tracing to "/var/log/A/bgp-bfd" started Aug 15 17:07:26.492190 bgp_peer_init: BGP peer 192.163.6.4 (Internal AS 17) local address 192.168.6.5 not found. Leaving peer idled Aug 15 17:07:26.493176 bgp_peer_init: BGP peer 192.168.40.4 (Internal AS 17) local address 192.168.6.5 not found. Leaving peer idled Aug 15 17:07:32.597979 task_connect: task BGP_17.192.163.6.4+179 addr 192.163.6.4+179: No route to host Aug 15 17:07:32.599623 bgp_connect_start: connect 192.163.6.4 (Internal AS 17): No route to host Aug 15 17:07:36.869394 task_connect: task BGP_17.192.168.40.4+179 addr 192.168.40.4+179: No route to host Aug 15 17:07:36.870624 bgp_connect_start: connect 192.168.40.4 (Internal AS 17): No route to host Aug 15 17:08:04.599220 task_connect: task BGP_17.192.163.6.4+179 addr 192.163.6.4+179: No route to host Aug 15 17:08:04.601135 bgp_connect_start: connect 192.163.6.4 (Internal AS 17): No route to host Aug 15 17:08:08.869717 task_connect: task BGP_17.192.168.40.4+179 addr 192.168.40.4+179: No route to host Aug 15 17:08:08.869934 bgp_connect_start: connect 192.168.40.4 (Internal AS 17): No route to host Aug 15 17:08:36.603544 advertising receiving-speaker only capabilty to neighbor 192.163.6.4 (Internal AS 17) Aug 15 17:08:36.606726 bgp_read_message: 192.163.6.4 (Internal AS 17): 0 bytes buffered Aug 15 17:08:36.609119 Initiated BFD session to peer 192.163.6.4 (Internal AS 17): address=192.163.6.4 ifindex=0 ifname=(none) txivl=1000 rxivl=1000 mult=3 ver=255 Aug 15 17:08:36.734033 advertising receiving-speaker only capabilty to neighbor 192.168.40.4 (Internal AS 17) Aug 15 17:08:36.738436 Initiated BFD session to peer 192.168.40.4 (Internal AS 17): address=192.168.40.4 ifindex=0 ifname=(none) txivl=1000 rxivl=1000 mult=3 ver=255 Aug 15 17:08:40.537552 BFD session to peer 192.163.6.4 (Internal AS 17) up Aug 15 17:08:40.694410 BFD session to peer 192.168.40.4 (Internal AS 17) up
意义
在建立路由之前, No route to host
消息会显示在输出中。建立路由之后,最后两行显示两个 BFD 会话都启动。
在停用和重新激活环回接口之后查看详细的 BFD 事件
目的
检查在关闭路由器或交换机之后,然后恢复之后将会怎样。要模拟停用路由器或交换机,请停用逻辑系统 B 上的环路接口。
行动
在配置模式下,输入
deactivate logical-systems B interfaces lo0 unit 2 family inet
命令。user@host:A# deactivate logical-systems B interfaces lo0 unit 2 family inet user@host:A# commit
在操作模式下,输入
file show /var/log/A/bgp-bfd
命令。user@host:A> file show /var/log/A/bgp-bfd ... Aug 15 17:20:55.995648 bgp_read_v4_message:9747: NOTIFICATION received from 192.163.6.4 (Internal AS 17): code 6 (Cease) subcode 6 (Other Configuration Change) Aug 15 17:20:56.004508 Terminated BFD session to peer 192.163.6.4 (Internal AS 17) Aug 15 17:21:28.007755 task_connect: task BGP_17.192.163.6.4+179 addr 192.163.6.4+179: No route to host Aug 15 17:21:28.008597 bgp_connect_start: connect 192.163.6.4 (Internal AS 17): No route to host
在配置模式下,输入
activate logical-systems B interfaces lo0 unit 2 family inet
命令。user@host:A# activate logical-systems B interfaces lo0 unit 2 family inet user@host:A# commit
在操作模式下,输入
file show /var/log/A/bgp-bfd
命令。user@host:A> file show /var/log/A/bgp-bfd ... Aug 15 17:25:53.623743 advertising receiving-speaker only capabilty to neighbor 192.163.6.4 (Internal AS 17) Aug 15 17:25:53.631314 Initiated BFD session to peer 192.163.6.4 (Internal AS 17): address=192.163.6.4 ifindex=0 ifname=(none) txivl=1000 rxivl=1000 mult=3 ver=255 Aug 15 17:25:57.570932 BFD session to peer 192.163.6.4 (Internal AS 17) up
示例:在逻辑系统上配置 EBGP 多宿主会话
此示例展示如何配置距离BGP多跃点外部路由 (EBGP) 对等方。这种类型的会话称为 多宿主 EBGP 会话。
要求
此示例不需要除设备初始化之外的特殊配置。
概述
当 EBGP 对等方未直接相互连接时,它们必须跨越一个或多个非BGP路由设备以相互连接。配置多宿主 EBGP 允许对等方通过其他路由设备以形成对等关系和交换更新消息。当路由器的路由设备瞻博网络不允许两个 EBGP 对等方直接连接的第三方路由设备运行 EBGP 时,通常会使用这种配置类型。EBGP 多宿主可在没有直接连接的两个 EBGP 对等方之间启用邻接方连接。
要启用多宿主 EBGP 会话的配置需要在两个 EBGP 对等方之间连接。此示例使用静态路由在设备之间提供连接。
对于直接连接的 EBGP 会话,一般在语句中会使用物理 neighbor
地址。对于多宿主 EBGP,必须使用环路接口地址,并指定间接连接对等方的环路接口地址。使用环路接口地址时,EBGP 多宿主类似于内部BGP (IBGP)。
最后,您必须添加 multihop
该语句。或者,您也可使用 语句设置最大活动时间 (TTL) ttl
值。TTL 在数据包的 IP 标头BGP。如果不指定 TTL 值,则系统默认使用最大 TTL 值。默认 TTL 值为 64(对于多宿主 EBGP 会话)。另一个选项是,BGP语句来保留路由播发的下一跳跃 no-nexthop-change
值。
图 4 显示了典型的 EBGP 多宿主网络。
设备 C 和设备 E 已建立 EBGP 会话。设备 D 不是BGP设备。所有设备都通过静态路由建立连接。

配置
CLI快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以匹配网络配置,然后将命令复制并粘贴到 层次结构级别的 CLI 中 [edit]
。
设备 C
set logical-systems C interfaces lt-1/2/0 unit 9 description to-D set logical-systems C interfaces lt-1/2/0 unit 9 encapsulation ethernet set logical-systems C interfaces lt-1/2/0 unit 9 peer-unit 10 set logical-systems C interfaces lt-1/2/0 unit 9 family inet address 10.10.10.9/30 set logical-systems C interfaces lo0 unit 3 family inet address 192.168.40.4/32 set logical-systems C protocols bgp group external-peers type external set logical-systems C protocols bgp group external-peers multihop ttl 2 set logical-systems C protocols bgp group external-peers local-address 192.168.40.4 set logical-systems C protocols bgp group external-peers export send-static set logical-systems C protocols bgp group external-peers peer-as 18 set logical-systems C protocols bgp group external-peers neighbor 192.168.6.7 set logical-systems C policy-options policy-statement send-static term 1 from protocol static set logical-systems C policy-options policy-statement send-static term 1 then accept set logical-systems C routing-options static route 10.10.10.14/32 next-hop 10.10.10.10 set logical-systems C routing-options static route 192.168.6.7/32 next-hop 10.10.10.10 set logical-systems C routing-options router-id 192.168.40.4 set logical-systems C routing-options autonomous-system 17
设备 D
set logical-systems D interfaces lt-1/2/0 unit 10 description to-C set logical-systems D interfaces lt-1/2/0 unit 10 encapsulation ethernet set logical-systems D interfaces lt-1/2/0 unit 10 peer-unit 9 set logical-systems D interfaces lt-1/2/0 unit 10 family inet address 10.10.10.10/30 set logical-systems D interfaces lt-1/2/0 unit 13 description to-E set logical-systems D interfaces lt-1/2/0 unit 13 encapsulation ethernet set logical-systems D interfaces lt-1/2/0 unit 13 peer-unit 14 set logical-systems D interfaces lt-1/2/0 unit 13 family inet address 10.10.10.13/30 set logical-systems D interfaces lo0 unit 4 family inet address 192.168.6.6/32 set logical-systems D routing-options static route 192.168.40.4/32 next-hop 10.10.10.9 set logical-systems D routing-options static route 192.168.6.7/32 next-hop 10.10.10.14 set logical-systems D routing-options router-id 192.168.6.6
设备 E
set logical-systems E interfaces lt-1/2/0 unit 14 description to-D set logical-systems E interfaces lt-1/2/0 unit 14 encapsulation ethernet set logical-systems E interfaces lt-1/2/0 unit 14 peer-unit 13 set logical-systems E interfaces lt-1/2/0 unit 14 family inet address 10.10.10.14/30 set logical-systems E interfaces lo0 unit 5 family inet address 192.168.6.7/32 set logical-systems E protocols bgp group external-peers multihop ttl 2 set logical-systems E protocols bgp group external-peers local-address 192.168.6.7 set logical-systems E protocols bgp group external-peers export send-static set logical-systems E protocols bgp group external-peers peer-as 17 set logical-systems E protocols bgp group external-peers neighbor 192.168.40.4 set logical-systems E policy-options policy-statement send-static term 1 from protocol static set logical-systems E policy-options policy-statement send-static term 1 then accept set logical-systems E routing-options static route 10.10.10.8/30 next-hop 10.10.10.13 set logical-systems E routing-options static route 192.168.40.4/32 next-hop 10.10.10.13 set logical-systems E routing-options router-id 192.168.6.7 set logical-systems E routing-options autonomous-system 18
设备 C
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 用户指南 中的 在配置模式下CLI 编辑器。
要配置设备 C:
将 CLI设置为逻辑系统 C。
user@host> set cli logical-system C
将接口配置为直接连接设备(to-D),并配置环路接口。
[edit interfaces lt-1/2/0 unit 9] user@host:C# set description to-D user@host:C# set encapsulation ethernet user@host:C# set peer-unit 10 user@host:C# set family inet address 10.10.10.9/30 [edit interfaces lo0 unit 3] user@host:C# set family inet address 192.168.40.4/32
使用逻辑系统 E 配置 EBGP 会话。
该
neighbor
语句指向逻辑系统 E 上的环路接口。[edit protocols bgp group external-peers] user@host:C# set type external user@host:C# set local-address 192.168.40.4 user@host:C# set export send-static user@host:C# set peer-as 18 user@host:C# set neighbor 192.168.6.7
配置多宿主语句,使逻辑系统 C 和逻辑系统 E 成为 EBGP 对等方。
由于对等方相互之间有两个跃点,因此示例会使用
ttl 2
语句。[edit protocols bgp group external-peers] user@host:C# set multihop ttl 2
使用静态路由配置与逻辑系统 E 的连接。
您必须配置环路接口地址和物理接口上的地址的路由。
[edit logical-systems C routing-options] user@host:C# set static route 10.10.10.14/32 next-hop 10.10.10.10 user@host:C# set static route 192.168.6.7/32 next-hop 10.10.10.10
配置本地路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@host:C# set router-id 192.168.40.4 user@host:C# set autonomous-system 17
配置接受直接路由的策略。
此情景的其他有用选项可能是接受通过路由或OSPF路由学到的路由。
[edit policy-options policy-statement send-static term 1] user@host:C# set from protocol static user@host:C# set then accept
结果
在配置模式下,输入 、 和 show interfaces
命令 show protocols
以确认 show policy-options
您的 show routing-options
配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host:C# show interfaces lt-1/2/0 { unit 9 { description to-D; encapsulation ethernet; peer-unit 10; family inet { address 10.10.10.9/30; } } } lo0 { unit 3 { family inet { address 192.168.40.4/32; } } }
user@host:C# show protocols bgp { group external-peers { type external; multihop { ttl 2; } local-address 192.168.40.4; export send-static; peer-as 18; neighbor 192.168.6.7; } }
user@host:C# show policy-options policy-statement send-static { term 1 { from protocol static; then accept; } }
user@host:C# show routing-options static { route 10.10.10.14/32 next-hop 10.10.10.10; route 192.168.6.7/32 next-hop 10.10.10.10; } router-id 192.168.40.4; autonomous-system 17;
如果完成设备配置,请在配置 模式下输入 commit 。为拓扑中所有 BFD 会话重复这些步骤。
设备 D
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 用户指南 中的 在配置模式下使用 CLI编辑器。
要配置设备 D:
将 CLI设置为逻辑系统 D。
user@host> set cli logical-system D
配置直接连接设备的接口,并配置环路接口。
[edit interfaces lt-1/2/0 unit 10] user@host:D# set description to-C user@host:D# set encapsulation ethernet user@host:D# set peer-unit 9 user@host:D# set family inet address 10.10.10.10/30 [edit interfaces lt-1/2/0 unit 13] user@host:D# set description to-E user@host:D# set encapsulation ethernet user@host:D# set peer-unit 14 user@host:D# set family inet address 10.10.10.13/30 [edit interfaces lo0 unit 4] user@host:D# set family inet address 192.168.6.6/32
使用静态路由配置与其他设备到环路接口地址的连接。
在逻辑系统 D 上,不需要对物理地址使用静态路由,因为逻辑系统 D 直接连接到逻辑系统 C 和逻辑系统 E。
[edit routing-options] user@host:D# set static route 192.168.40.4/32 next-hop 10.10.10.9 user@host:D# set static route 192.168.6.7/32 next-hop 10.10.10.14
配置本地路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@host:D# set router-id 192.168.6.6
结果
在配置模式下,输入 和 命令以确认 show interfaces
show routing-options
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host:D# show interfaces lt-1/2/0 { unit 10 { description to-C; encapsulation ethernet; peer-unit 9; family inet { address 10.10.10.10/30; } } unit 13 { description to-E; encapsulation ethernet; peer-unit 14; family inet { address 10.10.10.13/30; } } } lo0 { unit 4 { family inet { address 192.168.6.6/32; } } }
user@host:D# show protocols
user@host:D# show routing-options static { route 192.168.40.4/32 next-hop 10.10.10.9; route 192.168.6.7/32 next-hop 10.10.10.14; } router-id 192.168.6.6;
如果完成设备配置,请在配置 模式下输入 commit 。为拓扑中所有 BFD 会话重复这些步骤。
设备 E
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 用户指南 中的 在配置模式下使用 CLI编辑器。
要配置设备 E:
将CLI逻辑系统 E。
user@host> set cli logical-system E
将接口配置为直接连接设备(to-D),并配置环路接口。
[edit interfaces lt-1/2/0 unit 14] user@host:E# set description to-D user@host:E# set encapsulation ethernet user@host:E# set peer-unit 13 user@host:E# set family inet address 10.10.10.14/30 [edit interfaces lo0 unit 5] user@host:E# set family inet address 192.168.6.7/32
使用逻辑系统 E 配置 EBGP 会话。
该
neighbor
语句指向逻辑系统 C 上的环路接口。[edit protocols bgp group external-peers] user@host:E# set local-address 192.168.6.7 user@host:E# set export send-static user@host:E# set peer-as 17 user@host:E# set neighbor 192.168.40.4
配置
multihop
该语句,使逻辑系统 C 和逻辑系统 E 成为 EBGP 对等方。由于对等方相互之间有两个跳跃,因此示例会使用
ttl 2
语句。[edit protocols bgp group external-peers] user@host:E# set multihop ttl 2
使用静态路由配置与逻辑系统 E 的连接。
您必须配置环路接口地址和物理接口上的地址的路由。
[edit routing-options] user@host:E# set static route 10.10.10.8/30 next-hop 10.10.10.13 user@host:E# set static route 192.168.40.4/32 next-hop 10.10.10.13
配置本地路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@host:E# set router-id 192.168.6.7 user@host:E# set autonomous-system 18
配置接受直接路由的策略。
此情景的其他有用选项可能是接受通过路由或本地路由OSPF路由。
[edit policy-options policy-statement send-static term 1] user@host:E# set from protocol static user@host:E# set send-static then accept
结果
在配置模式下,输入 、 和 show interfaces
命令 show protocols
以确认 show policy-options
您的 show routing-options
配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host:E# show interfaces lt-1/2/0 { unit 14 { description to-D; encapsulation ethernet; peer-unit 13; family inet { address 10.10.10.14/30; } } } lo0 { unit 5 { family inet { address 192.168.6.7/32; } } }
user@host:E# show protocols bgp { group external-peers { multihop { ttl 2; } local-address 192.168.6.7; export send-static; peer-as 17; neighbor 192.168.40.4; } }
user@host:E# show policy-options policy-statement send-static { term 1 { from protocol static; then accept; } }
user@host:E# show routing-options static { route 10.10.10.8/30 next-hop 10.10.10.13; route 192.168.40.4/32 next-hop 10.10.10.13; } router-id 192.168.6.7; autonomous-system 18;
如果完成设备配置,请在配置 模式下输入 commit 。
验证
确认配置工作正常。
验证连接性
目的
确保设备 C 可以 ping 设备 E,将环路接口地址指定为 ping 请求的来源。
环路接口地址是您将使用的BGP地址。
行动
在操作模式下,从逻辑系统 C 输入 命令 ping 10.10.10.14 source 192.168.40.4
,然后 ping 10.10.10.9 source 192.168.6.7
从逻辑系统 E 输入 命令。
user@host:C> ping 10.10.10.14 source 192.168.40.4PING 10.10.10.14 (10.10.10.14): 56 data bytes 64 bytes from 10.10.10.14: icmp_seq=0 ttl=63 time=1.262 ms 64 bytes from 10.10.10.14: icmp_seq=1 ttl=63 time=1.202 ms ^C --- 10.10.10.14 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 1.202/1.232/1.262/0.030 ms
user@host:E> ping 10.10.10.9 source 192.168.6.7PING 10.10.10.9 (10.10.10.9): 56 data bytes 64 bytes from 10.10.10.9: icmp_seq=0 ttl=63 time=1.255 ms 64 bytes from 10.10.10.9: icmp_seq=1 ttl=63 time=1.158 ms ^C --- 10.10.10.9 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 1.158/1.206/1.255/0.049 ms
意义
如果 ping 工作正常,则静态路由可以工作。
验证BGP会话的建立
目的
验证BGP会话是否启动。
行动
在操作模式下,输入 show bgp summary
命令。
user@host:C> show bgp summaryGroups: 1 Peers: 1 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 2 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 192.168.6.7 18 147 147 0 1 1:04:27 0/2/2/0 0/0/0/0
user@host:E> show bgp summary Groups: 1 Peers: 1 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 2 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 192.168.40.4 17 202 202 0 1 1:02:18 0/2/2/0 0/0/0/0
意义
输出显示两台设备各有一个对等方。没有对等方会关闭。
查看通告的路由
目的
检查以确保路由由路由通告BGP。
行动
在操作模式下,输入 show route advertising-protocol bgp neighbor
命令。
user@host:C> show route advertising-protocol bgp 192.168.6.7inet.0: 5 destinations, 7 routes (5 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 10.10.10.14/32 Self I * 192.168.6.7/32 Self I
user@host:E> show route advertising-protocol bgp 192.168.40.4 inet.0: 5 destinations, 7 routes (5 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 10.10.10.8/30 Self I * 192.168.40.4/32 Self I
意义
发送 静态路由 策略将静态路由从路由表导出到BGP。BGP会话已建立,因此对等方BGP 对等体这些路由。