一、适用场景:
爱快、高恪、RouerOS等各类路由WAN口扩展,即路由器WAN口不够用或需要多条ADSL拨号接入情况下前端交换机设置。
二、网络拓扑:
三、配置规划:
交换机1端口至23端口每个端口设置不同VLAN(例如VLAN1-VLAN23)供宽带接入使用,24口连接路由器进行宽带拨号。
四、设备配置:
1、建立VLAN1-VLAN23
[Cnitdog-Huawei-Switch-Wan]vlan batch 1 to 23
2、将1端口至23口划分至对应VLAN(以1端口为例,其他端口以此类推进行设置)
(1)进入1端口
[Cnitdog-Huawei-Switch-Wan]interface GigabitEthernet 0/0/1
(2)将1端口模式设置成ACCESS模式
[Cnitdog-Huawei-Switch-Wan-GigabitEthernet0/0/1]port link-type access
(3)将1端口设置为VLAN1
[Cnitdog-Huawei-Switch-Wan-GigabitEthernet0/0/1]port default vlan 1
4、设置24端口接入路由器
(1)进入24端口
[Cnitdog-Huawei-Switch-Wan]interface GigabitEthernet 0/0/24
(2)将24端口设置成TRUNK模式
[Cnitdog-Huawei-Switch-Wan-GigabitEthernet0/0/24]port link-type trunk
(3)将24端口设置成允许VLAN1-VLAN23通过
[Cnitdog-Huawei-Switch-Wan-GigabitEthernet0/0/24]port trunk allow-pass vlan 1 to 23
五、设备配置文件
[Cnitdog-Huawei-Switch-Wan]dis cu # sysname Cnitdog-Huawei-Switch-Wan # vlan batch 2 to 23 # cluster enable ntdp enable ndp enable # drop illegal-mac alarm # diffserv domain default # drop-profile default # aaa authentication-scheme default authorization-scheme default accounting-scheme default domain default domain default_admin local-user admin password simple admin local-user admin service-type http # interface Vlanif1 # interface MEth0/0/1 # interface GigabitEthernet0/0/1 port link-type access # interface GigabitEthernet0/0/2 port link-type access port default vlan 2 # interface GigabitEthernet0/0/3 port link-type access port default vlan 3 # interface GigabitEthernet0/0/4 port link-type access port default vlan 4 # interface GigabitEthernet0/0/5 port link-type access port default vlan 5 # interface GigabitEthernet0/0/6 port link-type access port default vlan 6 # interface GigabitEthernet0/0/7 port link-type access port default vlan 7 # interface GigabitEthernet0/0/8 port link-type access port default vlan 8 # interface GigabitEthernet0/0/9 port link-type access port default vlan 9 # interface GigabitEthernet0/0/10 port link-type access port default vlan 10 # interface GigabitEthernet0/0/11 port link-type access port default vlan 11 # interface GigabitEthernet0/0/12 port link-type access port default vlan 12 # interface GigabitEthernet0/0/13 port link-type access port default vlan 13 # interface GigabitEthernet0/0/14 port link-type access port default vlan 14 # interface GigabitEthernet0/0/15 port link-type access port default vlan 15 # interface GigabitEthernet0/0/16 port link-type access port default vlan 16 # interface GigabitEthernet0/0/17 port link-type access port default vlan 17 # interface GigabitEthernet0/0/18 port link-type access port default vlan 18 # interface GigabitEthernet0/0/19 port link-type access port default vlan 19 # interface GigabitEthernet0/0/20 port link-type access port default vlan 20 # interface GigabitEthernet0/0/21 port link-type access port default vlan 21 # interface GigabitEthernet0/0/22 port link-type access port default vlan 22 # interface GigabitEthernet0/0/23 port link-type access port default vlan 23 # interface GigabitEthernet0/0/24 port link-type trunk port trunk allow-pass vlan 2 to 23 # interface NULL0 # user-interface con 0 user-interface vty 0 4 # return [Cnitdog-Huawei-Switch-Wan]
六、注意事项:
1、设置完毕后记得注意保存设备配置,防止设备重启配置丢失(用户视图下设置)。
2、在路由器或软路由上面拨号设置VLAN要和交换机的VLAN一致(1端口是VLAN1,那么路由器也要设置成VLAN1,并且账户密码为插入1端口的宽带账户密码),否则拨号会失败!
3、交换机1端口不是没有设置VLAN,因为VLAN1为默认VLAN不显示,为了免得混淆交换机端口和VLAN的对应关系,故使用了VLAN1,生产环境不推荐使用VLAN1。
后续文章将进行介绍如何设置各种路由器多WAN口设置。