VLAN交换机多拨之思科交换机配置脚本(注意TRUNK口对NATVE VLAN处理)

post by rocdk890 / 2012-9-26 9:02 Wednesday 网络技术

目的:多条ADSL分别接入1到23口,24口连接routeros。
          1到23口分别属于vlan1到vlan23,24口做trunk。

交换机型号:CISCO WS-C2950-24

其他型号思科交换机,一般也可直接使用下面的配置。

配置:

enable

config term

interface fastEthernet 0/1
switchport access vlan 1
switchport mode access
no shutdown

interface fastEthernet 0/2
switchport access vlan 2
switchport mode access
no shutdown

interface fastEthernet 0/3
switchport access vlan 3
switchport mode access
no shutdown

interface fastEthernet 0/4
switchport access vlan 4
switchport mode access
no shutdown

interface fastEthernet 0/5
switchport access vlan 5
switchport mode access
no shutdown

interface fastEthernet 0/6
switchport access vlan 6
switchport mode access
no shutdown

interface fastEthernet 0/7
switchport access vlan 7
switchport mode access
no shutdown

interface fastEthernet 0/8
switchport access vlan 8
switchport mode access
no shutdown

interface fastEthernet 0/9
switchport access vlan 9
switchport mode access
no shutdown

interface fastEthernet 0/10
switchport access vlan 10
switchport mode access
no shutdown

interface fastEthernet 0/11
switchport access vlan 11
switchport mode access
no shutdown

interface fastEthernet 0/12
switchport access vlan 12
switchport mode access
no shutdown

interface fastEthernet 0/13
switchport access vlan 13
switchport mode access
no shutdown

interface fastEthernet 0/14
switchport access vlan 14
switchport mode access
no shutdown

interface fastEthernet 0/15
switchport access vlan 15
switchport mode access
no shutdown

interface fastEthernet 0/16
switchport access vlan 16
switchport mode access
no shutdown

interface fastEthernet 0/17
switchport access vlan 17
switchport mode access
no shutdown

interface fastEthernet 0/18
switchport access vlan 18
switchport mode access
no shutdown

interface fastEthernet 0/19
switchport access vlan 19
switchport mode access
no shutdown

interface fastEthernet 0/20
switchport access vlan 20
switchport mode access
no shutdown

interface fastEthernet 0/21
switchport access vlan 21
switchport mode access
no shutdown

interface fastEthernet 0/22
switchport access vlan 22
switchport mode access
no shutdown

interface fastEthernet 0/23
switchport access vlan 23
switchport mode access
no shutdown

interface fastEthernet 0/24
switchport mode trunk
switchport trunk native vlan 99
switchport trunk allowed vlan 1-23
no shutdown

end
copy run start
是不是比其他品牌的交换机配置都简单,几秒种就搞定了。


注意:trunk口要配置switchport trunk native vlan 99,要不然vlan1出来的数据将不带tag(如果这样ros在vlan1上不能拨号)。如果你不想改TRUNK口的NATIVE VLAN,也可改接口1的VLAN,但这样接口1的接口号和VLAN号就不统一了。
夜空- 本站版权
1、本站所有主题由该文章作者发表,该文章作者与夜空享有文章相关版权
2、其他单位或个人使用、转载或引用本文时必须同时征得该文章作者和夜空的同意
3、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
4、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
5、原文链接:blog.slogra.com/post-259.html

标签: 配置 脚本 vlan cisco trunk 交换机

  1. gravatar gdsspt
    2013-09-07 10:00
    谢谢分享.

评论: