组网需求
- Router A与Router B在同一个自治域,两个路由器之间使用IS-IS协议实现互联互通
- Router B与Router C建立EBGP关系
- 要求各个网段互联互通,AS 65009向AS 65008传递路由时,改变路由的Cost
网络拓扑
配置思路
- 路由器基础配置以及IP地址
- 配置IS-IS协议以及接口使能IS-IS协议
- 配置BGP协议
- 配置路由引入以及路由策略(修改Cost)
配置命令
路由器基础配置以及IP地址
Router A配置
1
2
3
4
5sys
sys Router A
int g0/0/0
ip add 10.1.1.1 30
Router B配置
1
2
3
4
5
6
7
8
9sys
sys Router B
int g0/0/0
ip add 10.1.1.2 30
int g0/0/1
ip add 10.2.1.1 30
int LoopBack 0
ip add 1.1.1.1 32
Router C配置
1
2
3
4
5
6
7sys
sys Router C
int g0/0/1
ip add 10.2.1.2 30
int LoopBack 0
ip add 2.2.2.2 32
配置IS-IS协议以及接口使能IS-IS协议
Router A配置
1
2
3
4
5
6
7
8sys
isis 1
network-entity 10.0100.0100.1001.00
q
int g0/0/0
isis enable 1
isis small-hello
Router B配置
1
2
3
4
5
6
7
8sys
isis 1
network-entity 10.0100.0100.1002.00
q
int g0/0/0
isis enable 1
isis small-hello
配置BGP协议
Router B配置
1
2
3
4
5
6
7
8sys
bgp 65008
router-id 1.1.1.1
peer 10.2.1.2 as-number 65009
ipv4-family unicast
network 10.2.1.0 30
network 1.1.1.1 30
Router C配置
1
2
3
4
5
6
7
8sys
bgp 65009
router-id 2.2.2.2
peer 10.2.1.1 as-number 65008
ipv4-family unicast
network 10.2.1.0 30
network 2.2.2.2 32
配置路由引入以及路由策略(修改Cost)
Router B配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17sys
配置BGP引入IS-IS
bgp 65008
import-route isis 1
bgp路径过滤器
ip as-path-filter 1 permit 65009
配置路由策略
route-policy RTC permit node 0
if-match as-path-filter 1
apply cost 20
配置IS-IS引入BGP
isis 1
import-route bgp route-policy RTC
Router C配置
1
2
3
4
5
6
7
8sys
配置静态路由
ip route-static 200.1.1.1 32 NULL 0
BGP中引入静态路由
bgp 65009
import-route static
查看命令
IS-IS引入BGP路由(未使用路由策略)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 ISIS-L2 15 74 D 10.1.1.2 GigabitEthernet
0/0/0
10.1.1.0/30 Direct 0 0 D 10.1.1.1 GigabitEthernet
0/0/0
10.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
200.1.1.1/32 ISIS-L2 15 74 D 10.1.1.2 GigabitEthernet
0/0/0 #此处的Cost为74
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
IS-IS引入BGP路由(使用路由策略)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 ISIS-L2 15 94 D 10.1.1.2 GigabitEthernet
0/0/0
10.1.1.0/30 Direct 0 0 D 10.1.1.1 GigabitEthernet
0/0/0
10.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
200.1.1.1/32 ISIS-L2 15 94 D 10.1.1.2 GigabitEthernet
0/0/0 # 此处的Cost是94
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
BGP引入IS-IS路由
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24<Router C>dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 EBGP 255 0 RD 10.2.1.1 GigabitEthernet
0/0/1
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.1.1.0/30 EBGP 255 0 RD 10.2.1.1 GigabitEthernet
0/0/1 #引入IS-IS路由
10.2.1.0/30 Direct 0 0 D 10.2.1.2 GigabitEthernet
0/0/1
10.2.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.2.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
200.1.1.1/32 Static 60 0 D 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0