pc ip mask default gateway
0 192.168.1.10 255.255.255.0 192.168.1.1
1 192.168.1.20 255.255.255.0 192.168.1.1
2 192.168.2.30 255.255.255.0 192.168.2.1
3 192.168.2.40 255.255.255.0 192.168.2.1

三层交换机实现vlan间通信

vlan间通信

Switch_3:
#en
#configure terminal
#vlan2
#vlan3
#int range fa0/1-2
#switchport mode access
#switchport access vlan2
#no shutdown
#int range fa0/2-3
#switchport mode access
#switchport access vlan3
#no shutdown
#int fa0/24
#switchport mode trunk
#switchport trunk allowed vlan all
#no shutdown

Switch_0:
#en
#configure terminal
#ip routing
#vlan 2
#vlan 3
#int vlan2
#ip add 192.168.1.1 255.255.255.0
#exit
#int vlan3
#ip add 192.168.2.1 255.255.255.0
#exit
#int fa0/24
#switchport mode trunk
#switchport trunk allowed vlan all

单臂路由实现vlan间通信

vlan间通信
交换机和pc的配置都不变,以下是路由器的配置

#en
#configure terminal
#int fa0/0
#no shutdown
#exit
#int fa0/0.1
#encapsulaton dot1Q 2
#ip address 192.168.1.1 255.255.255.0
#exit
#int fa0/0.2
#encapsulation dot1Q 3
#ip address 192.168.2.1 255.255.255.0
#exit 
#end
#show ip route

vlan间通信
vlan间通信

相关文章: