大家好,欢迎来到IT知识分享网。
目录
Multi-to-One VLAN Translation 配置
Vlan功能典型配置
一、组网需求
PC1和PC2分别连接到交换机的端口E 0/0/1和E 0/0/2,端口分别属于Vlan 10和Vlan 20。
二、组网图
三、配置步骤
配置方法1:
1.创建(进入)Vlan 10,将E 0/0/1加入到Vlan 10。
switch(config)#vlan 10
switch(config-vlan10)#switchport interface ethernet 0/0/1
switch(config-vlan10)#exit
2.创建(进入)Vlan 20,将E 0/0/2加入到Vlan 20。
switch(config)#vlan 20
switch(config-vlan20)#switchport interface ethernet 0/0/2
switch(config-vlan20)#exit
配置方法2:
1.创建(进入)Vlan10.
switch(config)#vlan 10
switch(config-vlan10)#exit
2.进入接口E 0/0/1,并以ACCESS方式加入Vlan 10
switch(config)#interface ethernet 0/0/1
switch(config-if-Ethernet0/0/1)#switchport access vlan 10
3.创建(进入)Vlan20.
switch(config)#vlan 20
switch(config-vlan20)#exit
4.进入接口E 0/0/2,并以ACCESS方式加入Vlan 20
switch(config)#interface ethernet 0/0/2
switch(config-if-Ethernet0/0/2)#switchport access vlan 20
四、配置关键点
1.如果环境中需要配置多个连续Vlan时(例如:Vlan1-Vlan20)可以使用以下命令创建:
switch(config)#vlan 1-20
注:创建多个Vlan时,可使用vlan ID1-ID2这样的方式创建,一次最多创建 512 个Vlan
上述命令只适用于创建连续Vlan,如果希望创建vlan1-22,Vlan24-50。需要使用两次命令创建
2.如果环境中有多个端口需要加入某一Vlan,或是需要设置多个接口的属性时。可使用以下命令
switch(config)#interface ethernet 0/0/1-20
switch(config-if-range)#switchport access vlan 20
注:上述命令同时将E 0/0/1 -E 0/0/20端口加入到Vlan 20,模式是Access。
Vlan虚接口配置
一、组网需求
1. SwitchA为三层交换机,PC1和PC2可以通过SwitchA进行互通
2. PC1连接到SwitchA的端口E 1/1,属于Vlan 10.
3. PC2连接到SwitchA的端口E 1/2,属于Vlan 20.
4. SwitchA的Vlan 10虚接口IP为192.168.0.1/24,Vlan 20虚接口IP为192.168.1.1/24。分别做为PC1和PC2的网关。
二、组网图
三、配置步骤
1. 创建(进入)Vlan 10,并将端口E 1/1划分到Vlan10
switch(config)#vlan 10
switch(config-vlan10)#switchport interface ethernet 1/1
switch(config-vlan10)#exit
2. 配置Vlan10的虚接口IP为192.168.0.1/24
switch(config)#interface vlan 10
switch(config-if-vlan10)#ip address 192.168.0.1 255.255.255.0
3. 创建(进入)Vlan 20,并将端口E 1/2划分到Vlan20
switch(config)#vlan 20
switch(config-vlan20)#switchport interface ethernet 1/2
switch(config-vlan20)#exit
4. 配置Vlan20的虚接口IP为192.168.1.1/24
switch(config)#interface vlan 20
switch(config-if-vlan20)#ip address 192.168.1.1 255.255.255.0
四、配置关键点
1. 交换机的Vlan虚接口只有当属于这个Vlan的所有物理端口Down之后,虚接口才会Down。
2. 对于三层交换机,可以配置多个Vlan虚接口地址,并且默认情况下各个Vlan虚接口之间可以互访。对于二层交换机来说,Vlan虚接口配置的IP地址只能用于管理使用。
私有Vlan典型配置
一、组网需求
1. 交换机Switch做为内网交换机。Switch上有三个Vlan,分别为Vlan 20,30,40.
2. PC1和PC2属于Vlan20,PC3和PC4属于Vlan30,PC5和PC6属于Vlan40.
3. 通过划分私有Vlan,实现PC1、PC2之间可以互访,也可以访问PC3、PC4和PC5、PC6.
同时,PC3、PC4之间也不可以互访,只能访问到PC1、PC2,无法访问到PC5、PC6.
PC5、PC6之间可以互访,也可以访问到PC1、PC2,但无法访问到PC3、PC4.
二、组网图
三、配置步骤
1. 交换机上创建(进入)对应Vlan 20、30、40
switch(config)#vlan 20
switch(config)#exit
switch(config)#vlan 30
switch(config)#exit
switch(config)#vlan 40
switch(config)#exit
2. 指定Vlan20为私有Primary Vlan
switch(config)#vlan 20
switch(config-vlan20)#private-vlan primary
switch(config)#exit
3. 指定Vlan30为私有Isloated Vlan
switch(config)#vlan 30
switch(config-vlan30)#private-vlan isolated
switch(config)#exit
4. 指定Vlan40为私有Community Vlan
switch(config)#vlan 40
switch(config-vlan40)#private-vlan community
switch(config)#exit
5. 配置私有Vlan绑定关系,将Vlan20和Vlan30、40绑定
switch(config)#vlan 20
switch(config-vlan20)#private-vlan association 30;40
switch(config)#exit
6. 添加相应端口到私有Vlan
switch(config)#vlan 20
switch(config-vlan20)#switchport interface ethernet 1/1-2
switch(config)#exit
switch(config)#vlan 30
switch(config-vlan30)#switchport interface ethernet 1/3-4
switch(config)#exit
switch(config)#vlan 40
switch(config-vlan40)#switchport interface ethernet 1/5-6
switch(config)#exit
四、配置关键点
1. 当Vlan加入私有Vlan后,原Vlan内的接口会清空。所以在配置过程中,最后配置端口和私有Vlan的归属关系。
2. 私有Vlan的属于只在本地生效。例如,两台交换机使用Trunk互联,只能实现在本交换机内primary vlan和本交换机上的Isolated vlan,Community vlan的访问关系。
3. 在实际应用中,如果只是需要下联端口间的隔离功能。建议使用 端口功能中的端口隔离。
动态Vlan典型配置
一、基于MAC的动态Vlan
1.1 组网需求
用户网络中存在两台服务器Server1和Server2,分别属于Vlan100和Vlan200。
对于用户的PC 1(MAC 00-11-11-11-11-11)希望不论连接到那台接入交换机,都会属于Vlan100。而PC 2(MAC 00-22-22-22-22-22)不论连接到那台接入交换机都会属于Vlan200。
1.2 组网图
1.3 配置步骤
SW 1的配置
#创建Vlan 100和Vlan 200,并将E 1/13和E 1/14分别配置属于Vlan 100和Vlan200
switch(config)#vlan 100
switch(config-vlan100)#switchport interface ethernet 1/13
switch(config)#vlan 200
switch(config-vlan200)#switchport interface ethernet 1/14
#配置E 1/1和E 1/2为Trunk端口,允许Vlan 100和Vlan 200通过
switch(config)#interface ethernet 1/1-2
switch(config-if-port-range)#switchport mode trunk
switch(config-if-port-range)#switchport trunk allowed vlan 100;200
SW 2的配置
#创建Vlan 100和Vlan 200,并将端口E 0/0/25设置为Trunk端口,允许Vlan 100和200通过
switch(config)#vlan 100
switch(config)#vlan 200
switch(config)#interface ethernet 0/0/25
switch(config-if-port-range)#switchport mode trunk
switch(config-if-port-range)#switchport trunk allowed vlan 100;200
#配置Vlan 100和Vlan 200为MAC-Vlan
switch(config)#mac-vlan 100
switch(config)#mac-vlan 200
#配置PC 1和PC 2的MAC和Vlan的对应关系
switch(config)#mac-vlan mac 00-11-11-11-11-11 vlan 100 priority 0
switch(config)#mac-vlan mac 00-22-22-22-22-22 vlan 200 priority 0
#配置SW 2下联端口模式为Hybrid端口,允许Vlan 100和Vlan 200通过并且不打Tag
switch(config)#interface ethernet 0/0/1-24
switch(config-if-port-range)#switchport mode hybrid
switch(config-if-port-range)#switchport hybrid allowed vlan 100,200 untag
1.4 注意事项
MAC-VLAN必须要和Hybrid端口配合使用。
二、基于IP的动态Vlan
2.1 组网需求
2.2 组网图
2.3 配置步骤
SW 1的配置
#创建Vlan 100和Vlan 200,并配置端口E 1/23和E 1/24分别属于Vlan 100和Vlan 200
switch(config)#vlan 100
switch(config-vlan100)#switchport interface ethernet 1/23
switch(config)#vlan 200
switch(config-vlan200)#switchport interface ethernet 1/24
#配置IP地址和Vlan的对应关系
switch(config)#subnet-vlan ip-address 1.1.1.1 mask 255.255.255.0 vlan 100 priority 0
switch(config)#subnet-vlan ip-address 2.2.2.2 mask 255.255.255.0 vlan 200 priority 0
#配置下联端口开启基于IP的动态Vlan功能,并指定下联口做为Hybrid端口,允许Vlan 100和Vlan 200通过并且不带Tag
switch(config)#interface ethernet 1/1-16
switch(config-if-port-range)#switchport mode hybrid
switch(config-if-port-range)#switchport hybrid allowed vlan 100,200 untag
2.4 注意事项
无
QinQ功能配置
一、组网说明
CE A和CE B是用户端设备,属于一个公司在不同地市的两个部分。中间经过运营商链路通讯,PE A和PE B是运营商设备。负责将CE A和CE B设备发出的报文打上外层Vlan 3的Tag在运营商网络中传输。
二、组网图
三、配置步骤
PE A的配置
#创建Vlan 3,并配置E 1/1端口打开QinQ功能
switch(Config)#vlan 3
switch(Config-Vlan3)#switchport interface ethernet 1/1
switch(Config-Vlan3)#exit
switch(Config)#interface ethernet 1/1
switch(Config-Ethernet1/1)#dot1q-tunnel enable
switch(Config-Ethernet1/1)#exit
#配置E 1/2端口做为Trunk端口,并且配置QinQ在传输时使用的TPID为0x8100
switch(Config)#interface ethernet 1/2
switch(Config-Ethernet1/2)#switchport mode trunk
switch(Config-Ethernet1/2)#dot1q-tunnel tpid 0x8100
switch(Config-Ethernet1/2)#exit
PE B的配置
#创建Vlan 3,并配置E 1/1端口打开QinQ功能
switch(Config)#vlan 3
switch(Config-Vlan3)#switchport interface ethernet 1/1
switch(Config-Vlan3)#exit
switch(Config)#interface ethernet 1/1
switch(Config-Ethernet1/1)#dot1q-tunnel enable
switch(Config-Ethernet1/1)#exit
#配置E 1/2端口做为Trunk端口,并且配置QinQ在传输时使用的TPID为0x8100
switch(Config)#interface ethernet 1/2
switch(Config-Ethernet1/2)#switchport mode trunk
switch(Config-Ethernet1/2)#dot1q-tunnel tpid 0x8100
switch(Config-Ethernet1/2)#exit
四、注意事项
1.配置QinQ时,需要注意两台QinQ设备间配置的TPID保持一致。
GVRP 配置
一、组网说明
支持GVRP的交换机也以将本机的VLAN注册信息向其它交换机传播,通过VLAN注册信息的传播,使得所有支持GVRP的交换机VLAN信息统一。SW1,SW3配置有VLAN10,SW2没有配置VLAN10。三台交换机互连的trunk接口开启gvrp,SW2上会动态注册VLAN10。
二、组网图
三、配置步骤
SW1配置
#创建VLAN10,并将e1/1端口设置为trunk,全局与 trunk端口上开启gvrp.
switch(config)#vlan 10
switch(config)#gvrp
switch(config)#interface ethernet 1/1
switch(cofnig-if-ethernet1/1)#switchport mode trunk
switch(cofnig-if-ethernet1/1)#gvrp
SW2配置
#全局开启gvrp,e1/1,e1/2端口模式改为trunk
switch(config)#gvrp
switch(config)#interface ethernet 1/1
switch(config-if-ethernet1/1)#switchport mode trunk
switch(cofnig-if-ethernet1/1)#gvrp
switch(config-if-ethernet1/1)#interface ethernet 1/2
switch(config-if-ethernet1/2)#switchport mode trunk
switch(cofnig-if-ethernet1/2)#gvrp
SW3配置同SW1
四、注意事项
1.Trunk链路两端Trunk端口的GARP计数器设置必须相同,否则GVRP不能正常工作。交换机的GVRP功能不能和RSTP同时打开,如果要打开GVRP功能,请首先关闭端口的RSTP功能。
SUPER VLAN 配置
一、组网说明
Super VLAN技术(也称VLAN聚合)引入super VLAN和sub VLAN的概念。一个super VLAN可以包含一个或多个保持着不同广播域的sub VLAN。Sub VLAN不再占用一个独立的子网网段。在同一个super VLAN中,无论主机属于哪一个sub VLAN,它的IP地址都在super VLAN对应的子网网段内。vlan10为super vlan,vlan20,30为样subvlan地址范围分别为vlan20:10.1.1.1-10.1.1.20,vlan30:10.1.1.21-30.
二、组网图
三、配置步骤
switch配置
#在交换机上创建VLAN10,20,30将10设置为supervlan,20,30设置为subvlan,并指定subvlan的地址范围,在supervlan下开启ARP代理
switch(config)#vlan 10,20,30
switch(config-vlan2)#vlan 2
switch(cofnig)#supervlan
switch(config)#interface vlan 2
switch(config-if-vlan2)#ip address 10.1.1.254 255.255.255.0
switch(config-if-vlan2)#arp-proxy subvlan all
switch(config-if-vlan2)#ip-addr-range subvlan 20 10.1.1.1 to 10.1.1.20
switch(config-if-vlan2)#ip-addr-range subvlan 30 10.1.1.21 to 10.1.1.30
四、注意事项
- supervlan功能与VRRP、动态VLAN、私有VLAN、组播VLAN等功能互斥,不要同时使用。
- subvlan上不能建立三层接口.
当supervlan的接口上指定了接口的IP地址范围,未指定subvlan地址范围,则以接口上规定的地址范围为准;当接口和subvlan上都指定了IP地址范围时,按顺序先检查是否在subvlan地址范围内,然后再检查是否在接口地址范围内,通过上述两次检查后的数据包才可以进入后续处理环节。
VLAN-translation 配置
一、组网说明
PE-A将从CE-A用户进来VLAN10的数据,更改VLAN TAG 为VLAN20在运营商网里传输;同时将运营商中传来的VLAN20的数据更改VLAN TAG为VLAN10传回CE-A,PE-B同PE-A。
二、组网图
三、配置步骤
PE-A配置
#PE-A e1/1 端口连接CE-A,将CE-A过来的数据为VLAN10的数据更改TAG为VLAN20,将公网传来的VLAN20的数据更改TAG为VLAN10,e1/2连接公网。
switch(config)#interface ethernet 1/1
switch(config-if-ethernet1/1)#switchport mode trunk
switch(config-if-ethernet1/1)#vlan-translation enable
switch(config-if-ethernet1/1)#vlan-translation 10 to 20 in
switch(config-if-ethernet1/1)#vlan-translation 20 to 10 out
switch(config)#interface ethernet 1/2
switch(config-if-ethernet)#switchport mode trunk
四、注意事情
1.VLAN-translation一般在trunk端口上使用。
2.使用VLAN-translation时一般要先启用dot1q-tunnel功能,以适应双标签的数据包可以进行正常VLAN翻译。
Multi-to-One VLAN Translation 配置
一、组网说明
将用户上来的VLAN10,VLAN20,VLAN30的数据统一打上新的VLAN100的TAG出去。
二、组网图
三、配置步骤
SWITCH配置
#将用户上来的VLAN10,VLAN20,VLAN30的数据统一打上新的VLAN100的TAG出去,在e1/1,e1/2,e1/3(下联口)配置转换,上联口配置为 trunk.
switch(config)#vlan10,20,30,100
switch(config)#interface ethernet 1/1
switch(config-if-ethernet1/1)#switchport mode trunk
switch(config-if-ethernet1/1)#vlan-translation n-to-1 10,20,30 to 100
switch(config-if-ethernet1/2)#switchport mode trunk
四、注意事项
- 1。Dot1q-tunnel同时使用。
- 2.VLAN-translation同时使用。
- 3.VLAN中不能存在相同的MAC地址。
- 4.地址限制学习可能会影响该功能使用。
- 5.该功能要在开启MAC软件学习后使用。
Voice VLAN 配置
一、组网说明
ip-phone1与ip-phone2可以接在交换机任意端口上即可正常通讯,ip-phone1 MAC地址为00-03-0f-00-00-01接在E1/1口,ip-phone2 MAC地址为00-03-0f-00-00-02接在E1/2口,E1/10为上联口。
二、组网图
三、配置步骤
switch配置
#将ip-phone MAC地址加入,设置优先级,将接电话机的端口改为hybrid 并且不语音VLAN不打标签。
switch(config)#vlan 100
switch(config)#voice-vlan vlan 100
switch(config)#voice-vlan mac 00-03-0f-00-00-01 mask 255 priority 5 name company
switch(config)#voice-vlan mac 00-03-0f-00-00-02 mask 255 priority 5 name company
switch(config)#interface ethernet 1/10
switch(config-if-ethernet1/10)#switchport mode trunk
switch(config-if-ethernet1/1)#switchport mode hybrid
switch(config-if-ethernet1/1)#switchport hybrid allowed vlan 100 untag
e1/2同e1/1
四、注意事项
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/149445.html