《三层交换机实现不同网段的主机通信》由会员分享,可在线阅读,更多相关《三层交换机实现不同网段的主机通信(3页珍藏版)》请在金锄头文库上搜索。
1、三层交换机实现不同网段的主机通信【实验名称】办公广播网处理,三层交换机实现不同VLAN之间的通信【实验目的】用三层交换机将多台计算机连接起来,构建一个小型的办公网,且实现vlan间的通信。技术原理: 三层交换机具有网络层的功能,实现vlan相互访问的原理是:利用3层交换机的路由功能,通过识别数据包的IP地址,查找路由表进行进行选路转发。三层交换机利用直接路由可以实现不同vlan之间的互相访问。三层交换机给接口配置IP地址,采用SVI (交换虚拟接口)的方式实现VLAN间互连,SVI是指为交换机中的VLAN创建虚拟接口,并且配置IP地址。【背景描述】【需求分析】【实验拓扑】【实验设备】三层交换机
2、1台PC机3台【实验步骤】按照网络拓扑连接好网络设备,然后进行如下配置SwitchSwitchenableSwitch#config terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 10Switch(config-vlan)#name xiaoxueSwitch(config-vlan)#exitSwitch(config)#vlan 20Switch(config-vlan)#name chuzhongSwitch(config-vlan)#exitSwitch(c
3、onfig)#vlan 30Switch(config-vlan)#name gaozhongSwitch(config-vlan)#exitSwitch(config)#interface fa0/1Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to downSwitch(config-if)#exitSwitch(config)#in
4、terface fa0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 20%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to doSwitch(config-if)#exitSwitch(config)#interface fa0/3Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vl
5、an 30%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan4, changed state to downSwitch(config-if)#exitSwitch(config)#interface vlan 10%LINK-5-CHANGED: Interface Vlan10, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to upSwitch(config-if)#ip address 192.168
6、.10.1 255.255.255.0% 192.168.10.0 overlaps with Vlan2Switch(config-if)#exitSwitch(config)#interface vlan 20%LINK-5-CHANGED: Interface Vlan20, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to upSwitch(config-if)#ip address 192.168.20.1 255.255.255.0% 192.168
7、.20.0 overlaps with Vlan3Switch(config-if)#exitSwitch(config)#interface vlan 30%LINK-5-CHANGED: Interface Vlan30, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to upSwitch(config-if)#ip address 192.168.30.1 255.255.255.0% 192.168.30.0 overlaps with Vlan4Switch(config-if)#exitSwitch(config)#exitSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch# 【结果测试】PC0(192.168.10.5)测试Ping 192.168.20.5 通Ping 192.168.30.5 通