示例:将标签交换路径广告到 IS-IS 中
此示例说明如何将标签交换路径 (LSP) 作为点对点链路(有时称为转发邻接)播发至 IS-IS,以便在 SPF 计算中使用 LSP。播发包含本地地址(LSP 的 发 地址)、远程地址(LSP 的 到 地址)和指标。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
图 1 显示了此示例中使用的拓扑。
示例说明如何配置从设备 E 到设备 D 的 LSP,然后通过 IS-IS 播发此路径。通过执行从设备 A 到设备 D 的 traceroute 操作并确保使用 LSP 进行转发来验证配置。
CLI 快速配置 显示了 图 1 中所有设备的配置。 第 #configuration442__isis-lsp-advertise-逐步 说明设备 E 上的步骤。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 A
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.1/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces fe-1/2/0 unit 0 family mpls set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.5/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0001.00 set protocols rsvp interface lo0.0 set protocols rsvp interface fe-1/2/0.0 set protocols mpls interface fe-1/2/0.0 set protocols bgp group int type internal set protocols bgp group int local-address 192.168.0.1 set protocols bgp group int neighbor 192.168.0.6 set protocols bgp group int neighbor 192.168.0.5 set protocols bgp group int neighbor 192.168.0.4 set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface fe-1/2/0.0 level 2 metric 10 set protocols isis interface fe-1/2/0.5 level 2 metric 10 set protocols isis interface fe-1/2/0.5 level 1 disable set protocols isis interface lo0.0 set routing-options router-id 192.168.0.1 set routing-options autonomous-system 1
设备 B
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.6/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.9/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0002.00 set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface fe-1/2/1.0 level 2 metric 10 set protocols isis interface fe-1/2/1.0 level 1 disable set protocols isis interface lo0.0 set routing-options router-id 192.168.0.2
设备 C
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.10/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.13/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.0.3/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0003.00 set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface fe-1/2/1.0 level 1 disable set protocols isis interface fe-1/2/1.0 level 2 metric 10 set protocols isis interface lo0.0 set routing-options router-id 192.168.0.3
设备 D
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.14/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.22/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces fe-1/2/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.0.4/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0004.00 set protocols rsvp interface lo0.0 set protocols rsvp interface fe-1/2/1.0 set protocols mpls label-switched-path E-D to 192.168.0.5 set protocols mpls interface fe-1/2/1.0 set protocols bgp group int type internal set protocols bgp group int local-address 192.168.0.4 set protocols bgp group int neighbor 192.168.0.5 set protocols bgp group int neighbor 192.168.0.1 set protocols bgp group int neighbor 192.168.0.6 set protocols isis interface fe-1/2/0.14 level 1 disable set protocols isis interface fe-1/2/1.0 level 1 disable set protocols isis interface lo0.0 set protocols isis label-switched-path E-D level 2 set routing-options router-id 192.168.0.4 set routing-options autonomous-system 1
设备 E
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.2/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces fe-1/2/0 unit 0 family mpls set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.17/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces fe-1/2/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.0.5/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0005.00 set protocols rsvp interface lo0.0 set protocols rsvp interface fe-1/2/0.0 set protocols rsvp interface fe-1/2/1.0 set protocols mpls label-switched-path E-D to 192.168.0.4 set protocols mpls interface fe-1/2/0.0 set protocols mpls interface fe-1/2/1.0 set protocols bgp group int type internal set protocols bgp group int local-address 192.168.0.5 set protocols bgp group int neighbor 192.168.0.6 set protocols bgp group int neighbor 192.168.0.1 set protocols bgp group int neighbor 192.168.0.4 set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface fe-1/2/1.0 level 1 disable set protocols isis interface fe-1/2/1.0 level 2 metric 20 set protocols isis interface lo0.0 set protocols isis label-switched-path E-D level 2 metric 15 set routing-options router-id 192.168.0.5 set routing-options autonomous-system 1
设备 F
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.18/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces fe-1/2/0 unit 0 family mpls set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.21/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces fe-1/2/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.0.6/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0006.00 set protocols rsvp interface lo0.0 set protocols rsvp interface fe-1/2/0.0 set protocols rsvp interface fe-1/2/1.0 set protocols mpls interface fe-1/2/0.0 set protocols mpls interface fe-1/2/1.0 set protocols bgp group int type internal set protocols bgp group int local-address 192.168.0.6 set protocols bgp group int neighbor 192.168.0.1 set protocols bgp group int neighbor 192.168.0.5 set protocols bgp group int neighbor 192.168.0.4 set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface fe-1/2/1.0 level 2 metric 10 set protocols isis interface fe-1/2/1.0 level 1 disable set protocols isis interface lo0.0 set routing-options router-id 192.168.0.6 set routing-options autonomous-system 1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
将 LSP 播发至 IS-IS:
配置接口。
[edit interfaces] user@E# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30 user@E# set fe-1/2/0 unit 0 family iso user@E# set fe-1/2/0 unit 0 family mpls user@E# set fe-1/2/1 unit 0 family inet address 10.0.0.17/30 user@E# set fe-1/2/1 unit 0 family iso user@E# set fe-1/2/1 unit 0 family mpls user@E# set lo0 unit 0 family inet address 192.168.0.5/32 user@E# set lo0 unit 0 family iso address 49.0002.0192.0168.0005.00
在接口上启用信令协议。
[edit protocols rsvp] user@E# set interface lo0.0 user@E# set interface fe-1/2/0.0 user@E# set interface fe-1/2/1.0
在接口上启用 MPLS。
[edit protocols mpls] user@E# set interface fe-1/2/0.0 user@E# set interface fe-1/2/1.0
配置 LSP。
请确保在端点上(在本案例中是在设备 D 上)配置反向 LSP。
[edit protocols mpls] user@E# set label-switched-path E-D to 192.168.0.4
在必须运行 MPLS 的设备之间配置内部 BGP (IBGP) 对等互连。
[edit protocols bgp group int] user@E# set type internal user@E# set local-address 192.168.0.5 user@E# set neighbor 192.168.0.6 user@E# set neighbor 192.168.0.1 user@E# set neighbor 192.168.0.4
在接口上启用 IS-IS,并设置链路指标。
如果将接口包含在中
[edit protocols isis]
,则 IS-IS 级别 1 和级别 2 将启用。通过禁用级别 1,实际上将创建一个级别 2 IS-IS 接口。[edit protocols isis] user@E# set interface fe-1/2/0.0 level 1 disable user@E# set interface fe-1/2/1.0 level 1 disable user@E# set interface fe-1/2/1.0 level 2 metric 20 user@E# set interface lo0.0
通过 IS-IS 播发 LSP。
请确保在端点上播发 LSP,在本案例中,在设备 D 上。
[edit protocols isis] user@E# set label-switched-path E-D level 2 metric 15
配置路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@E# set router-id 192.168.0.5 user@E# set autonomous-system 1
结果
在配置模式下,输入 、 show protocols
和show routing-options
命令,show interfaces
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@E# show interfaces
fe-1/2/0 {
unit 0 {
family inet {
address 10.0.0.2/30;
}
family iso;
family mpls;
}
}
fe-1/2/1 {
unit 0 {
family inet {
address 10.0.0.17/30;
}
family iso;
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.5/32;
}
family iso {
address 49.0002.0192.0168.0005.00;
}
}
}
user@E# show protocols
rsvp {
interface lo0.0;
interface fe-1/2/0.0;
interface fe-1/2/1.0;
}
mpls {
label-switched-path E-D {
to 192.168.0.4;
}
interface fe-1/2/0.0;
interface fe-1/2/1.0;
}
bgp {
group int {
type internal;
local-address 192.168.0.5;
neighbor 192.168.0.6;
neighbor 192.168.0.1;
neighbor 192.168.0.4;
}
}
isis {
interface fe-1/2/0.0 {
level 1 disable;
}
interface fe-1/2/1.0 {
level 1 disable;
level 2 metric 20;
}
interface lo0.0;
label-switched-path E-D {
level 2 metric 15;
}
}
user@E# show routing-options
router-id 192.168.0.5;
autonomous-system 1;
完成设备配置后,请在配置模式下输入 提交 。
验证
确认配置工作正常。
验证 IS-IS 邻接方
目的
验证是否已列出另一个邻接方,并且是否通过 LSP 可访问。接口字段表示 LSP 的名称。
行动
在操作模式下,输入 show isis adjacency detail
命令。
user@E> show isis adjacency detail D Interface: E-D, Level: 2, State: One-way, Expires in 0 secs Priority: 0, Up/Down transitions: 1, Last transition: 1d 00:34:58 ago Circuit type: 3, Speaks: IP Topologies: Unicast Restart capable: No, Adjacency advertisement: Advertise IP addresses: 192.168.0.4 F Interface: fe-1/2/1.0, Level: 2, State: Up, Expires in 7 secs Priority: 64, Up/Down transitions: 1, Last transition: 1d 01:16:22 ago Circuit type: 2, Speaks: IP, IPv6, MAC address: 0:5:85:8f:c8:bd Topologies: Unicast Restart capable: Yes, Adjacency advertisement: Advertise LAN id: F.02, IP addresses: 10.0.0.18 A Interface: fe-1/2/0.0, Level: 2, State: Up, Expires in 20 secs Priority: 64, Up/Down transitions: 1, Last transition: 1d 01:17:20 ago Circuit type: 2, Speaks: IP, IPv6, MAC address: 0:5:85:8f:c8:bc Topologies: Unicast Restart capable: Yes, Adjacency advertisement: Advertise LAN id: E.02, IP addresses: 10.0.0.1
意义
如预期的那样, Interface: E-D
在输出中显示,状态显示为 One-way
。
检查 IS-IS SPF 计算
目的
验证在 SPF 计算中使用了 LSP。
行动
在操作模式下,输入 show isis spf brief
命令。
user@E> show isis spf brief IS-IS level 1 SPF results: Node Metric Interface NH Via SNPA E.00 0 1 nodes IS-IS level 2 SPF results: Node Metric Interface NH Via SNPA C.02 30 fe-1/2/0.0 IPV4 A 0:5:85:8f:c8:bc C.00 25 fe-1/2/1.0 LSP E-D D.03 25 fe-1/2/1.0 LSP E-D D.02 25 fe-1/2/1.0 LSP E-D F.00 20 fe-1/2/1.0 IPV4 F 0:5:85:8f:c8:bd B.00 20 fe-1/2/0.0 IPV4 A 0:5:85:8f:c8:bc B.02 20 fe-1/2/0.0 IPV4 A 0:5:85:8f:c8:bc D.00 15 fe-1/2/1.0 LSP E-D A.00 10 fe-1/2/0.0 IPV4 A 0:5:85:8f:c8:bc E.02 10 E.00 0 11 nodes
意义
与预期一样,SPF 结果包括 LSP、E-D。
检查转发路径
目的
验证从设备 A 到设备 D 的追踪路由操作是否使用 LSP。
行动
user@A> traceroute 192.168.0.4 traceroute to 192.168.0.4 (192.168.0.4), 30 hops max, 40 byte packets 1 10.0.0.2 (10.0.0.2) 1.092 ms 1.034 ms 1.174 ms 2 10.0.0.18 (10.0.0.18) 1.435 ms 2.062 ms 2.232 ms MPLS Label=299792 CoS=0 TTL=1 S=1 3 bb04-cclab-lo0.spglab.juniper.net (192.168.0.4) 2.286 ms 1.432 ms 1.354 ms
意义
输出显示使用了 LSP。