三层交换机中关于VLan之间的具体通信过程,
包括在同一台交换机不同VLAN间的通信,不同交换机不同VLAN的通信。说具体点各位!!!
如;在有两台三层交换机 第一台上配了5个VALN 从VALN 2 到 6 第二台交换机配有5个VLAN 分别是vlan 10 20 30 40 50 现在问vlan 2 和vlan 20能不能通信?应该怎么配置?
同一台交换机不同VLAN之间的通信,可以看看单臂路由技术。
首先交换机配置
Switch(config)#vlan 2
Switch(config-vlan)#vlan 3
Switch(config-vlan)#exit //创建2个VLAN
Switch(config)#int f0/2
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#int f0/3
Switch(config-if)#switchport access vlan 3
Switch(config-if)#exit // 把各端口划分到相应VLAN
Switch(config)#int f0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
然后路由器配置
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int ? //不知道就打?号
Ethernet IEEE 802.3
FastEthernet FastEthernet IEEE 802.3
GigabitEthernet GigabitEthernet IEEE 802.3z
Loopback Loopback interface
Serial Serial
Vlan Catalyst Vlans
range interface range command
Router(config)#int f0/?
<0-24> FastEthernet interface number
Router(config)#int f0/0.1 //进入子接口!
%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to upRouter(config-subif)#en
Router(config-subif)#encapsulation?
encapsulation
Router(config-subif)#encapsulation ?
dot1Q IEEE 802.1Q Virtual LAN
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q ? //采用封装协议
<1-1005> IEEE 802.1Q VLAN ID
Router(config-subif)#encapsulation dot1Q 2 //这个2是VLAN 号!
Router(config-subif)#ip add 192.168.1.1 255.255.255.0 //IP地址就是VLAN的网关!
Router(config-subif)#exit
Router(config)#int f0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to upRouter(config-subif)#en
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 3
Router(config-subif)#ip add 192.168.2.1 255.255.255.0
Router(config-subif)#exit
Router(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Router#show ip route //查看路由表!
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/0.1
C 192.168.2.0/24 is directly connected, FastEthernet0/0.2