目录
- 实验条件
- 基础配置实现
-
- IGP需求:
-
- 1. 根据拓扑所示,配置OSPF和EIGRP
- 2. 在R3上增加一个网段:33.33.33.0/24 (用Loopback 1模拟) 宣告进EIGRP,并在R3上将EIGRP重分布进OSPF。要求重分布进OSPF后的路由Tag值设置为666,且Cost值能沿传递路径累加。但OSPF区域不能出现33.33.33.0/24这条路由。
- 3. 在R1上看到34.1.1.0/24路由的管理距离为111。
- 4. R1和R2之间不需要选举DR、BDR,但需要使用组播更新。
- 5. 在R2上增加两个网段:22.22.1.0/24,22.22.2.0/24 (用Loopback模拟) 视情况宣告进相关区域。在R2上配置最精确的路由汇总,使得R3能看到汇总路由。
- 6. Area 0区域为保证安全,开启区域密文认证,密码为SPOTO
- 7. Area 1区域需尽量减少路由数量,且不允许引入任何外部路由。
- BGP需求
- IPv6-OSPF需求
- IPv6-BGP需求
实验条件
网络拓朴
IPv4:
拓扑中的IPv4互联地址段采用:AB.1.1.X/24,其中AB为两台路由器编号组合。例如:R1-R2之间的AB为12,X为路由器编号,如R1的X=1
Loopback 0接口地址格式为:X.X.X.X/32,其中X为路由器编号。
没有特殊要求,不允许使用静态路由。
IPv6:
拓扑中的IPv6互联地址采用:2001:AB::X/64,其中AB为两台路由器编号组合。例如:R1-R2之间的AB为12,X为路由器编号,如R1的X=1
Loopback 0接口地址格式为:X:X:X::X/128,其中X为路由器编号。
没有特殊要求,不允许使用静态路由。
基础配置实现
R1
R1(config-if)#do show run | s interface
interface Loopback0
ip address 1.1.1.1 255.255.255.255
interface Ethernet0/0
ip address 12.1.1.1 255.255.255.0
no shutdown
interface Ethernet0/1
ip address 14.1.1.1 255.255.255.0
no shutdown
R2
R2(config-if)#do show run | s interface
interface Loopback0
ip address 2.2.2.2 255.255.255.255
interface Ethernet0/0
ip address 12.1.1.2 255.255.255.0
no shutdown
interface Ethernet0/1
ip address 23.1.1.2 255.255.255.0
no shutdown
R2(config-if)#
R3
R3(config-route-map)#do show run | s interface
interface Loopback0
ip address 3.3.3.3 255.255.255.255
interface Loopback1
ip address 33.33.33.33 255.255.255.0
interface Ethernet0/0
ip address 34.1.1.3 255.255.255.0
no shutdown
interface Ethernet0/1
ip address 23.1.1.3 255.255.255.0
no shutdown
R4
R4(config-router)#do show run | s interface
interface Loopback0
ip address 4.4.4.4 255.255.255.255
interface Ethernet0/0
ip address 34.1.1.4 255.255.255.0
no shutdown
interface Ethernet0/1
ip address 14.1.1.4 255.255.255.0
no shutdown
IGP需求:
1. 根据拓扑所示,配置OSPF和EIGRP
R1
router ospf 100
router-id 1.1.1.1
interface Ethernet0/0
ip ospf 100 area 0
interface Ethernet0/1
ip ospf 100 area 1
R2
router ospf 100
router-id 2.2.2.2
interface Ethernet0/0
ip ospf 100 area 0
interface Ethernet0/1
ip ospf 100 area 2
R3
router ospf 100
router-id 3.3.3.3
interface Ethernet0/1
ip ospf 100 area 2
router eigrp 100
network 3.3.3.3 0.0.0.0
network 34.1.1.3 0.0.0.0
eigrp router-id 3.3.3.3
R4
router eigrp 100
network 4.4.4.4 0.0.0.0
network 34.1.1.4 0.0.0.0
eigrp router-id 4.4.4.4
router ospf 100
router-id 4.4.4.4
interface Ethernet0/1
ip ospf 100 area 1
2. 在R3上增加一个网段:33.33.33.0/24 (用Loopback 1模拟) 宣告进EIGRP,并在R3上将EIGRP重分布进OSPF。要求重分布进OSPF后的路由Tag值设置为666,且Cost值能沿传递路径累加。但OSPF区域不能出现33.33.33.0/24这条路由。
R3
interface Loopback1
ip address 33.33.33.33 255.255.255.0
ip prefix-list R3-summary seq 5 permit 33.33.33.0/24
route-map R3-summary deny 10
match ip address prefix-list R3-summary
route-map R3-summary permit 20
set tag 666
router ospf 100
redistribute eigrp 100 metric-type 1 subnets route-map R3-summary
3. 在R1上看到34.1.1.0/24路由的管理距离为111。
R1路由表记录
34.0.0.0/24 is subnetted, 1 subnets
O E1 34.1.1.0 [111/40] via 12.1.1.2, 00:07:21, Ethernet0/0
在router ospf 配置下,使用distance
access-list 10 permit 34.1.1.0 0.0.0.255
router ospf 100
distance 111 0.0.0.0 255.255.255.255 10
4. R1和R2之间不需要选举DR、BDR,但需要使用组播更新。
把他们的网络类型修改成P2P,就不需要选举DR/BDR了,
R1
interface Ethernet0/0
ip ospf network point-to-point
R2
interface Ethernet0/0
ip ospf network point-to-point
5. 在R2上增加两个网段:22.22.1.0/24,22.22.2.0/24 (用Loopback模拟) 视情况宣告进相关区域。在R2上配置最精确的路由汇总,使得R3能看到汇总路由。
R2
interface Loopback0
ip address 2.2.2.2 255.255.255.255
interface Loopback1
ip address 22.22.1.1 255.255.255.0
router ospf 100
network 22.22.1.1 0.0.0.0 area 0
network 22.22.2.1 0.0.0.0 area 0
area 0 range 22.22.0.0 255.255.252.0
R3收到了来自2.2.2.2的通告信息
R3#show ip ospf database summary 22.22.0.0
OSPF Router with ID (3.3.3.3) (Process ID 100)
Summary Net Link States (Area 2)
LS age: 1683
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 22.22.0.0 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x20EA
Length: 28
Network Mask: /22
MTID: 0 Metric: 1
R3#
6. Area 0区域为保证安全,开启区域密文认证,密码为SPOTO
R1
interface Ethernet0/0
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 SPOTO
R2
interface Ethernet0/0
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 SPOTO
7. Area 1区域需尽量减少路由数量,且不允许引入任何外部路由。
把Area1区域变成末梢区域,就可以实现目的
R1
router ospf 100
area 1 stub no-summary
R2
router ospf 100
area 1 stub
BGP需求
1. R1和R2采用Loopback 0建立IBGP邻居(AS 12),R3和R4采用Loopback 0建立IBGP邻居(AS 34),R1和R4、R2和R3建立EBGP邻居。
R1
router bgp 12
bgp router-id 1.1.1.1
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 12
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 14.1.1.4 remote-as 34