三台三层交换机OSPF多区域划分动态路由实验
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
三台三层交换机OSPF多区域划分动态路由实验⼀、实验拓扑
⼆、实验步骤
1、给主机设置IP,⽹关;给交换机划分VLAN,给VLAN划分端⼝,给VLAN设置IP
2、启⽤OSPF、宣告⽹段(network ⽹络地址反掩码区域名其中0区域为主⼲区域)
▲SwitchA 的相关配置
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SwitchA
SwitchA(config)#vlan 10
SwitchA(config-vlan)#exit
SwitchA(config)#vlan 20
SwitchA(config-vlan)#exit
SwitchA(config)#vlan 100
SwitchA(config-vlan)#exit
SwitchA(config)#interface range fastEthernet 0/1-10
SwitchA(config-if-range)#switchport access vlan 10
SwitchA(config-if-range)#interface range fastEthernet 0/11-20
SwitchA(config-if-range)#switchport access vlan 20
SwitchA(config-if-range)#interface fastEthernet 0/23
SwitchA(config-if)#switchport access vlan 100
SwitchA(config-if)#
SwitchA(config-if)#interface vlan 100
SwitchA(config-if)#ip address 192.168.100.1 255.255.255.0
SwitchA(config-if)#no shutdown
SwitchA(config-if)#interface vlan 10
SwitchA(config-if)#ip address 192.168.10.1 255.255.255.0
SwitchA(config-if)#no shutdown
SwitchA(config-if)#interface vlan 20
SwitchA(config-if)#ip address 192.168.20.1 255.255.255.0
SwitchA(config-if)#no shutdown
SwitchA(config-if)#exit
SwitchA(config)#router ?
eigrp Enhanced Interior Gateway Routing Protocol (EIGRP)
ospf Open Shortest Path First (OSPF)
rip Routing Information Protocol (RIP)
SwitchA(config)#router ospf ?
<1-65535> Process ID
SwitchA(config)#router ospf 1
SwitchA(config-router)#network 192.168.10.0 0.0.0.255 area 0
SwitchA(config-router)#network 192.168.20.0 0.0.0.255 area 0
SwitchA(config-router)#network 192.168.100.0 0.0.0.255 area 0
SwitchA(config-router)#
▲SwitchB 的相关配置
Switch>
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 30
Switch(config-vlan)#exit
Switch(config)#vlan 40
Switch(config-vlan)#exit
Switch(config)#vlan 101
Switch(config-vlan)#exit
Switch(config)#vlan 200
Switch(config-vlan)#exit
Switch(config)#hostname SwitchB
SwitchB(config)#interface range fastEthernet 0/1-10
SwitchB(config-if-range)#switchport access vlan 30
SwitchB(config-if-range)#interface range fastEthernet 0/11-20 SwitchB(config-if-range)#switchport access vlan 40
SwitchB(config-if-range)#interface fastEthernet 0/23
SwitchB(config-if)#switchport access vlan 101
SwitchB(config-if)#interface fastEthernet 0/24
SwitchB(config-if)#switchport access vlan 200
SwitchB(config-if)#
SwitchB(config-if)#exit
SwitchB(config)#interface vlan 101
SwitchB(config-if)#ip address 192.168.100.2 255.255.255.0 SwitchB(config-if)#no shutdown
SwitchB(config-if)#interface vlan 200
SwitchB(config-if)#ip address 192.168.200.1 255.255.255.0 SwitchB(config-if)#no shutdown
SwitchB(config-if)#interface vlan 30
SwitchB(config-if)#ip address 192.168.30.1 255.255.255.0 SwitchB(config-if)#no shutdown
SwitchB(config-if)#interface vlan 40
SwitchB(config-if)#ip address 192.168.40.1 255.255.255.0 SwitchB(config-if)#no shutdown
SwitchB(config-if)#exit
SwitchB(config)#route ospf 1
SwitchB(config-router)#network 192.168.100.0 0.0.0.255 area 0 SwitchB(config-router)#network 192.168.30.0 0.0.0.255 area 0 SwitchB(config-router)#network 192.168.200.0 0.0.0.255 area 1 SwitchB(config-router)#network 192.168.40.0 0.0.0.255 area 1 SwitchB(config-router)#
▲SwitchC 的相关配置
Switch>
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname SwitchC
SwitchC(config)#vlan 50
SwitchC(config-vlan)#exit
SwitchC(config)#vlan 60
SwitchC(config-vlan)#exit
SwitchC(config)#vlan 201
SwitchC(config-vlan)#exit
SwitchC(config)#interface range fastEthernet 0/1-10 SwitchC(config-if-range)#switchport access vlan 50
SwitchC(config-if-range)#interface range fastEthernet 0/11-20 SwitchC(config-if-range)#switchport access vlan 60
SwitchC(config-if-range)#interface fastEthernet 0/24 SwitchC(config-if)#switchport access vlan 201
SwitchC(config-if)#exit
SwitchC(config)#interface vlan 201
SwitchC(config-if)#ip address 192.168.200.2 255.255.255.0
SwitchC(config-if)#no shutdown
SwitchC(config-if)#interface vlan 50
SwitchC(config-if)#ip address 192.168.50.100 255.255.255.0
SwitchC(config-if)#no shutdown
SwitchC(config-if)#interface vlan 60
SwitchC(config-if)#ip address 192.168.60.100 255.255.255.0
SwitchC(config-if)#no shutdown
SwitchC(config-if)#exit
Switch(config)#router ?
eigrp Enhanced Interior Gateway Routing Protocol (EIGRP)
ospf Open Shortest Path First (OSPF)
rip Routing Information Protocol (RIP)
Switch(config)#router ospf ?
<1-65535> Process ID
Switch(config)#router ospf 1
Switch(config-router)#network 192.168.50.0 0.0.0.255 area 1
Switch(config-router)#network 192.168.60.0 0.0.0.255 area 1
Switch(config-router)#network 192.168.200.0 0.0.0.255 area 1
Switch(config-router)#
当三台交换机都设置好ospf动态路由后,⽤以下命令查看(在特权模式下)SwitchC#show ip route
结果如图
三、实验结果
所有的PC间全通。