跨交换机vlan内通信配置
2017-09-25 10:27
337 查看
1.跨交换机vlan内通信配置:
Vlan技术原理:虚拟局域网是接入层将各个业务服务器分开的数据链路层解决方案(实际就是起到在一个局域网内实现业务隔离的作用)。VLAN主要用于路由器和交换机中,特别的,只有遵循vlan协议的第二层以上交换机才具有此功能。
网络拓扑:
实验目的:
1— 在同一台交换机上创建不同vlan,验证不能ping通
2— 在不同交换机上配置Trunk链路并创建相同vlan,验证可ping通
实验过程(我在模拟器上做,真实机命令也相同):
在交换机1上(2上同样操作):
Switch>en
Switch#conf t
Enterconfiguration commands, one per line. End with CNTL/Z.
Switch(config)#vlan2 //创建vlan2
Switch(config-vlan)#exit
Switch(config)#vlan3 //创建vlan3
Switch(config-vlan)#exit
Switch(config)#interfacefastEthernet 0/1
Switch(config-if)#switchport access vlan 2 //进入交换机口1将所连得PC加入到vlan2里
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport access vlan 3 //进入交换机口2将所连得PC加入到vlan3里
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I:Configured from console by console
Switch#showrunning-config
Buildingconfiguration...
Currentconfiguration : 1029 bytes
!
version 12.1
no servicetimestamps log datetime msec
no servicetimestamps debug datetime msec
no servicepassword-encryption
!
hostname Switch
!
!
!
spanning-tree modepvst
!
interfaceFastEthernet0/1
switchportaccess vlan 2
!
interfaceFastEthernet0/2
switchportaccess vlan 3
!
interfaceFastEthernet0/3
实验做到这里时,将各主机IP配好后,各个主机和其他主机都不能ping通,原因是1和2不在同一网段,主要原因是不在同一vlan;1和3虽然在同一网段但此时两个交换机之间没有做连接
配置trunk链路(两个交换机做同样的操作):
Switch#conf t
Enter configuration commands, one per line. End withCNTL/Z.
Switch(config)#interface fastEthernet 0/24
Switch(config-if)#switchport mode trunk
验证:PC1去ping:
PC>ping192.168.10.3
Pinging192.168.10.3 with 32 bytes of data:
Reply from192.168.10.3: bytes=32 time=11ms TTL=128
Reply from192.168.10.3: bytes=32 time=0ms TTL=128
Reply from 192.168.10.3:bytes=32 time=0ms TTL=128
Reply from192.168.10.3: bytes=32 time=0ms TTL=128
Ping statisticsfor 192.168.10.3:
Packets: Sent = 4,Received = 4, Lost = 0 (0% loss),
Approximate roundtrip times in milli-seconds:
Minimum = 0ms,Maximum = 11ms, Average = 2ms
PC>ping192.168.20.1
Pinging192.168.20.1 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statisticsfor 192.168.20.1:
Packets: Sent = 4,Received = 0, Lost = 4 (100% loss),
实验到此成功。
Vlan技术原理:虚拟局域网是接入层将各个业务服务器分开的数据链路层解决方案(实际就是起到在一个局域网内实现业务隔离的作用)。VLAN主要用于路由器和交换机中,特别的,只有遵循vlan协议的第二层以上交换机才具有此功能。
网络拓扑:
实验目的:
1— 在同一台交换机上创建不同vlan,验证不能ping通
2— 在不同交换机上配置Trunk链路并创建相同vlan,验证可ping通
实验过程(我在模拟器上做,真实机命令也相同):
在交换机1上(2上同样操作):
Switch>en
Switch#conf t
Enterconfiguration commands, one per line. End with CNTL/Z.
Switch(config)#vlan2 //创建vlan2
Switch(config-vlan)#exit
Switch(config)#vlan3 //创建vlan3
Switch(config-vlan)#exit
Switch(config)#interfacefastEthernet 0/1
Switch(config-if)#switchport access vlan 2 //进入交换机口1将所连得PC加入到vlan2里
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport access vlan 3 //进入交换机口2将所连得PC加入到vlan3里
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I:Configured from console by console
Switch#showrunning-config
Buildingconfiguration...
Currentconfiguration : 1029 bytes
!
version 12.1
no servicetimestamps log datetime msec
no servicetimestamps debug datetime msec
no servicepassword-encryption
!
hostname Switch
!
!
!
spanning-tree modepvst
!
interfaceFastEthernet0/1
switchportaccess vlan 2
!
interfaceFastEthernet0/2
switchportaccess vlan 3
!
interfaceFastEthernet0/3
实验做到这里时,将各主机IP配好后,各个主机和其他主机都不能ping通,原因是1和2不在同一网段,主要原因是不在同一vlan;1和3虽然在同一网段但此时两个交换机之间没有做连接
配置trunk链路(两个交换机做同样的操作):
Switch#conf t
Enter configuration commands, one per line. End withCNTL/Z.
Switch(config)#interface fastEthernet 0/24
Switch(config-if)#switchport mode trunk
验证:PC1去ping:
PC>ping192.168.10.3
Pinging192.168.10.3 with 32 bytes of data:
Reply from192.168.10.3: bytes=32 time=11ms TTL=128
Reply from192.168.10.3: bytes=32 time=0ms TTL=128
Reply from 192.168.10.3:bytes=32 time=0ms TTL=128
Reply from192.168.10.3: bytes=32 time=0ms TTL=128
Ping statisticsfor 192.168.10.3:
Packets: Sent = 4,Received = 4, Lost = 0 (0% loss),
Approximate roundtrip times in milli-seconds:
Minimum = 0ms,Maximum = 11ms, Average = 2ms
PC>ping192.168.20.1
Pinging192.168.20.1 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statisticsfor 192.168.20.1:
Packets: Sent = 4,Received = 0, Lost = 4 (100% loss),
实验到此成功。
相关文章推荐
- H3C交换机配置跨交换机间VLAN通信
- 华为两台交换机之间vlan通信-静态路由配置
- 配置TRUNK, 实现相同VLAN跨交换机通信
- CCNA之旅-交换机的基本配置-stp、vtp、vlan间通信实验
- Packet Tracer 5.0实验(三) 交换机划分VLAN配置
- 网络Cisco实验-同一交换机不同VLAN通信
- 再交换机上VLAN的配置
- 配置交换机VLAN
- C-F6. 多VLAN配置DHCP ❀ C3750-E ❀ 思科 (CISCO) 交换机
- 配置单臂路由实现vlan间通信实验报告
- 配置通过VLANIF实现同VLAN不同网段通信示例
- 华为 —小型企业多交换机多VLAN通信简单实验
- 2618交换机VLAN配置
- 利用VTP协议实现交换机 VLAN配置的一致性
- 配置跨交换机VLAN
- H3C S2100配置管理vlan与交换机管理IP
- 不同交换机相同VLAN可以通信,不同VLAN不可通信
- 配置在一台三层交换上,不同VLAN相互通信