天天看点

配置路由策略

实验:配置路由策略

环境: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

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

Ethernet0/0 13.1.1.3 YES manual up up

Ethernet0/1 unassigned YES unset administratively down down

R3#show run | s rip

router rip

network 13.0.0.0

R3#

R4#show ip interface brief

Ethernet0/0 14.1.1.4 YES manual up up

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

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

0 12.1.1.2 Et0/0 11 00:54:30 2000 5000 0 1

R1#show run | s rip

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

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

(3)在R1上将EIGRP学习到的路由重分布进RIP:

R1(config)#router rip

R1(config-router)#redi

R1(config-router)#redistribute eig

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

C 13.1.1.0/24 is directly connected, Ethernet0/0

L 13.1.1.3/32 is directly connected, Ethernet0/0

(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

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

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

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

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

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

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

(10)查看OSPF路由器R4的路由表:

R4#show ip route

C 14.1.1.0/24 is directly connected, Ethernet0/0

L 14.1.1.4/32 is directly connected, Ethernet0/0

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

R2#sh ip route

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

L 12.1.1.2/32 is directly connected, Ethernet0/0

(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

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)#redistribute connected route-map NET15

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

R2#sh ip route

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

继续阅读