07-VLAN典型配置举例
本章节下载: 07-VLAN典型配置举例 (228.44 KB)
H3C S6890产品VLAN典型配置举例
Copyright © 2021 新华三技术有限公司 版权所有,保留一切权利。
非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。
除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。
本文档中的信息可能变动,恕不另行通知。
目 录
本文档介绍基于端口的VLAN、Super VLAN的典型应用场景和配置举例。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文档假设您已了解VLAN特性。
如图1所示,Host A和Host C属于部门A,但是通过不同的设备接入公司网络;Host B和Host D属于部门B,也通过不同的设备接入公司网络。为了通信的安全性,以及避免广播报文泛滥,公司网络中使用VLAN技术来隔离部门间的二层流量。其中部门A使用VLAN 100,部门B使用VLAN 200。
现要求同一VLAN内的主机能够互通,即Host A和Host C能够互通,Host B和Host D能够互通。
图1 基于端口的VLAN组网图
本举例是在R3606版本上进行配置和验证的。
缺省情况下,接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。
# 创建VLAN 100,并将Ten-GigabiteEhernet1/0/1加入VLAN 100。
[DeviceA-vlan100] port ten-gigabitethernet 1/0/1
[DeviceA-vlan100] quit
# 创建VLAN 200,并将Ten-GigabiteEhernet1/0/2加入VLAN 200。
[DeviceA-vlan200] port ten-gigabitethernet 1/0/2
[DeviceA-vlan200] quit
# 为了使Device A上VLAN 100和VLAN 200的报文能发送给Device B,将Ten-GigabiteEhernet1/0/3的链路类型配置为Trunk,并允许VLAN 100和VLAN 200的报文通过。
[DeviceA] interface ten-gigabitethernet 1/0/3
[DeviceA-Ten-GigabitEthernet1/0/3] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/3] port trunk permit vlan 100 200
(2) Device B上的配置与Device A上的配置相同,不再赘述。
(3) 将Host A和Host C配置在一个网段,例如192.168.100.0/24;将Host B和Host D配置在一个网段,比如192.168.200.0/24。
(1) Host A和Host C能够互相ping通,但是均不能ping通Host B。Host B和Host D能够互相ping通,但是均不能ping通Host A。
# 查看Device A上VLAN 100和VLAN 200的配置信息,VLAN 100的报文仅允许通过接口XGE1/0/3和XGE1/0/1,VLAN 200的报文仅允许通过接口XGE1/0/3和XGE1/0/2。
[DeviceA-Ten-GigabitEthernet1/0/3] display vlan 100
VLAN ID: 100
VLAN type: Static
Route interface: Not configured
Description: VLAN 0100
Name: VLAN 0100
Tagged ports:
Ten-GigabiteEhernet1/0/3
Untagged ports:
Ten-GigabiteEhernet1/0/1
[DeviceA-Ten-GigabitEthernet1/0/3] display vlan 200
VLAN ID: 200
VLAN type: Static
Route interface: Not configured
Description: VLAN 0200
Name: VLAN 0200
Tagged ports:
Ten-GigabiteEhernet1/0/3
Untagged ports:
Ten-GigabiteEhernet1/0/2
Device B上的配置与Device A上的配置相同,此处仅以Device A的配置文件举例。
#
vlan 100
#
vlan 200
#
interface Ten-GigabiteEhernet1/0/1
port link-mode bridge
port access vlan 100
#
interface Ten-GigabiteEhernet1/0/2
port link-mode bridge
port access vlan 200
#
interface Ten-GigabiteEhernet1/0/3
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 100 200
#
如图2所示:
· VLAN 2中的用户通过Device A的Ten-GigabiteEhernet1/0/1接入网络,VLAN 3中的用户通过Device A的Ten-GigabiteEhernet1/0/2接入网络。VLAN 2中有30个用户,VLAN 3中有50个用户。
· Device A的Ten-GigabiteEhernet1/0/3和Device B的Ten-GigabiteEhernet1/0/1属于VLAN 20。
· VLAN 20中的终端用户都使用192.168.2.0/24 网段的IP地址,使用192.168.2.1作为网关地址。
现要求通过配置Super VLAN功能实现以下应用需求:
· VLAN 2和VLAN 3中的终端用户都使用192.168.1.0/24网段的IP地址以节省IP地址资源,使用192.168.1.1作为网关地址。
· VLAN 2、VLAN 3、VLAN 20中的终端用户二层隔离,三层互通。
本举例是在R3606版本上进行配置和验证的。
由于Super VLAN中不能包含物理端口,由此若某VLAN中已经包含物理端口,则该VLAN不能被配置为Super VLAN。
缺省情况下,接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。
# 创建Super VLAN 10。
<DeviceA> system-view
[DeviceA] vlan 10
[DeviceA-vlan10] supervlan
[DeviceA-vlan10] quit
# 创建VLAN 2并将端口Ten-GigabiteEhernet1/0/1加入VLAN 2。
[DeviceA] vlan 2
[DeviceA-vlan2] port ten-gigabitethernet 1/0/1
[DeviceA-vlan2] quit
# 创建VLAN 3并将端口Ten-GigabiteEhernet1/0/2加入VLAN 3。
[DeviceA] vlan 3
[DeviceA-vlan3] port ten-gigabitethernet 1/0/2
[DeviceA-vlan3] quit
# 将Super VLAN 10和Sub VLAN 2和Sub VLAN 3关联。
[DeviceA] vlan 10
[DeviceA-vlan10] subvlan 2 3
[DeviceA-vlan10] quit
# 配置Super VLAN 10对应的VLAN接口的IP地址和本地代理ARP功能。
[DeviceA] interface vlan-interface 10
[DeviceA-Vlan-interface10] ip address 192.168.1.1 24
[DeviceA-Vlan-interface10] local-proxy-arp enable
[DeviceA-Vlan-interface10] quit
# 创建VLAN 20。
[DeviceA] vlan 20
[DeviceA-vlan20] quit
# 将端口Ten-GigabiteEhernet1/0/3配置为Trunk端口并允许VLAN 20通过,取消允许VLAN 1通过。
[DeviceA] interface ten-gigabitethernet 1/0/3
[DeviceA-Ten-GigabitEthernet1/0/3] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/3] undo port trunk permit vlan 1
[DeviceA-Ten-GigabitEthernet1/0/3] port trunk permit vlan 20
[DeviceA-Ten-GigabitEthernet1/0/3] quit
# 配置VLAN 20对应的VLAN接口的IP地址。
[DeviceA] interface Vlan-interface 20
[DeviceA-Vlan-interface20] ip address 192.168.2.1 24
[DeviceA-Vlan-interface20] quit
# 创建VLAN 20。
[DeviceB] vlan 20
[DeviceB-vlan20] quit
# 将端口Ten-GigabiteEhernet1/0/1配置为Trunk端口并允许VLAN 20通过,取消允许VLAN 1通过。
[DeviceB] interface ten-gigabitethernet 1/0/1
[DeviceB-Ten-GigabiteEhernet1/0/1] port link-type trunk
[DeviceB-Ten-GigabiteEhernet1/0/1] undo port trunk permit vlan 1
[DeviceB-Ten-GigabiteEhernet1/0/1] port trunk permit vlan 20
[DeviceB-Ten-GigabiteEhernet1/0/1] quit
# 将端口Ten-GigabiteEhernet1/0/2加入VLAN 20。
[DeviceB] vlan 20
[DeviceB-vlan20] port ten-gigabitethernet 1/0/2
[DeviceB-vlan20] quit
(1) 查看Super VLAN配置信息。
[DeviceA] display supervlan
Super VLAN ID: 10
Sub-VLAN ID: 2-3
VLAN ID: 10
VLAN type: Static
It is a super VLAN.
Route interface: Configured
IPv4 address: 192.168.1.1
IPv4 subnet mask: 255.255.255.0
Description: VLAN 0010
Name: VLAN 0010
Tagged ports: none
Untagged ports: none
VLAN ID: 2
VLAN type: Static
It is a sub-VLAN.
Route interface: Configured
IPv4 address: 192.168.1.1
IPv4 subnet mask: 255.255.255.0
Description: VLAN 0002
Name: VLAN 0002
Tagged ports: none
Untagged ports:
Ten-GigabiteEhernet1/0/1
VLAN ID: 3
VLAN type: Static
It is a sub-VLAN.
Route interface: Configured
IPv4 address: 192.168.1.1
IPv4 subnet mask: 255.255.255.0
Description: VLAN 0003
Name: VLAN 0003
Tagged ports: none
Untagged ports:
Ten-GigabiteEhernet1/0/2
(2) Host A和Host B可以互相ping通。查看Host A的ARP表,表中Host B的IP地址对应的MAC地址是Vlan-interface10的MAC地址。查看Host B的ARP表,表中Host A的IP地址对应的MAC地址也是Vlan-interface10的MAC地址。
(3) Host A和Host C可以互相ping通。查看Host A的ARP表,表中没有Host C的ARP表项。查看Host C的ARP表,表中也没有Host A的ARP表项。说明VLAN 2和VLAN 20二层隔离,三层互通。Host B和Host C互相ping的情况同理。
· Device A
#
vlan 2
#
vlan 3
#
vlan 10
supervlan
subvlan 2 3
#
vlan 20
#
interface Vlan-interface10
ip address 192.168.1.1 255.255.255.0
local-proxy-arp enable
#
interface Vlan-interface20
ip address 192.168.2.1 255.255.255.0
#
interface Ten-GigabiteEhernet1/0/1
port link-mode bridge
port access vlan 2
#
interface Ten-GigabiteEhernet1/0/2
port link-mode bridge
port access vlan 3
#
interface Ten-GigabiteEhernet1/0/3
port link-mode bridge
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 20
#
· Device B
#
vlan 20
#
interface Ten-GigabiteEhernet1/0/1
port link-mode bridge
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 20
#
interface Ten-GigabiteEhernet1/0/2
port link-mode bridge
port access vlan 20
#
· H3C S6890交换机 二层技术-以太网交换机配置指导-Release 3606系列
· H3C S6890交换机 二层技术-以太网交换机命令参考-Release 3606系列
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!