實驗:配置路由政策
環境: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