09-VLAN典型配置举例
本章节下载: 09-VLAN典型配置举例 (164.13 KB)
H3C S12500X-AF产品VLAN典型配置举例
Copyright © 2017 杭州华三通信技术有限公司 版权所有,保留一切权利。 非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。 |
本文档介绍基于端口的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组网图
本举例是在R2609版本上进行配置和验证的。
# 创建VLAN 100,并将HundredGigE1/0/11加入VLAN 100。
<DeviceA> system-view
[DeviceA] interface hundredgige 1/0/11
[DeviceA-HundredGigE1/0/11] undo shutdown
[DeviceA-HundredGigE1/0/11] quit
[DeviceA-vlan100] port HundredGigE 1/0/11
[DeviceA-vlan100] quit
# 创建VLAN 200,并将HundredGigE1/0/12加入VLAN 200。
[DeviceA] interface hundredgige 1/0/12
[DeviceA-HundredGigE1/0/12] undo shutdown
[DeviceA-HundredGigE1/0/12] quit
[DeviceA] vlan 200
[DeviceA-vlan200] port HundredGigE 1/0/12
[DeviceA-vlan200] quit
# 为了使Device A上VLAN 100和VLAN 200的报文能发送给Device B,将HundredGigE1/0/13的链路类型配置为Trunk,并允许VLAN 100和VLAN 200的报文通过。
[DeviceA] interface HundredGigE 1/0/13
[DeviceA-HundredGigE1/0/13] port link-type trunk
[DeviceA-HundredGigE1/0/13] port trunk permit vlan 100 200
[DeviceA-HundredGigE1/0/13] undo shutdown
(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的报文仅允许通过接口HGE1/0/13和HGE1/0/11,VLAN 200的报文仅允许通过接口HGE1/0/13和HGE1/0/12。
[DeviceA-HundredGigE1/0/13] display vlan 100
VLAN ID: 100
VLAN type: Static
Route interface: Not configured
Description: VLAN 0100
Name: VLAN 0100
Tagged ports:
HundredGigE1/0/13
Untagged ports:
HundredGigE1/0/11
[DeviceA-HundredGigE1/0/13] display vlan 200
VLAN ID: 200
VLAN type: Static
Route interface: Not configured
Description: VLAN 0200
Name: VLAN 0200
Tagged ports:
HundredGigE1/0/13
Untagged ports:
HundredGigE1/0/12
Device B上的配置与Device A上的配置相同,此处仅以Device A的配置文件举例。
#
vlan 100
#
vlan 200
#
interface HundredGigE1/0/11
port link-mode bridge
port access vlan 100
#
interface HundredGigE1/0/12
port link-mode bridge
port access vlan 200
#
interface HundredGigE1/0/13
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 100 200
#
· H3C S12500X-AF系列交换机 二层技术-以太网交换机配置指导-R26xx
· H3C S12500X-AF系列交换机 二层技术-以太网交换机命令参考-R26xx
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!