支持VLAN的二层交换机也可以实现扩展多 ADSL 接入,比使用三层交换机具有成本更低的优势。
交换机详细图解
.-------------------------------------+
/ 3c17203 /|
+---+---+---+----------------------+--+ |
| 1 | 3 | 5 | ... |23| |
+--+---+---+--------------- -------+--+ |
| 2| 4 | 6 | ... 12 ... |24|/
+---+---+---+-----------|----------+-+
| +------------------+
---------------------- | Hi-Spider Router |-------- 二层交换机 ---- 客户机
tagged标签 +------------------+
有多少条ADSL需要接入,就需要在二层交换机上划分对应数量的VLAN,每个VLAN中只包括一个端口,每个端口与一根ADSL相连,这里以3c17203二层交换机接入2条ADSL为例,交换机配置如下所示:
创建VLAN2 ,具体命令如下图所示:
Menu options: --------------3Com SuperStack 3 Switch 4400---------------
create - Create a VLAN
delete - Delete a VLAN
detail - Display detailed information
modify - Modify a VLAN
summary - Display summary information
Type "quit" to return to the previous menu or ? for help
----------------------------------------- (1)---------------------------
Select menu option (bridge/vlan): create
Select VLAN ID (2-4094)[2]: 2
Enter VLAN Name [VLAN 2]: vlan 2
将交换机端口2划入VLAN2,划分成功后将一根ADSL接入端口2,具体命令如下图所示:
Select menu option (bridge/vlan): modify
Menu options: --------------3Com SuperStack 3 Switch 4400---------------
addPort - Add a port to a VLAN
name - Name a VLAN
removePort - Remove a port from a VLAN
Type "quit" to return to the previous menu or ? for help
----------------------------------------- (1)---------------------------
Select menu option (bridge/vlan/modify): addport
Select VLAN ID (1-5)[1]: 2
Select bridge port (1-24,AL1-AL4,all)[all]: 2
Enter tag type (untagged,tagged): untagged
同样的方法创建VLAN3 ,并将交换机端口3划入VLAN3 ,划分成功后将另一根ADSL接入端口3
将交换机端口12与海蜘蛛路由wan口连接,并将端口12同时划入VLAN2和VLAN3 ,并设置tagged标签,设置成功后查看端口12信息如下图所示:
Select menu option (bridge/port): detail
Select bridge port (1-24,AL1-AL4): 12
Unit 1, Port 12 Detailed Information
State: Forwarding fwdTransitions: 9
StpCost: 18 BroadcastStormControl: Enabled
DefaultPriority: 0
VLAN ID VLAN Name Tagging Mode
-------------------------------------------------------------------------------
1 Default VLAN Tagged
2 vlan 2 Tagged
3 vlan 3 Tagged
![]() |
提示 |
|---|---|
|
通过以上设置可以得知,与路由相连的交换机端口即中继端口必须设置成属于每个VLAN 例:如果有20根ADSL接入,中继端口必须设置成同时属于20个VLAN |