两台三层交换机配置ospf互联_两台三层交换机配置ospf互联


配置后的拓扑图如下:

两台三层交换机配置ospf互联_两台三层交换机配置ospf互联_02

1、二层交换机switch6配置

Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
#创建两个vlan
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
#讲接口加入到vlan中
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
#端口封装
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport mode trunk 

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

两台三层交换机配置ospf互联_两台三层交换机配置ospf互联_03


2、二层交换机switch7配置

Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
#创建vlan
Switch(config)#vlan 30
Switch(config-vlan)#exit
Switch(config)#vlan 40
Switch(config-vlan)#exit
#接口绑定到vlan
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#switchport access vlan 40
Switch(config-if)#exit
#封装端口
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport mode trunk

两台三层交换机配置ospf互联_运维_04


3、三层交换机switch6配置

Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 10
Switch(config)#exit
Switch(config)#vlan 20
Switch(config)#exit
Switch(config)#interface vlan 10
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#exit
Switch(config)#interface vlan 20
Switch(config-if)#ip address 192.168.2.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk 
Switch(config-if)#exit
Switch(config)#int
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#sw
Switch(config-if)#no switchport 
Switch(config-if)#ip ad
Switch(config-if)#ip address 192.168.6.2 255.255.255.0
Switch(config-if)#no shut
Switch(config-if)#no shutdown 
Switch(config-if)#exit
Switch(config)#ip routing

两台三层交换机配置ospf互联_tcp/ip_05


两台三层交换机配置ospf互联_三层交换机_06


两台三层交换机配置ospf互联_运维_07


3、三层交换机switch7配置

Switch>ena
Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 30
Switch(config)#exit
Switch(config)#vlan 40
Switch(config)#exit
Switch(config)#interface vlan 30
Switch(config-if)#ip address 192.168.3.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#exit
Switch(config)#interface vlan 40
Switch(config-if)#ip address 192.168.4.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk 
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#no switchport 
Switch(config-if)#ip address 192.168.7.2 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#exit
Switch(config)#ip routing

两台三层交换机配置ospf互联_两台三层交换机配置ospf互联_08


5、路由器route8配置

Router>enable 
Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
#配置g0/1端口IP
Router(config)#interface gigabitEthernet 0/1
Router(config-if)#ip address 192.168.5.1 255.255.255.0
Router(config-if)#no shutdown 
Router(config-if)#exit
#配置g0/2端口IP
Router(config)#interface gigabitEthernet 0/2
Router(config-if)#ip address 192.168.6.1 255.255.255.0
Router(config-if)#no shutdown

两台三层交换机配置ospf互联_两台三层交换机配置ospf互联_09


6、路由器route9配置

Router>enable 
Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
#配置g0/1端口IP
Router(config)#interface gigabitEthernet 0/1
Router(config-if)#ip address 192.168.5.2 255.255.255.0
Router(config-if)#no shutdown 

Router(config-if)#exit
#配置g0/2端口IP
Router(config)#interface gigabitEthernet 0/2
Router(config-if)#ip address 192.168.7.1 255.255.255.0
Router(config-if)#no shutdown

两台三层交换机配置ospf互联_网络_10


此时网络拓扑图都显示绿色

两台三层交换机配置ospf互联_两台三层交换机配置ospf互联_11


7、在三层交换机switch6上配置动态路由

Switch(config)#ip route 192.168.3.0 255.255.255.0 192.168.6.1
Switch(config)#ip route 192.168.4.0 255.255.255.0 192.168.6.1
Switch(config)#ip route 192.168.5.0 255.255.255.0 192.168.6.1

两台三层交换机配置ospf互联_tcp/ip_12


8、在三层交换机switch7上配置动态路由

Switch(config)#ip route 192.168.1.0 255.255.255.0 192.168.7.1
Switch(config)#ip route 192.168.2.0 255.255.255.0 192.168.7.1
Switch(config)#ip route 192.168.5.0 255.255.255.0 192.168.7.1

两台三层交换机配置ospf互联_tcp/ip_13


9、在路由器route8上配置路由

Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.6.2
Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.6.2
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.5.2
Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.5.2

两台三层交换机配置ospf互联_网络_14


10、在路由器touter9上配置路由

Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.5.1
Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.5.1
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.7.2
Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.7.2

两台三层交换机配置ospf互联_tcp/ip_15


测试结果

pc23

C:\>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time<1ms TTL=255
Reply from 192.168.1.1: bytes=32 time=3ms TTL=255

Ping statistics for 192.168.1.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 3ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.2.1

Pinging 192.168.2.1 with 32 bytes of data:

Reply from 192.168.2.1: bytes=32 time<1ms TTL=255
Reply from 192.168.2.1: bytes=32 time=1ms TTL=255

Ping statistics for 192.168.2.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:

Reply from 192.168.2.2: bytes=32 time<1ms TTL=127
Reply from 192.168.2.2: bytes=32 time<1ms TTL=127

Ping statistics for 192.168.2.2:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.3.1

Pinging 192.168.3.1 with 32 bytes of data:

Reply from 192.168.3.1: bytes=32 time=1ms TTL=252
Reply from 192.168.3.1: bytes=32 time<1ms TTL=252

Ping statistics for 192.168.3.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.3.2

Pinging 192.168.3.2 with 32 bytes of data:

Request timed out.
Reply from 192.168.3.2: bytes=32 time=11ms TTL=124
Reply from 192.168.3.2: bytes=32 time=1ms TTL=124
Reply from 192.168.3.2: bytes=32 time=3ms TTL=124

Ping statistics for 192.168.3.2:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 11ms, Average = 5ms

C:\>ping 192.168.4.1

Pinging 192.168.4.1 with 32 bytes of data:

Reply from 192.168.4.1: bytes=32 time=2ms TTL=252
Reply from 192.168.4.1: bytes=32 time<1ms TTL=252

Ping statistics for 192.168.4.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 2ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.4.2

Pinging 192.168.4.2 with 32 bytes of data:

Reply from 192.168.4.2: bytes=32 time<1ms TTL=124
Reply from 192.168.4.2: bytes=32 time<1ms TTL=124
Reply from 192.168.4.2: bytes=32 time<1ms TTL=124

Ping statistics for 192.168.4.2:
    Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.5.1

Pinging 192.168.5.1 with 32 bytes of data:

Reply from 192.168.5.1: bytes=32 time<1ms TTL=254
Reply from 192.168.5.1: bytes=32 time<1ms TTL=254

Ping statistics for 192.168.5.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.5.2

Pinging 192.168.5.2 with 32 bytes of data:

Reply from 192.168.5.2: bytes=32 time<1ms TTL=253
Reply from 192.168.5.2: bytes=32 time<1ms TTL=253

Ping statistics for 192.168.5.2:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.6.1

Pinging 192.168.6.1 with 32 bytes of data:

Reply from 192.168.6.1: bytes=32 time<1ms TTL=254
Reply from 192.168.6.1: bytes=32 time<1ms TTL=254

Ping statistics for 192.168.6.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.6.2

Pinging 192.168.6.2 with 32 bytes of data:

Reply from 192.168.6.2: bytes=32 time<1ms TTL=255
Reply from 192.168.6.2: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.6.2:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.7.1

Pinging 192.168.7.1 with 32 bytes of data:

Reply from 192.168.6.1: Destination host unreachable.
Reply from 192.168.6.1: Destination host unreachable.

Ping statistics for 192.168.7.1:
    Packets: Sent = 3, Received = 0, Lost = 3 (100% loss),

Control-C
^C
C:\>ping 192.168.7.2

Pinging 192.168.7.2 with 32 bytes of data:

Reply from 192.168.6.1: Destination host unreachable.
Reply from 192.168.6.1: Destination host unreachable.
Reply from 192.168.6.1: Destination host unreachable.
Reply from 192.168.6.1: Destination host unreachable.

Ping statistics for 192.168.7.2:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

pc24测试结果

C:\>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.1.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.1.2

Pinging 192.168.1.2 with 32 bytes of data:

Reply from 192.168.1.2: bytes=32 time<1ms TTL=127
Reply from 192.168.1.2: bytes=32 time<1ms TTL=127

Ping statistics for 192.168.1.2:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:

Reply from 192.168.2.2: bytes=32 time=3ms TTL=128

Ping statistics for 192.168.2.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 3ms, Maximum = 3ms, Average = 3ms

Control-C
^C
C:\>ping 192.168.2.1

Pinging 192.168.2.1 with 32 bytes of data:

Reply from 192.168.2.1: bytes=32 time<1ms TTL=255
Reply from 192.168.2.1: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.2.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.3.1

Pinging 192.168.3.1 with 32 bytes of data:

Reply from 192.168.3.1: bytes=32 time=2ms TTL=252
Reply from 192.168.3.1: bytes=32 time<1ms TTL=252

Ping statistics for 192.168.3.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 2ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.3.2

Pinging 192.168.3.2 with 32 bytes of data:

Reply from 192.168.3.2: bytes=32 time=1ms TTL=124

Ping statistics for 192.168.3.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.4.2

Pinging 192.168.4.2 with 32 bytes of data:

Reply from 192.168.4.2: bytes=32 time<1ms TTL=124

Ping statistics for 192.168.4.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.4.1

Pinging 192.168.4.1 with 32 bytes of data:

Reply from 192.168.4.1: bytes=32 time<1ms TTL=252

Ping statistics for 192.168.4.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.5.1

Pinging 192.168.5.1 with 32 bytes of data:

Reply from 192.168.5.1: bytes=32 time=1ms TTL=254

Ping statistics for 192.168.5.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.5.2

Pinging 192.168.5.2 with 32 bytes of data:

Reply from 192.168.5.2: bytes=32 time<1ms TTL=253
Reply from 192.168.5.2: bytes=32 time<1ms TTL=253

Ping statistics for 192.168.5.2:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.6.2

Pinging 192.168.6.2 with 32 bytes of data:

Reply from 192.168.6.2: bytes=32 time<1ms TTL=255
Reply from 192.168.6.2: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.6.2:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.6.1

Pinging 192.168.6.1 with 32 bytes of data:

Reply from 192.168.6.1: bytes=32 time<1ms TTL=254
Reply from 192.168.6.1: bytes=32 time<1ms TTL=254

Ping statistics for 192.168.6.1:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.7.1

Pinging 192.168.7.1 with 32 bytes of data:

Reply from 192.168.6.1: Destination host unreachable.
Reply from 192.168.6.1: Destination host unreachable.

Ping statistics for 192.168.7.1:
    Packets: Sent = 2, Received = 0, Lost = 2 (100% loss),

Control-C
^C
C:\>ping 192.168.7.2

Pinging 192.168.7.2 with 32 bytes of data:

Reply from 192.168.6.1: Destination host unreachable.

Ping statistics for 192.168.7.2:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Control-C
^C

pc25测试结果

C:\>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time=3ms TTL=252

Ping statistics for 192.168.1.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 3ms, Maximum = 3ms, Average = 3ms

Control-C
^C
C:\>ping 192.168.1.2

Pinging 192.168.1.2 with 32 bytes of data:

Reply from 192.168.1.2: bytes=32 time<1ms TTL=124

Ping statistics for 192.168.1.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:

Reply from 192.168.2.2: bytes=32 time=2ms TTL=124

Ping statistics for 192.168.2.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 2ms, Maximum = 2ms, Average = 2ms

Control-C
^C
C:\>ping 192.168.2.1

Pinging 192.168.2.1 with 32 bytes of data:

Reply from 192.168.2.1: bytes=32 time<1ms TTL=252

Ping statistics for 192.168.2.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.3.1

Pinging 192.168.3.1 with 32 bytes of data:

Reply from 192.168.3.1: bytes=32 time=1ms TTL=255

Ping statistics for 192.168.3.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.3.2

Pinging 192.168.3.2 with 32 bytes of data:

Reply from 192.168.3.2: bytes=32 time=4ms TTL=128

Ping statistics for 192.168.3.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 4ms, Maximum = 4ms, Average = 4ms

Control-C
^C
C:\>ping 192.168.4.2

Pinging 192.168.4.2 with 32 bytes of data:

Reply from 192.168.4.2: bytes=32 time<1ms TTL=127

Ping statistics for 192.168.4.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.4.1

Pinging 192.168.4.1 with 32 bytes of data:

Reply from 192.168.4.1: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.4.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.5.1

Pinging 192.168.5.1 with 32 bytes of data:

Reply from 192.168.5.1: bytes=32 time<1ms TTL=253

Ping statistics for 192.168.5.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.5.2

Pinging 192.168.5.2 with 32 bytes of data:

Reply from 192.168.5.2: bytes=32 time<1ms TTL=254

Ping statistics for 192.168.5.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.6.2

Pinging 192.168.6.2 with 32 bytes of data:

Reply from 192.168.3.1: Destination host unreachable.

Ping statistics for 192.168.6.2:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Control-C
^C
C:\>ping 192.168.6.1

Pinging 192.168.6.1 with 32 bytes of data:

Reply from 192.168.3.1: Destination host unreachable.
Reply from 192.168.3.1: Destination host unreachable.

Ping statistics for 192.168.6.1:
    Packets: Sent = 2, Received = 0, Lost = 2 (100% loss),

Control-C
^C
C:\>ping 192.168.7.1

Pinging 192.168.7.1 with 32 bytes of data:

Reply from 192.168.7.1: bytes=32 time=1ms TTL=254

Ping statistics for 192.168.7.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.7.2

Pinging 192.168.7.2 with 32 bytes of data:

Reply from 192.168.7.2: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.7.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C

pc26测试结果

C:\>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time=3ms TTL=252

Ping statistics for 192.168.1.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 3ms, Maximum = 3ms, Average = 3ms

Control-C
^C
C:\>ping 192.168.1.2

Pinging 192.168.1.2 with 32 bytes of data:

Reply from 192.168.1.2: bytes=32 time<1ms TTL=124

Ping statistics for 192.168.1.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:

Reply from 192.168.2.2: bytes=32 time=2ms TTL=124

Ping statistics for 192.168.2.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 2ms, Maximum = 2ms, Average = 2ms

Control-C
^C
C:\>ping 192.168.2.1

Pinging 192.168.2.1 with 32 bytes of data:

Reply from 192.168.2.1: bytes=32 time<1ms TTL=252

Ping statistics for 192.168.2.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.3.1

Pinging 192.168.3.1 with 32 bytes of data:

Reply from 192.168.3.1: bytes=32 time=1ms TTL=255

Ping statistics for 192.168.3.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.3.2

Pinging 192.168.3.2 with 32 bytes of data:

Reply from 192.168.3.2: bytes=32 time=4ms TTL=128

Ping statistics for 192.168.3.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 4ms, Maximum = 4ms, Average = 4ms

Control-C
^C
C:\>ping 192.168.4.2

Pinging 192.168.4.2 with 32 bytes of data:

Reply from 192.168.4.2: bytes=32 time<1ms TTL=127

Ping statistics for 192.168.4.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.4.1

Pinging 192.168.4.1 with 32 bytes of data:

Reply from 192.168.4.1: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.4.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.5.1

Pinging 192.168.5.1 with 32 bytes of data:

Reply from 192.168.5.1: bytes=32 time<1ms TTL=253

Ping statistics for 192.168.5.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.5.2

Pinging 192.168.5.2 with 32 bytes of data:

Reply from 192.168.5.2: bytes=32 time<1ms TTL=254

Ping statistics for 192.168.5.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.6.2

Pinging 192.168.6.2 with 32 bytes of data:

Reply from 192.168.3.1: Destination host unreachable.

Ping statistics for 192.168.6.2:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Control-C
^C
C:\>ping 192.168.6.1

Pinging 192.168.6.1 with 32 bytes of data:

Reply from 192.168.3.1: Destination host unreachable.
Reply from 192.168.3.1: Destination host unreachable.

Ping statistics for 192.168.6.1:
    Packets: Sent = 2, Received = 0, Lost = 2 (100% loss),

Control-C
^C
C:\>ping 192.168.7.1

Pinging 192.168.7.1 with 32 bytes of data:

Reply from 192.168.7.1: bytes=32 time=1ms TTL=254

Ping statistics for 192.168.7.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms

Control-C
^C
C:\>ping 192.168.7.2

Pinging 192.168.7.2 with 32 bytes of data:

Reply from 192.168.7.2: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.7.2:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C

异常问题:
1、6 7两个网段不通
解决办法在三层交换机和路由器间加一条路由
三层交换机switch6

Switch(config)#ip route 192.168.7.0 255.255.255.0 192.168.6.1

路由器route8

Router(config)#ip route 192.168.7.0 255.255.255.0 192.168.5.2

路由器route9

Router(config)#ip route 192.168.6.0 255.255.255.0 192.168.5.1

三层交换机switch7

Switch(config)#ip route 192.168.6.0 255.255.255.0 192.168.7.1

测试结果

pc23

两台三层交换机配置ospf互联_三层交换机_16


三层交换机switch6测试结果

两台三层交换机配置ospf互联_两台三层交换机配置ospf互联_17


三层交换机switch7测试结果

两台三层交换机配置ospf互联_运维_18


pc25

两台三层交换机配置ospf互联_tcp/ip_19


2、三层交换机内部两台机器网络不都通

问题原因如下

直接原因:是因为我配置的两个三层交换机的时候vlan都处于down状态

根本原因:因为在操作三层交换机的时候没有先创建vlan,直接执行interface vlan 10导致

问题解决办法:先执行vlan 10 然后再执行interface vlan 10

现已在编辑处添加了,但是截图没有显示