《三层交换机实现不同网段的主机通信.docx》由会员分享,可在线阅读,更多相关《三层交换机实现不同网段的主机通信.docx(3页珍藏版)》请在三一办公上搜索。
1、三层交换机实现不同网段的主机通信三层交换机实现不同网段的主机通信 办公广播网处理,三层交换机实现不同VLAN之间的通信 用三层交换机将多台计算机连接起来,构建一个小型的办公网,且实现vlan间的通信。 技术原理: 三层交换机具有网络层的功能,实现vlan相互访问的原理是:利用3层交换机的路由功能,通过识别数据包的IP地址,查找路由表进行进行选路转发。三层交换机利用直接路由可以实现不同vlan之间的互相访问。三层交换机给接口配置IP地址,采用SVI (交换虚拟接口)的方式实现VLAN间互连,SVI是指为交换机中的VLAN创建虚拟接口,并且配置IP地址。 三层交换机1台 PC机3台 按照网络拓扑连
2、接好网络设备,然后进行如下配置 Switch Switchenable Switch#config terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10 Switch(config-vlan)#name xiaoxue Switch(config-vlan)#exit Switch(config)#vlan 20 Switch(config-vlan)#name chuzhong Switch(config-vlan)#exit Switch(config)#vl
3、an 30 Switch(config-vlan)#name gaozhong Switch(config-vlan)#exit Switch(config)#interface fa0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to down Switch(config-if)#exit Switch(config)#inte
4、rface fa0/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20 %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to do Switch(config-if)#exit Switch(config)#interface fa0/3 Switch(config-if)#switchport mode access Switch(config-if)#switchport acce
5、ss vlan 30 %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan4, changed state to down Switch(config-if)#exit Switch(config)#interface vlan 10 %LINK-5-CHANGED: Interface Vlan10, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up Switch(config-if)#ip addr
6、ess 192.168.10.1 255.255.255.0 % 192.168.10.0 overlaps with Vlan2 Switch(config-if)#exit Switch(config)#interface vlan 20 %LINK-5-CHANGED: Interface Vlan20, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up Switch(config-if)#ip address 192.168.20.1 255.2
7、55.255.0 % 192.168.20.0 overlaps with Vlan3 Switch(config-if)#exit Switch(config)#interface vlan 30 %LINK-5-CHANGED: Interface Vlan30, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up Switch(config-if)#ip address 192.168.30.1 255.255.255.0 % 192.168.30.0 overlaps with Vlan4 Switch(config-if)#exit Switch(config)#exit Switch# %SYS-5-CONFIG_I: Configured from console by console Switch# PC0测试 Ping 192.168.20.5 通 Ping 192.168.30.5 通