实验:配置路由策略
环境: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
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的路由没有之外,其它的都在

©著作权归作者所有:来自51CTO博客作者MindyJ的原创作品,如需转载,请注明出处,否则将追究法律责任

好知识,才能预见未来

赞赏

0人进行了赞赏支持

更多相关文章

  1. Forefront TMG+路由器后Internet不能正常访问内网的Web服务器和
  2. docker系列-运行nginx静态网站
  3. 查看服务器性能工具
  4. Linux常用的shell命令汇总
  5. Oracle Namespace 说明
  6. mysql 最基础的日常操作
  7. Oracle OCP 071【中文题库】考试题-第19题
  8. confluence与jira账号对接、查看到期时间及问题总结
  9. 查找命令汇总

随机推荐

  1. centos下安装adb环境
  2. android:inputType参数类型说明
  3. Android通过PHP连接MySQL(传值查询)
  4. 【android】两个按钮的宽度各占屏幕的一
  5. RelativeLayout常用属性介绍
  6. Android的Selector与Shape
  7. android 各个属性
  8. Android实战技巧之二十二:Android 5.1 SDK
  9. android.webkit.WebView/WebViewClient/W
  10. android 资料地址