ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

配置路由策略

2021-04-12 17:51:12  阅读:231  来源: 互联网

标签:策略 type Ethernet0 配置 EIGRP connected external OSPF 路由


实验:配置路由策略
环境:EVE
涉及协议: RIP OSPF EIGRP BGP

配置路由策略![]

首先看下实验需要的拓扑以及IP地址协议

配置路由策略![]

这是小编搭的哈哈哈 这个颜色很漂亮吧

首先查看接口是否UP IP地址的配置 以及协议是否起来了
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 12.1.1.1 YES manual up up
Ethernet0/1 13.1.1.1 YES manual up up
Ethernet0/2 15.1.1.1 YES manual up up
Ethernet0/3 14.1.1.1 YES manual up up
R1#

R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 12.1.1.2 YES manual up up
Ethernet0/1 10.1.1.1 YES manual up up
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
R2#show ip eig
R2#show ip eigrp nei
R2#show ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(1)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 12.1.1.1 Et0/0 11 00:45:14 1 3000 0 1
R2#

R3#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 13.1.1.3 YES manual up up
Ethernet0/1 unassigned YES unset administratively down down
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
R3#show run | s rip
router rip
network 13.0.0.0
R3#

R4#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 14.1.1.4 YES manual up up
Ethernet0/1 unassigned YES unset administratively down down
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
R4#show ip os
R4#show ip ospf nei
R4#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
15.1.1.1 1 FULL/BDR 00:00:38 14.1.1.1 Ethernet0/0
R4#

R5#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 15.1.1.5 YES manual up up
Ethernet0/1 10.1.1.1 YES manual up up
R5#show ip bgp neighbors
BGP neighbor is 15.1.1.1, remote AS 2, external link
BGP version 4, remote router ID 15.1.1.1
BGP state = Established, up for 00:10:41
Last read 00:00:40, last write 00:00:32, hold time is 180, keepalive interval is 60 seconds
Neighbor sessions:
1 active, is not multisession capable (disabled)
Neighbor capabilities:
Route refresh: advertised and received(new)
Four-octets ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Enhanced Refresh Capability: advertised and received
Multisession Capability:
Stateful switchover support enabled: NO for session 1
Message statistics:
InQ depth is 0
OutQ depth is 0
都没啥问题 接下来看题:

(1)查看R1当前各协议的邻居状态:

R1#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
14.1.1.4 1 FULL/DR 00:00:33 14.1.1.4 Ethernet0/3
R1#show ip eig
R1#show ip eigrp neig
R1#show ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(1)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 12.1.1.2 Et0/0 11 00:54:30 2000 5000 0 1
R1#show run | s rip
router rip
network 13.0.0.0
R1#show ip b
R1#show ip bgp neig
R1#show ip bgp neighbors
BGP neighbor is 15.1.1.5, remote AS 1, external link
BGP version 4, remote router ID 15.1.1.5
BGP state = Established, up for 00:17:10
Last read 00:00:33, last write 00:00:12, hold time is 180, keepalive interval is 60 seconds
Neighbor sessions:
1 active, is not multisession capable (disabled)

R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

    • replicated route, % - next hop override

Gateway of last resort is not set

  12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C 12.1.1.0/24 is directly connected, Ethernet0/0
L 12.1.1.1/32 is directly connected, Ethernet0/0
13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 13.1.1.0/24 is directly connected, Ethernet0/1
L 13.1.1.1/32 is directly connected, Ethernet0/1
14.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 14.1.1.0/24 is directly connected, Ethernet0/3
L 14.1.1.1/32 is directly connected, Ethernet0/3
15.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 15.1.1.0/24 is directly connected, Ethernet0/2
L 15.1.1.1/32 is directly connected, Ethernet0/2
R1#
R1#
(3)在R1上将EIGRP学习到的路由重分布进RIP:

R1(config)#router rip
R1(config-router)#redi
R1(config-router)#redistribute eig
R1(config-router)#redistribute eigrp
R1(config-router)#redistribute eigrp
% Incomplete command.

R1(config-router)#redistribute eigrp ?
<1-65535> AS number

R1(config-router)#redistribute eigrp 1
R1(config-router)#do wr

4)查看RIP路由器R3的路由表:
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 13.1.1.0/24 is directly connected, Ethernet0/0
L 13.1.1.3/32 is directly connected, Ethernet0/0
R3#

(5)修改RIP重分布时的默认Metric值:

R1(config-router)#
*Apr 11 07:57:15.072: %CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on Ethernet0/2 (not full duplex), with R5 Ethernet0/0 (full duplex).
R1(config-router)#default-metric 10
R1(config-router)#

(6)再次查看RIP路由器R3的路由表:

R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
Gateway of last resort is not set
R 12.0.0.0/8 [120/10] via 13.1.1.1, 00:00:26, Ethernet0/0
13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 13.1.1.0/24 is directly connected, Ethernet0/0
L 13.1.1.3/32 is directly connected, Ethernet0/0

(7)手工指定EIGRP重分布进RIP时的Metric值:

R1(config-router)#redistribute eigrp 1 metric 15
R1(config-router)#do wr

(8)再次查看RIP路由器R3的路由表:
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

Gateway of last resort is not set

R 12.0.0.0/8 [120/15] via 13.1.1.1, 00:00:22, Ethernet0/0
13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 13.1.1.0/24 is directly connected, Ethernet0/0
L 13.1.1.3/32 is directly connected, Ethernet0/0
R3#

(10)查看OSPF路由器R4的路由表:
R4#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
14.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 14.1.1.0/24 is directly connected, Ethernet0/0
L 14.1.1.4/32 is directly connected, Ethernet0/0
R4#

(16)查看EIGRP路由器R2的路由表:
R2#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/1
L 10.1.1.1/32 is directly connected, Ethernet0/1
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, Ethernet0/0
L 12.1.1.2/32 is directly connected, Ethernet0/0
R2#

(17)修改重分布进EIGRP时的默认Metric值:
R1(config)#router eigrp 1
R1(config-router)#default-metric 10000 100 255 1 1500
将其他协议重分布进eigrp的时候必须带上metric参数,这五个参数分别是指bangwidth、delay、reliability、loading、MTU

(18)再次查看EIGRP路由器R2的路由表:
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/1
L 10.1.1.1/32 is directly connected, Ethernet0/1
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, Ethernet0/0
L 12.1.1.2/32 is directly connected, Ethernet0/0
14.0.0.0/24 is subnetted, 1 subnets
D EX 14.1.1.0 [170/307200] via 12.1.1.1, 00:00:24, Ethernet0/0
(19)重分布直连路由进EIGRP时使用Route-MAP:
R1(config)#route-map NET15 permit 10
R1(config-route-map)#match interface ethernet 0/2
R1(config)#router eigrp 1
R1(config-router)#redistribute connected route-map NET15

(20)查看EIGRP路由器R2的路由表:
R2#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/1
L 10.1.1.1/32 is directly connected, Ethernet0/1
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, Ethernet0/0
L 12.1.1.2/32 is directly connected, Ethernet0/0
15.0.0.0/24 is subnetted, 1 subnets
D EX 15.1.1.0 [170/307200] via 12.1.1.1, 00:00:15, Ethernet0/0

只有与Route-Map中定义的接口相匹配的serial 1/0被重分布进了EIGRP

(21)改变重分布直连路由进EIGRP时使用Route-MAP
R1(config)#router eigrp 1
R1(config-route-map)#match interface s1/0
R1(config-route-map)#match interface et
R1(config-route-map)#match interface ethernet 0/2
R1(config-route-map)#exit
R1(config)#route-map EIGRP permit 20
R1(config-route-map)#exit
r1(config)#router eigrp 1
r1(config-router)#no redistribute connected route-map NET15
r1(config-router)#redistribute connected route-map EIGRP

(22)查看EIGRP路由器R2的路由表:

R2#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/1
L 10.1.1.1/32 is directly connected, Ethernet0/1
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, Ethernet0/0
L 12.1.1.2/32 is directly connected, Ethernet0/0
13.0.0.0/24 is subnetted, 1 subnets
D EX 13.1.1.0 [170/307200] via 12.1.1.1, 00:00:08, Ethernet0/0
14.0.0.0/24 is subnetted, 1 subnets
D EX 14.1.1.0 [170/307200] via 12.1.1.1, 00:00:17, Ethernet0/0
R2#
修改Route-Map后,除了接口e0/2的路由没有之外,其它的都在

标签:策略,type,Ethernet0,配置,EIGRP,connected,external,OSPF,路由
来源: https://blog.51cto.com/u_14813861/2701744

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有