实验要求:
配置路由器重分发,实现全网互通。
实验规划:
实验拓扑图:
地址规划:
IOU1 | e0/1:10.0.16.1/24 | loop0:1.1.1.1/32 |
e0/0:10.0.12.2/24 | ||
IOU2 | e0/0:10.0.12.1/24 | loop0:2.2.2.2/32 |
e0/1:10.0.23.1/24 | ||
e0/2:10.0.56.1/24 | ||
IOU3 | e0/0:10.0.23.2/24 | loop0:3.3.3.3/32 |
e0/1:10.0.34.1/24 | ||
IOU4 | e0/0:10.0.34.2/24 | loop0:4.4.4.4/32 |
e0/1:10.0.45.1/24 | ||
IOU5 | e0/0:10.0.45.2/24 | loop0:172.16.0.1/24 |
loop1:172.16.1.1/24 | ||
loop2:172.16.2.1/24 | ||
loop3:172.16.3.1/24 | ||
IOU6 | e0/0:10.0.16.0/24 | loop0:6.6.6.6/32 |
vlan 10:192.168.0.1/24 | ||
vlan 20:192.168.1.1/24 | ||
vlan 30:192.168.2.1/24 | ||
vlan 40:192.168.3.1/24 | ||
IOU8 | e0/0:10.0.56.2/24 | loop0:8.8.8.8/32 |
e0/1:10.0.67.1/24 | ||
IOU9 | e0/0:10.0.67.2/24 |
实验配置:
IOU1:
config terminal
interface e0/0
ip address 10.0.12.1 255.255.255.0
no shutdown
interface e0/1
duplex full
ip address 10.0.16.1 255.255.255.0
no shutdown
interface loopback 0
ip address 1.1.1.1 255.255.255.255
no shutdown
exit
ip route 192.168.0.0 255.255.255.252 10.0.16.2
router ospf 1
router-id 1.1.1.1
network 1.1.1.1 0.0.0.0 area 1
network 10.0.12.0 0.0.0.255 area 1
network 10.0.16.0 0.0.0.255 area 1
exit
IOU2:
config terminal
interface e0/0
ip address 10.0.12.2 255.255.255.0
no shutdown
interface e0/1
ip address 10.0.23.1 255.255.255.0
no shutdown
interface e0/2
ip address 10.0.56.1 255.255.255.0
no shutdown
interface loopback 0
ip address 2.2.2.2 255.255.255.255
no shutdown
exit
router ospf 1
router-id 2.2.2.2
area 3 nssa no-summary //配置NSSA区域
area 3 nssa default-information-originate //配置生成LSA默认路由
network 10.0.12.0 0.0.0.255 area 1
network 10.0.23.0 0.0.0.255 area 0
network 10.0.56.0 0.0.0.255 area 3
network 2.2.2.2 0.0.0.0 area 0
exit
IOU3:
config terminal
interface e0/0
ip address 10.0.23.2 255.255.255.0
no shutdown
interface e0/1
ip address 10.0.34.1 255.255.255.0
no shutdown
interface loopback 0
ip address 3.3.3.3 255.255.255.255
no shutdown
exit
router ospf 1
router-id 3.3.3.3
network 10.0.23.0 0.0.0.255 area 0
network 10.0.34.0 0.0.0.255 area 2
network 3.3.3.3 0.0.0.0 area 0
exit
IOU4:
config terminal
interface e0/0
ip address 10.0.34.2 255.255.255.0
no shutdown
interface e0/1
ip address 10.0.45.1 255.255.255.0
no shutdown
interface loopback 0
ip address 4.4.4.4 255.255.255.255
no shutdown
exit
router ospf 1
router-id 4.4.4.4
network 10.0.34.0 0.0.0.255 area 2
network 4.4.4.4 0.0.0.0 area 2
redistribute rip subnets
exit
router rip
version 2
no auto-summary
network 10.0.45.0
redistribute ospf 1 metric 3
exit
IOU5:
config terminal
interface e0/0
ip address 10.0.45.2 255.255.255.0
no shutdown
interface loopback 0
ip address 172.16.0.1 255.255.255.0
no shutdown
interface loopback 1
ip address 172.16.1.1 255.255.255.0
no shutdown
interface loopback 2
ip address 172.16.2.1 255.255.255.0
no shutdown
interface loopback 3
ip address 172.16.3.1 255.255.255.0
no shutdown
exit
router rip
version 2
no auto-summary
network 10.0.45.0
network 172.16.0.0
network 172.16.1.0
network 172.16.2.0
network 172.16.3.0
redistribute ospf 1 metric 3
exit
IOU6:
config terminal
vlan 10,20,30,40
interface e0/0
switchport trunk encapsulation dot1q
switchport mode trunk
no switchport
ip address 10.0.16.2 255.255.255.0
no shutdown
interface loopback 0
ip address 6.6.6.6 255.255.255.255
no shutdown
interface vlan 10
ip address 192.168.1.1 255.255.255.0
no shutdown
interface vlan 20
ip address 192.168.2.1 255.255.255.0
no shutdown
interface vlan 30
ip address 192.168.3.1 255.255.255.0
no shutdown
interface vlan 40
ip address 192.168.4.1 255.255.255.0
no shutdown
exit
router ospf 1
network 10.0.16.0 0.0.0.255 area 1
network 192.168.1.0 0.0.0.255 area 1
network 192.168.2.0 0.0.0.255 area 1
network 192.168.3.0 0.0.0.255 area 1
network 192.168.4.0 0.0.0.255 area 1
exit
IOU8:
config terminal
interface e0/0
ip address 10.0.56.2 255.255.255.0
no shutdown
interface e0/1
ip address 10.0.67.1 255.255.255.0
no shutdown
exit
router ospf 1
area 3 nssa no-summary
area 3 nssa default-information-originate
network 10.0.56.0 0.0.0.255 area 3
redistribute rip subnets
exit
router rip
version 2
no auto-summary
network 10.0.67.0
redistribute ospf 1 metric 3
exit
IOU9:
config terminal
interface e0/0
ip address 10.0.67.2 255.255.255.0
no shutdown
exit
router rip
version 2
no auto-summary
network 10.0.67.0
redistribute ospf 1 metric 3
exit
查看路由表:
连通性测试:
(如有疏漏,还请读者指教)