拓补图;
第一步;
配置R22
En
Conf t
Int f0/0
Ip add 192.168.10.254 255.255.255.0
no sh
int f0/1
ip add 192.168.20.254 255.255.255.0
no sh
int e1/1
ip add 192.168.30.254 255.255.255.0
no sh
int e1/0
ip add 192.168.40.254 255.255.255.0
no sh
ex
router ospf 1
router-id 192.168.1.254
network 192.168.1.254 0.0.0.0 area 1
network 192.168.10.0 0.0.0.255 area 1
network 192.168.20.0 0.0.0.255 area 1
network 192.168.30.0 0.0.0.255 area 1
network 192.168.40.0 0.0.0.255 area 1
R20
En
Conf t
Int f0/0
Ip add 192.168.10.1 255.255.255.0
no sh
int f0/1
ip add 192.168.5.254 255.255.255.0
no sh
ex
router ospf 1
router-id 192.168.1.1
network 192.168.1.1 0.0.0.0 area 1
network 192.168.10.0 0.0.0.255 area 1
network 192.168.5.0 0.0.0.255 area 1
R21
En
Conf t
Int f0/0
Ip add 192.168.20.1 255.255.255.0
no sh
int f0/1
ip add 192.168.25.254 255.255.255.0
no sh
ex
router ospf 1
router-id 192.168.1.2
network 192.168.1.2 0.0.0.0 area 1
network 192.168.20.0 0.0.0.255 area 1
network 192.168.25.0 0.0.0.255 area 1
第二部;
R23
En
Conf t
Int f0/0
Ip add 192.168.40.1 255.255.255.0
no sh
int e1/1
ip add 192.168.50.254 255.255.255.0
no sh
int e1/0
ip add 192.168.60.254 255.255.255.0
no sh
ex
router ospf 1
router-id 192.168.1.3
network 192.168.1.3 0.0.0.0 area 1
network 192.168.40.0 0.0.0.255 area 1
network 192.168.50.0 0.0.0.255 area 0
network 192.168.60.0 0.0.0.255 area 0
R24
En
Conf t
Int f0/0
Ip add 192.168.50.1 255.255.255.0
no sh
int e1/0
ip add 192.168.70.254 255.255.255.0
no sh
int f0/1
ip add 192.168.55.254 255.255.255.0
no sh
ex
router ospf 1
router-id 192.168.10.1
network 192.168.10.1 0.0.0.0 area 0
network 192.168.50.0 0.0.0.255 area 0
network 192.168.55.0 0.0.0.255 area 0
network 192.168.70.0 0.0.0.255 area 0
给24配置重分发
Router(config-router)default-information originate
ex
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.55.1
r26
en
conf t
int f0/0
ip add 192.168.55.1 255.255.255.0
no sh
int f0/1
ip add 192.168.56.254 255.255.255.0
no sh
ex
ip route 0.0.0.0 0.0.0.0 192.168.55.254
用pc192.168.30.1ping192.168.56.1
R25
En
Conf t
Int f0/0
Ip add 192.168.60.1 255.255.255.0
no sh
int f0/1
ip add 192.168.80.254 255.255.255.0
no sh
ex
router ospf 1
router-id 192.168.8.1
network 192.168.8.1 0.0.0.0 area 0
network 192.168.60.0 0.0.0.255 area 0
network 192.168.80.0 0.0.0.255 area 0
第三部;
R27
En
Conf t
Int f0/1
Ip add 192.168.70.1 255.255.255.0
No sh
Int f0/0
Ip add 192.168.80.1 255.255.255.0
No sh
Int e1/0
Ip add 192.168.90.254 255.255.255.0
No sh
Int e1/1
Ip add 192.168.110.254 255.255.255.0
No sh
Ex
router ospf 1
router-id 192.168.7.1
network 192.168.7.1 0.0.0.0 area 0
network 192.168.70.0 0.0.0.255 area 0
network 192.168.80.0 0.0.0.255 area 0
network 192.168.90.0 0.0.0.255 area 2
network 192.168.110.0 0.0.0.255 area 3
R30
En
Conf t
Int f0/0
Ip add 192.168.90.1 255.255.255.0
no sh
int f0/1
ip add 192.168.100.254 255.255.255.0
no sh
ex
router ospf 1
router-id 192.168.4.1
network 192.168.4.1 0.0.0.0 area 2
network 192.168.90.0 0.0.0.255 area 2
network 192.168.100.0 0.0.0.255 area 2
给pc18加入ip192.168.100.1 子网掩码192.168.100.254
Ping 192.168.100.1 如果ping不通不要急;先ping192.168.70.1或者192.168.50.1
一点一点ping过去;第一次我也没通;但ping了一下70.1网段就好了;就全通了。
R31
En
Conf t
Int f0/0
Ip add 192.168.110.1 255.255.255.0
no sh
int f0/1
ip add 192.168.120.254 255.255.255.0
no sh
ex
router ospf 1
router-id 192.168.6.2
network 192.168.6.2 0.0.0.0 area 2
network 192.168.110.0 0.0.0.255 area 2
ex
route rip
version 2
network 192.168.120.0
redistribute ospf 1 metric 5
ex
router ospf 1
redistribute rip subnets
R32
En
Conf t
Int f0/0
Ip add 192.168.120.1 255.255.255.0
no sh
int f0/1
ip add 192.168.130.254 255.255.255.0
no sh
ex
route rip
version 2
network 192.168.120.0
network 192.168.130.0
给pc17配置ip192.168.130.1 255.255.255.0 子网掩码192.168.130.254
用pc15的192.168.30.1ping192.168.130.1
全网互通