OSPF单区域配置
实验名称:OSPF单区域配置
实验拓扑:
实验配置步骤:
交换部分:
Switch1
Enable
Vlan database
Vlan 10 name magi
Exit
将vlan10加入到端口f0/2
Conf t
Int fa0/2
Switchport mode access
Switchport access vlan 10
Switch2
Enable
Vlan database
Vlan 20 name zydx
Vlan 30 name cysd
Exit
Conf t
Int f0/2
Switchport mode access
Switchport access vlan 20
Int f0/3
Switchport mode access
Switchport access vlan 30
在switch1上关闭路由功能
Sw1(config)#no ip routing
在switch2上开启路由功能
Sw2(config)#ip routing
interface Vlan20
ip address 192.168.50.254 255.255.255.0
!
interface Vlan30
ip address 192.168.60.254 255.255.255.0
!
interface GigabitEthernet0/1
no switchport
ip address 192.168.45.2 255.255.255.0
router ospf 1
log-adjacency-changes
network 192.168.45.0 0.0.0.255 area 0
network 192.168.50.0 0.0.0.255 area 0
network 192.168.60.0 0.0.0.255 area 0
!
环境测试:
PC2 ping测试PC1:
PC>ping 192.168.34.1
Pinging 192.168.34.1 with 32 bytes of data:
Reply from 192.168.34.1: bytes=32 time=8ms TTL=124
Reply from 192.168.34.1: bytes=32 time=2ms TTL=124
Reply from 192.168.34.1: bytes=32 time=2ms TTL=124
Reply from 192.168.34.1: bytes=32 time=2ms TTL=124
Ping statistics for 192.168.34.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 8ms, Average = 3ms
PC>
PC3 ping测试PC1:
PC>ping 192.168.34.1
Pinging 192.168.34.1 with 32 bytes of data:
Reply from 192.168.34.1: bytes=32 time=4ms TTL=124
Reply from 192.168.34.1: bytes=32 time=2ms TTL=124
Reply from 192.168.34.1: bytes=32 time=2ms TTL=124
Reply from 192.168.34.1: bytes=32 time=2ms TTL=124
Ping statistics for 192.168.34.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 4ms, Average = 2ms
PC>
实验完成。