拓扑图中的节点都在areaID为49.0001的区域中。由于IS-IS的地址都是基于ISO形式的,所以每个参与IS-IS的接口都要封装成ISO格式,一个节点的NET地址是基于环回口来分配地址的,并且从7.2版本后环回口默认是passive的,本实验是基于单区域来分析ISIS的路由学习过程的,以下是配置脚本:olive# show logical-systems
r1 {
interfaces {
em1 {
unit 12 {
vlan-id 12;
family inet {
address 10.0.4.5/30;
}
family iso;//每个参与IS-IS进程的接口都要封装成iso格式
}
unit 13 {
vlan-id 13;
family inet {
address 10.0.4.14/30;
}
family iso;
}
}
lo0 {
unit 1 {
family inet {
address 10.0.0.1/32;
}
family iso {
address 49.0001.0000.0000.0001.00;
}//49代表私有AFI,区域ID为0001,systemID为0000.0000.0001(同区域中的systemID必须具有惟一性),n-selector统一为00
}
}
}
protocols {
isis {
interface em1.12 {
level 2 disable;//通告的借口默认都通告到level1和2网络中去,此命令是阻止该接口被通告到level2网络中去
}
interface em1.13 {
level 2 disable;
}
interface lo0.1;//环回口默认都是passive的
}
}
}
r2 {
interfaces {
em2 {
unit 21 {
vlan-id 12;
family inet {
address 10.0.4.6/30;
}
family iso;
family mpls;
}
unit 23 {
vlan-id 23;
family inet {
address 10.0.4.2/30;
}
family iso;
}
unit 24 {
vlan-id 24;
family inet {
address 10.0.4.10/30;
}
family iso;
}
}
lo0 {
unit 2 {
family inet {
address 10.0.0.2/32;
}
family iso {
address 49.0001.0000.0000.0002.00;
}//AFI为私有的49,areaID为0001,systemID为0000.0000.0002
}
}
}
protocols {
isis {
interface em2.21 {
level 2 disable;
}
interface em2.23 {
level 2 disable;
}
interface lo0.2 {
passive;
}
}
}
}
r3 {
interfaces {
em3 {
unit 31 {
vlan-id 13;
family inet {
address 10.0.4.13/30;
}
family iso;
}
unit 32 {
vlan-id 23;
family inet {
address 10.0.4.1/30;
}
family iso;
}
unit 34 {
vlan-id 34;
family inet {
address 10.0.2.5/30;
}
family iso;
}
unit 35 {
vlan-id 35;
family inet {
address 10.0.2.2/30;
}
}
}
lo0 {
unit 3 {
family inet {
address 10.0.0.3/32;
}
family iso {
address 49.0001.0000.0000.0003.00;
}
}
}
}
protocols {
isis {
interface em3.31 {
level 2 disable;
}
interface em3.32 {
level 2 disable;
}
interface em3.34 {
level 1 disable;
}
interface lo0.3 {
passive;
}
}
}
}
r4 {
interfaces {
em4 {
unit 42 {
vlan-id 24;
family inet {
address 10.0.4.9/30;
}
}
unit 43 {
vlan-id 34;
family inet {
address 10.0.2.6/30;
}
family iso;
}
unit 45 {
vlan-id 45;
family inet {
address 10.0.2.10/30;
}
family iso;
}
}
lo0 {
unit 4 {
family inet {
address 10.0.0.4/32;
}
family iso {
address 49.0001.0000.0000.0004.00;
}
}
}
}
protocols {
isis {
interface em4.43 {
level 1 disable;
}
interface em4.45 {
level 1 disable;
}
interface lo0.4 {
passive;
}
}
}
}
r5 {
interfaces {
em5 {
unit 53 {
vlan-id 35;
family inet {
address 10.0.2.1/30;
}
}
unit 54 {
vlan-id 45;
family inet {
address 10.0.2.9/30;
}
family iso;
}
unit 56 {
vlan-id 56;
family inet {
address 10.0.8.6/30;
}
family iso;
}
unit 57 {
vlan-id 57;
family inet {
address 10.0.8.9/30;
}
family iso;
}
}
lo0 {
unit 5 {
family inet {
address 10.0.0.5/32;
}
family iso {
address 49.0001.0000.0000.0005.00;
}
}
}
}
protocols {
isis {
interface em5.54 {
level 1 disable;
}
interface em5.56 {
level 2 disable;
}
interface em5.57 {
level 2 disable;
}
interface lo0.5 {
passive;
}
}
}
}
r6 {
interfaces {
em6 {
unit 65 {
vlan-id 56;
family inet {
address 10.0.8.5/30;
}
family iso;
}
unit 67 {
vlan-id 67;
family inet {
address 10.0.8.1/30;
}
family iso;
}
}
lo0 {
unit 6 {
family inet {
address 10.0.0.6/32;
}
family iso {
address 49.0001.0000.0000.0006.00;
}
}
}
}
protocols {
isis {
interface em6.65 {
level 2 disable;
}
interface em6.67 {
level 2 disable;
}
interface lo0.6 {
passive;
}
}
}
}
r7 {
interfaces {
em7 {
unit 75 {
vlan-id 57;
family inet {
address 10.0.8.10/30;
}
family iso;
}
unit 76 {
vlan-id 67;
family inet {
address 10.0.8.2/30;
}
family iso;
}
}
lo0 {
unit 7 {
family inet {
address 10.0.0.7/32;
}
family iso {
address 49.0001.0000.0000.0007.00;
}
}
}
}
protocols {
isis {
interface em7.75 {
level 2 disable;
}
interface em7.76 {
level 2 disable;
}
interface lo0.7 {
passive;
}
}
}
}
查看IS-IS接口状态
olive# run show isis interface logical-system all
logical-system: r1
IS-IS interface database:
Interface L CirID Level 1 DR Level 2 DR L1/L2 Metric
em1.12 1 0x1 -r1.00 Disabled// 在这个接 10/10 口中level2被disable掉了,所以该接口不再参与level2进程
em1.13 1 0x1 -r3.02 Disabled 10/10
lo0.1 0 0x1 Passive Passive//环回口默认passive 0/0
-----
logical-system: r2
em2.21 1 0x2 -r2.00 Disabled 10/10
em2.23 1 0x1 -r3.03 Disabled 10/10
lo0.2 0 0x1 Passive Passive 0/0
-----
logical-system: r5
em5.54 2 0x2 Disabled -r5.02 10/10
em5.56 1 0x1 -r6.02 Disabled 10/10
em5.57 1 0x1 -r7.03 Disabled 10/10
lo0.5 0 0x1 Passive Passive 0/0
-----
logical-system: r4
em4.43 2 0x2 Disabled -r4.02 10/10
em4.45 2 0x1 Disabled -r5.02 10/10
lo0.4 0 0x1 Passive Passive 0/0
-----
logical-system: r3
em3.31 1 0x2 -r3.02 Disabled 10/10
em3.32 1 0x3 -r3.03 Disabled 10/10
em3.34 2 0x1 Disabled -r4.02 10/10
lo0.3 0 0x1 Passive Passive 0/0
-----
logical-system: r7
em7.75 1 0x3 -r7.03 Disabled 10/10
em7.76 1 0x2 -r7.02 Disabled 10/10
lo0.7 0 0x1 Passive Passive 0/0
-----
logical-system: r6
em6.65 1 0x2 -r6.02 Disabled 10/10
em6.67 1 0x1 -r7.02 Disabled 10/10
lo0.6 0 0x1 Passive Passive 0/0
查看isis adjacency状态
olive> show isis adjacency logical-system all
logical-system: r1
Interface System L State Hold (secs) SNPA
em1.12 -r2 1 Up 6 0:c:29:ef:61:93
em1.13 -r3 1 Up 6 0:c:29:ef:61:9d
-----
logical-system: r2
em2.21 -r1 1 Up 23 0:c:29:ef:61:89
em2.23 -r3 1 Up 6 0:c:29:ef:61:9d
-----
logical-system: r5
em5.54 -r4 2 Up 21 0:c:29:ef:61:a7
em5.56 -r6 1 Up 8 0:c:29:ef:61:bb
em5.57 -r7 1 Up 6 0:c:29:ef:61:c5
-----
logical-system: r4
em4.43 -r3 2 Up 20 0:c:29:ef:61:9d
em4.45 -r5 2 Up 7 0:c:29:ef:61:b1
-----
logical-system: r3
em3.31 -r1 1 Up 26 0:c:29:ef:61:89
em3.32 -r2 1 Up 20 0:c:29:ef:61:93
em3.34 -r4 2 Up 7 0:c:29:ef:61:a7
-----
logical-system: r7
em7.75 -r5 1 Up 22 0:c:29:ef:61:b1
em7.76 -r6 1 Up 23 0:c:29:ef:61:bb
-----
logical-system: r6
em6.65 -r5 1 Up 21 0:c:29:ef:61:b1
em6.67 -r7 1 Up 6 0:c:29:ef:61:c5
查看IS-IS路由信息
olive> show route protocol isis logical-system all
logical-system: r1
inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.2/32 *[IS-IS/15] 00:01:48, metric 10
> to 10.0.4.6 via em1.12
10.0.0.3/32 *[IS-IS/15] 00:01:23, metric 10
> to 10.0.4.13 via em1.13
10.0.4.0/30 *[IS-IS/15] 00:01:23, metric 20
> to 10.0.4.6 via em1.12
to 10.0.4.13 via em1.13
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
-----
logical-system: r2
inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.1/32 *[IS-IS/15] 00:01:48, metric 10
> to 10.0.4.5 via em2.21
10.0.0.3/32 *[IS-IS/15] 00:00:58, metric 10
> to 10.0.4.1 via em2.23
10.0.4.12/30 *[IS-IS/15] 00:00:58, metric 20
> to 10.0.4.5 via em2.21
to 10.0.4.1 via em2.23
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
-----
logical-system: r5
inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.1/32 *[IS-IS/18] 00:01:22, metric 30
> to 10.0.2.10 via em5.54
10.0.0.2/32 *[IS-IS/18] 00:00:58, metric 30
> to 10.0.2.10 via em5.54
10.0.0.3/32 *[IS-IS/18] 00:01:22, metric 20
> to 10.0.2.10 via em5.54
10.0.0.4/32 *[IS-IS/18] 00:01:46, metric 10
> to 10.0.2.10 via em5.54
10.0.0.6/32 *[IS-IS/15] 00:01:45, metric 10
> to 10.0.8.5 via em5.56
10.0.0.7/32 *[IS-IS/15] 00:00:56, metric 10
> to 10.0.8.10 via em5.57
10.0.2.4/30 *[IS-IS/18] 00:01:46, metric 20
> to 10.0.2.10 via em5.54
10.0.4.0/30 *[IS-IS/18] 00:01:22, metric 30
> to 10.0.2.10 via em5.54
10.0.4.4/30 *[IS-IS/18] 00:01:22, metric 40
> to 10.0.2.10 via em5.54
10.0.4.12/30 *[IS-IS/18] 00:01:22, metric 30
> to 10.0.2.10 via em5.54
10.0.8.0/30 *[IS-IS/15] 00:00:56, metric 20
> to 10.0.8.5 via em5.56
to 10.0.8.10 via em5.57
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
-----
logical-system: r4
inet.0: 19 destinations, 19 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.1/32 *[IS-IS/18] 00:01:22, metric 20
> to 10.0.2.5 via em4.43
10.0.0.2/32 *[IS-IS/18] 00:00:58, metric 20
> to 10.0.2.5 via em4.43
10.0.0.3/32 *[IS-IS/18] 00:01:22, metric 10
> to 10.0.2.5 via em4.43
10.0.0.5/32 *[IS-IS/18] 00:01:46, metric 10
> to 10.0.2.9 via em4.45
10.0.0.6/32 *[IS-IS/18] 00:01:44, metric 20
> to 10.0.2.9 via em4.45
10.0.0.7/32 *[IS-IS/18] 00:00:56, metric 20
> to 10.0.2.9 via em4.45
10.0.4.0/30 *[IS-IS/18] 00:01:22, metric 20
> to 10.0.2.5 via em4.43
10.0.4.4/30 *[IS-IS/18] 00:01:22, metric 30
> to 10.0.2.5 via em4.43
10.0.4.12/30 *[IS-IS/18] 00:01:22, metric 20
> to 10.0.2.5 via em4.43
10.0.8.0/30 *[IS-IS/18] 00:01:44, metric 30
> to 10.0.2.9 via em4.45
10.0.8.4/30 *[IS-IS/18] 00:01:46, metric 20
> to 10.0.2.9 via em4.45
10.0.8.8/30 *[IS-IS/18] 00:01:46, metric 20
> to 10.0.2.9 via em4.45
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
----
logical-system: r3
inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.1/32 *[IS-IS/15] 00:01:23, metric 10
> to 10.0.4.14 via em3.31
10.0.0.2/32 *[IS-IS/15] 00:00:58, metric 10
> to 10.0.4.2 via em3.32
10.0.0.4/32 *[IS-IS/18] 00:01:22, metric 10
> to 10.0.2.6 via em3.34
10.0.0.5/32 *[IS-IS/18] 00:01:08, metric 20
> to 10.0.2.6 via em3.34
10.0.0.6/32 *[IS-IS/18] 00:01:08, metric 30
> to 10.0.2.6 via em3.34
10.0.0.7/32 *[IS-IS/18] 00:00:56, metric 30
> to 10.0.2.6 via em3.34
10.0.2.8/30 *[IS-IS/18] 00:01:22, metric 20
> to 10.0.2.6 via em3.34
10.0.4.4/30 *[IS-IS/15] 00:00:58, metric 20
> to 10.0.4.14 via em3.31
to 10.0.4.2 via em3.32
10.0.8.0/30 *[IS-IS/18] 00:01:08, metric 40
> to 10.0.2.6 via em3.34
10.0.8.4/30 *[IS-IS/18] 00:01:08, metric 30
> to 10.0.2.6 via em3.34
10.0.8.8/30 *[IS-IS/18] 00:01:08, metric 30
> to 10.0.2.6 via em3.34
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
-----
logical-system: r7
inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.5/32 *[IS-IS/15] 00:00:56, metric 10
> to 10.0.8.9 via em7.75
10.0.0.6/32 *[IS-IS/15] 00:01:19, metric 10
> to 10.0.8.1 via em7.76
10.0.8.4/30 *[IS-IS/15] 00:00:56, metric 20
> to 10.0.8.9 via em7.75
to 10.0.8.1 via em7.76
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
-----
logical-system: r6
inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.5/32 *[IS-IS/15] 00:01:45, metric 10
> to 10.0.8.6 via em6.65
10.0.0.7/32 *[IS-IS/15] 00:01:19, metric 10
> to 10.0.8.2 via em6.67
10.0.8.8/30 *[IS-IS/15] 00:01:19, metric 20
to 10.0.8.6 via em6.65
> to 10.0.8.2 via em6.67
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) 默认
由于juniper路由器默认不会从level2向level1通告学习到的路由,所以在这里我们可以向level1路由器r1,r2,r6,r7注入一条默认路由
r3中的配置:set rouing-options static route 0/0 discard edit policy-options policy-statement export-default
set temr 1 from router-filter 0/0 exact
set term 1 then accept
edit protocol isis export export-default//将策略注入到isis中
r5的配置同上,此时我们可以看到r1,r2,r6,r7就会存在一条默认路由了
转载于:https://blog.51cto.com/rista/961204