鍗曡噦璺敱鎷撴墤
 
本人用的模拟器是Cisco Packet Tracer5.2
路由器cisco2621   交换机cisco2950 三台PC
R0---F0/0.1=192.168.1.1/24====VLAN100
  ---F0/0.2=192.168.2.1/24====VLAN200
  ---F0/0.3=192.168.3.1/24====VLAN300
SW2950---F0/1=配置TRUNK过所有VLAN
      ----F0/2加入VLAN100  F0/3加入VLAN200  F0/4加入VLAN300
PC0—2配置的网关是各个VLAN也就是路由子接口的IP地址
PC0=192.168.1.100/24
PC1=192.168.2.100/24
PC2=192.168.3.100/24
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

路由配置:
R0config#int f0/0
R0config-if#no shut  激活总接口
R0config#int f0/0.1  进入子接口 0.1=vlan100
R0config-subif#encapsulation dot1q 100 封装VLAN1000.1接口中
R0config-subif#ip add 192.168.1.1 255.255.255.0  配置IP地址
R0config-subif#no shut  激活接口
R0config#int f0/0.2  进入子接口 0.2=vlan200
R0config-subif#encapsulation dot1q 200  封装VLAN2000.2接口中
R0config-subif#no shut 激活子接口
R0config#int f0/.3  进入子接口 0.3=VLAN300
R0config-subif#encapsulation dot1q 300  封装VLAN3000.3接口中
R0config-subif#no shut  激活子接口
交换机配置:
Sw#vlan database 创建vlan
Swvlan#vlan 100  VLAN100
Swvlan#vlan 200  VLAN200
Swvlan#vlan 300  VLAN300
Swvlan#exit  保存退出
Swconfig#int f0/2
Swconfig-if#switchport mode access  设置端口为访问模式
Swconfig-if#switchport access vlan 100 把端口F0/2加入VLAN 100
Swconfig#int f0/3
Swconfig-if#switchport mode access  设置端口为访问模式
Swconfig-if#switchport access vlan 200 把端口F0/3加入VLAN 200
Swconfig#int f0/4
Swconfig-if#switchport mode access  设置端口为访问模式
Swconfig-if#switchport access vlan 300 把端口F0/4加入VLAN 300
Swconfig#int f0/1 配置与路由器连接的端口F0/1
Swconfig-if#switchport mode trunk 配置端口为TRUNK模式过所有VLAN
配置PC0 PC1 PC2IP地址和网关,互相之间能Ping
实验完成