示例:在逻辑系统上配置 IS-IS 默认路由策略
此示例显示了在单个物理路由器上配置的逻辑系统,并说明了如何在一个逻辑系统上配置默认路由。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
此示例显示了将默认路由重新分配给其他逻辑系统的逻辑系统。所有逻辑系统都在运行 IS-IS。默认路由的一个常见原因是提供路径来发送发往 IS-IS 域之外的流量。
在此示例中,默认路由不用于转发流量。该 no-install 语句可防止路由安装在逻辑系统 LS3 的转转发表中。如果将路由配置为未将其安装在转转发表中,则仍可将路由从路由表导出到其他协议。语 discard 句以静默方式丢弃数据包,恕不另行通知。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层 [edit] 级的 CLI 中,然后从配置模式进入提交。
set logical-systems LS3 interfaces lt-1/2/0 unit 3 description LS3->LS2 set logical-systems LS3 interfaces lt-1/2/0 unit 3 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 3 peer-unit 4 set logical-systems LS3 interfaces lt-1/2/0 unit 3 family inet address 10.0.2.1/30 set logical-systems LS3 interfaces lt-1/2/0 unit 3 family iso set logical-systems LS3 interfaces lt-1/2/0 unit 5 description LS3->LS1 set logical-systems LS3 interfaces lt-1/2/0 unit 5 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 5 peer-unit 0 set logical-systems LS3 interfaces lt-1/2/0 unit 5 family inet address 10.0.1.1/30 set logical-systems LS3 interfaces lt-1/2/0 unit 5 family iso set logical-systems LS3 interfaces lo0 unit 3 family iso address 49.0001.1234.1600.2231.00 set logical-systems LS3 protocols isis export isis-default set logical-systems LS3 protocols isis interface lt-1/2/0.3 set logical-systems LS3 protocols isis interface lt-1/2/0.5 set logical-systems LS3 protocols isis interface lo0.3 passive set logical-systems LS3 routing-options static route 0.0.0.0/0 discard set logical-systems LS3 routing-options static route 0.0.0.0/0 no-install set logical-systems LS3 policy-options policy-statement isis-default from protocol static set logical-systems LS3 policy-options policy-statement isis-default from route-filter 0.0.0.0/0 exact set logical-systems LS3 policy-options policy-statement isis-default then accept
程序
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要在逻辑系统上配置 IS-IS 默认路由策略:
配置逻辑隧道接口。
[edit logical-systems LS3 interfaces lt-1/2/0] user@R1# set unit 3 description LS3->LS2 user@R1# set unit 3 encapsulation ethernet user@R1# set unit 3 peer-unit 4 user@R1# set unit 3 family inet address 10.0.2.1/30 user@R1# set unit 3 family iso user@R1# set unit 5 description LS3->LS1 user@R1# set unit 5 encapsulation ethernet user@R1# set unit 5 peer-unit 0 user@R1# set unit 5 family inet address 10.0.1.1/30 user@R1# set unit 5 family iso [edit logical-systems LS3 interfaces lo0 unit 3] user@R1# set family iso address 49.0001.1234.1600.2231.00
在接口上启用 IS-IS。
[edit logical-systems LS3 protocols isis] user@R1# set interface lt-1/2/0.3 user@R1# set interface lt-1/2/0.5 user@R1# set interface lo0.3 passive
在逻辑系统 LS3 上配置默认路由。
[edit logical-systems LS3 routing-options] user@R1# set static route 0.0.0.0/0 discard user@R1# set static route 0.0.0.0/0 no-install
在逻辑系统 LS3 上配置默认路由策略。
[edit logical-systems LS3 policy-options] user@R1# set policy-statement isis-default from protocol static user@R1# set policy-statement isis-default from route-filter 0.0.0.0/0 exact user@R1# set policy-statement isis-default then accept
将导出策略应用于逻辑系统 LS3 上的 IS-IS。
[edit logical-systems LS3 protocols isis] user@R1# set export isis-default
如果完成设备配置,请提交配置。
[edit] user@R1# commit
结果
在配置模式下,发出 show logical-systems LS3 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R1# show logical-systems LS3
interfaces {
lt-1/2/0 {
unit 3 {
description LS3->LS2;
encapsulation ethernet;
peer-unit 4;
family inet {
address 10.0.2.1/30;
}
family iso;
}
unit 5 {
description LS3->LS1;
encapsulation ethernet;
peer-unit 0;
family inet {
address 10.0.1.1/30;
}
family iso;
}
}
lo0 {
unit 3 {
family iso {
address 49.0001.1234.1600.2231.00;
}
}
}
}
protocols {
isis {
export isis-default;
interface lt-1/2/0.3;
interface lt-1/2/0.5;
interface lo0.3 {
passive;
}
}
}
policy-options {
policy-statement isis-default {
from {
protocol static;
route-filter 0.0.0.0/0 exact;
}
then accept;
}
}
routing-options {
static {
route 0.0.0.0/0 {
discard;
no-install;
}
}
}
}
验证
确认配置工作正常。
验证静态路由是否已重新分配
目的
通过检查路由表来确保 IS-IS 策略正常工作。
行动
user@R1> show route logical-system LS3
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:00:45
Discard
10.0.0.0/30 *[IS-IS/15] 1w0d 10:14:14, metric 20
to 10.0.2.2 via lt-1/2/0.3
> to 10.0.1.2 via lt-1/2/0.5
10.0.1.0/30 *[Direct/0] 1w0d 10:15:18
> via lt-1/2/0.5
10.0.1.1/32 *[Local/0] 1w0d 10:15:18
Local via lt-1/2/0.5
10.0.2.0/30 *[Direct/0] 1w0d 10:15:18
> via lt-1/2/0.3
10.0.2.1/32 *[Local/0] 1w0d 10:15:18
Local via lt-1/2/0.3
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
49.0001.1234.1600.2231/72
*[Direct/0] 1w0d 10:17:19
> via lo0.3
user@R1> show route logical-system LS2
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[IS-IS/160] 00:01:38, metric 10
> to 10.0.2.1 via lt-1/2/0.4
10.0.0.0/30 *[Direct/0] 1w0d 10:16:11
> via lt-1/2/0.1
10.0.0.2/32 *[Local/0] 1w0d 10:16:11
Local via lt-1/2/0.1
10.0.1.0/30 *[IS-IS/15] 1w0d 10:15:07, metric 20
> to 10.0.0.1 via lt-1/2/0.1
to 10.0.2.1 via lt-1/2/0.4
10.0.2.0/30 *[Direct/0] 1w0d 10:16:11
> via lt-1/2/0.4
10.0.2.2/32 *[Local/0] 1w0d 10:16:11
Local via lt-1/2/0.4
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
49.0001.1720.1600.2002/72
*[Direct/0] 1w0d 10:18:12
> via lo0.2
user@R1> show route logical-system LS1
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[IS-IS/160] 00:02:01, metric 10
> to 10.0.1.1 via lt-1/2/0.0
10.0.0.0/30 *[Direct/0] 1w0d 10:16:34
> via lt-1/2/0.2
10.0.0.1/32 *[Local/0] 1w0d 10:16:34
Local via lt-1/2/0.2
10.0.1.0/30 *[Direct/0] 1w0d 10:16:34
> via lt-1/2/0.0
10.0.1.2/32 *[Local/0] 1w0d 10:16:34
Local via lt-1/2/0.0
10.0.2.0/30 *[IS-IS/15] 1w0d 10:15:55, metric 20
to 10.0.1.1 via lt-1/2/0.0
> to 10.0.0.2 via lt-1/2/0.2
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
49.0001.1720.1600.1001/72
*[Direct/0] 1w0d 10:18:35
> via lo0.1
意义
逻辑系统 LS3 上的路由表包含来自协议 Static的默认 0.0.0.0/0 路由。逻辑系统 LS1 和逻辑系统 LS2 上的路由表包含来自协议 IS-IS的默认 0.0.0.0/0 路由。如果逻辑系统 LS1 和逻辑系统 LS2 收到发往其路由表中未指定的网络的数据包,则这些数据包将被发送到逻辑系统 LS3 进行进一步处理。此配置假定逻辑系统 LS3 已连接到 ISP 或其他外部网络。
