gggggds 发表于 2018-7-16 12:44:36

Cisco Packet Tracert 之 三层交换机VLAN配置

  实验环境:

  实验目的:
  1、在三层交换机划分三个VLAN,分别是VLAN2\VNAL3\VLAN4,并且设置VLAN IP 分别为:192.168.2.1、192.168.3.1、192.168.4.1。
  2、把fa0/1口设置为trunk口,fa0/4加入VLAN4。
  3、启用路由功能,实现各VLAN之间互通。
  4、设置二层交换机,把fa0/1口设置为trunk ,并把fa0/2加入VLAN2,fa0/3加入VLAN3.
  5、测试各VLAN是否相通。
  实验步骤:
  1、在三层交换机划分三个VLAN,分别是VLAN2\VNAL3\VLAN4,并且设置VLAN IP 分别为:192.168.2.1、192.168.3.1、192.168.4.1。
  Switch>enable
  Switch#conf t
  Enter configuration commands, one per line.End with CNTL/Z.
  Switch(config)#hostname CoreSW
  CoreSW(config)#vlan 2
  CoreSW(config-vlan)#exit
  CoreSW(config)#vlan 3
  CoreSW(config-vlan)#vlan 4
  CoreSW(config-vlan)#
  CoreSW(config)#int vlan 2
  CoreSW(config-if)#
  %LINK-5-CHANGED: Interface Vlan2, changed state to up
  CoreSW(config-if)#ip add 192.168.2.1 255.255.255.0
  CoreSW(config-if)#no shutdown
  CoreSW(config-if)#exit
  CoreSW(config)#int vlan 3
  CoreSW(config-if)#
  %LINK-5-CHANGED: Interface Vlan3, changed state to up
  CoreSW(config-if)#ip add 192.168.3.1 255.255.255.0
  CoreSW(config-if)#no shutdown
  CoreSW(config-if)#exit
  CoreSW(config)#int vlan 4
  CoreSW(config-if)#exit
  %LINK-5-CHANGED: Interface Vlan4, changed state to up
  CoreSW(config-if)#ip add 192.168.4.1 255.255.255.0
  CoreSW(config-if)#no shutdown
  2、把fa0/1口设置为trunk口,fa0/4加入VLAN4。
  CoreSW(config)#int fa0/1
  CoreSW(config-if)#switchport trunk encapsulation dot1q
  CoreSW(config-if)#switchport mode trunk
  CoreSW(config)#int fa0/4
  CoreSW(config-if)#switchport mode access
  CoreSW(config-if)#switchport access vlan 4
  3、启用路由功能,实现各VLAN之间互通。
  CoreSW#conf t
  Enter configuration commands, one per line.End with CNTL/Z.
  CoreSW(config)#ip routing
  4、设置二层交换机划分VLAN2/VLAN3,把fa0/1口设置为trunk ,并把fa0/2加入VLAN2,fa0/3加入VLAN3。
  Switch>enable
  Switch#conf t
  Enter configuration commands, one per line.End with CNTL/Z.
  Switch(config)#vlan 2
  Switch(config-vlan)#exit
  Switch(config)#vlan 3
  Switch(config-vlan)#exit
  Switch(config)#
  Switch(config)#int fa0/1
  Switch(config-if)#switchport mode trunk
  5、测试各VLAN是否相通。
页: [1]
查看完整版本: Cisco Packet Tracert 之 三层交换机VLAN配置