三层交换机配置
1、配置PC1-4
pc1:
192.168.1.2
255.255.255.0
192.168.1.1
pc2:
192.168.2.2
255.255.255.0
192.168.2.1
pc3:
192.168.1.3
255.255.255.0
192.168.1.1
pc4:
192.168.2.3
255.255.255.0
192.168.2.1
2、配置SW1
en
conf t
host SW1
vlan 10
exit
vlan 20
exit
int r f0/1-10
sw m a
sw a v 10
exit
int r f0/11-20
sw m a
sw a v 20
exit
int f0/24
sw m tr
end
wr
3、配置SW2
en
conf t
host SW2
ip routing
vlan 10
exit
vlan 20
exit
int f0/24
sw tr en d
sw m tr
exit
int valn 10
ip add 192.168.1.1 255.255.255.0
no shut
exit
int vlan 20
ip add 192.168.2.1 255.255.255.0
no shut
exit
end
4、测试
ping 192.168.1.3
Pinging 192.168.1.3 with 32 bytes of data:
Reply from 192.168.1.3: bytes=32 time=63ms TTL=128
Reply from 192.168.1.3: bytes=32 time=46ms TTL=128
Reply from 192.168.1.3: bytes=32 time=63ms TTL=128
Reply from 192.168.1.3: bytes=32 time=62ms TTL=128
Ping statistics for 192.168.1.3:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 46ms, Maximum = 63ms, Average = 58ms
ping 192.168.2.3
Pinging 192.168.2.3 with 32 bytes of data:
Reply from 192.168.2.3: bytes=32 time=125ms TTL=127
Reply from 192.168.2.3: bytes=32 time=141ms TTL=127
Reply from 192.168.2.3: bytes=32 time=93ms TTL=127
Reply from 192.168.2.3: bytes=32 time=124ms TTL=127
Ping statistics for 192.168.2.3:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 93ms, Maximum = 141ms, Average = 120ms
实验补充:
1、f0/24配置封装方式为:802.1q
2、f0/24接口模式改为trunk
3、配置vlan10vlan20
4、为vlan10配置ip地址:192.168.1.1
5、为vlan20配置ip地址192.168.2.1
6、在全局配置模式下开启三层交换机的路由功能
以上纯属个人所学