• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 关于我们

03-二层技术-以太网交换配置举例

目录

05-VLAN典型配置举例

本章节下载 05-VLAN典型配置举例  (241.92 KB)

05-VLAN典型配置举例


1  简介

本文档介绍基于端口的VLAN、Super VLAN、Private VLAN、Voice VLAN的典型应用场景和配置举例。

2  配置前提

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文档假设您已了解VLAN特性。

3  基于端口的VLAN典型配置举例

3.1  组网需求

图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组网图

 

3.2  适用产品及版本

表1 适用产品及版本

产品

软件版本

S9850-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6850-G系列

S6805-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6530X系列

Release 8108P22及以上版本、Release 8307P10及以上版本

S6530X-G系列

Release 8307P24及以上版本

S5590-HI系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S5590-EI系列

S5500V3-HI系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6520X-EI-G系列

S6520XP-EI-G系列

Release 7748及以上版本

FS5500-EI系列

Release 8108P11及以上版本、Release 8307P10及以上版本

FS5500V2-EI系列

Release 8108P11及以上版本

FS6300V2-EI系列

Release 8307P53及以上版本

S5590XP-HI-G系列

Release 7748及以上版本

S5560-EI-G系列

Release 7748及以上版本

S5500-D-G系列

S5100-D-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

FS5300-EI系列

Release 8108P11及以上版本、Release 8307P10及以上版本

S5130S-HI-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S5130S-EI-G系列(除S5130S-30C-EI-G、S5130S-54C-EI-G)

Release 6010P03及以上版本、Release 8307P10及以上版本

S5130S-30C-EI-G

S5130S-54C-EI-G

Release 7748及以上版本

 

3.3  配置步骤

(1)     配置Device A

# 创建VLAN 100,并将Ten-GigabitEthernet1/0/1加入VLAN 100。

[DeviceA] vlan 100

[DeviceA-vlan100] port ten-gigabitethernet 1/0/1

[DeviceA-vlan100] quit

# 创建VLAN 200,并将Ten-GigabitEthernet1/0/2加入VLAN 200。

[DeviceA] vlan 200

[DeviceA-vlan200] port ten-gigabitethernet 1/0/2

[DeviceA-vlan200] quit

# 为了使Device A上VLAN 100和VLAN 200的报文能发送给Device B,将Ten-GigabitEthernet1/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。

3.4  验证配置

(1)     Host A和Host C能够互相ping通,但是均不能ping通Host B。Host B和Host D能够互相ping通,但是均不能ping通Host A。

(2)     通过查看显示信息验证配置是否成功。

# 查看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-GigabitEthernet1/0/3

 Untagged ports:

    Ten-GigabitEthernet1/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-GigabitEthernet1/0/3

 Untagged ports:

    Ten-GigabitEthernet1/0/2

3.5  配置文件

Device B上的配置与Device A上的配置相同,此处仅以Device A的配置文件举例。

#

vlan 100

#

vlan 200

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 100

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 200

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100 200

#

4  Voice VLAN配置举例

4.1  组网需求

图2所示,设备通过接口Ten-GigabitEthernet1/0/1IP电话相连,IP电话发送Tagged语音数据。设备通过RADIUS服务器对IP电话进行身份认证,如果认证成功,IP电话被授权允许接入。在设备上配置VLAN ID2Voice VLAN,通过LLDP功能使IP电话经过802.1X认证后可自动上线。

现要求实现如下需求:

·     IP电话在接口Ten-GigabitEthernet1/0/1经过802.1X认证后上线。

·     不用在设备上手动配置Voice VLAN MAC地址,IP电话可自动上线传输语音数据。

图2 配置802.1X认证的自动模式下Voice VLAN配置组网图

 

4.2  配置思路

·     缺省情况下,IP电话支持LLDP功能。

·     开启LLDP自动发现IP电话功能时,需在端口Ten-GigabitEthernet1/0/1配置发布network-policy TLV通告Voice VLAN信息。

·     设备上开启自动模式下的Voice VLAN功能。

·     配置各接口的IP地址。

4.3  适用产品及版本

表2 适用产品及版本

产品

软件版本

S9850-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6850-G系列

S6805-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6530X系列

Release 8108P22及以上版本、Release 8307P10及以上版本

S6530X-G系列

Release 8307P24及以上版本

S5590-HI系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S5590-EI系列

S5500V3-HI系列

Release 6010P03及以上版本、Release 8307P10及以上版本

FS5500-EI系列

Release 8108P11及以上版本、Release 8307P10及以上版本

FS5500V2-EI系列

Release 8108P11及以上版本

FS6300V2-EI系列

Release 8307P53及以上版本

S6520X-EI-G系列

S6520XP-EI-G系列

Release 7748及以上版本

S5590XP-HI-G系列

Release 7748及以上版本

S5560-EI-G系列

Release 7748及以上版本

S5500-D-G系列

S5100-D-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

FS5300-EI系列

Release 8108P11及以上版本、Release 8307P10及以上版本

S5130S-HI-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S5130S-EI-G系列(除S5130S-30C-EI-G、S5130S-54C-EI-G)

Release 6010P03及以上版本、Release 8307P10及以上版本

S5130S-30C-EI-G

S5130S-54C-EI-G

Release 7748及以上版本

 

4.4  配置注意事项

发送给服务器的用户名是否携带域名与服务器端是否接受携带域名的用户名以及服务器端的配置有关:

·     若服务器端不接受携带域名的用户名,或者服务器上配置的用户认证所使用的服务不携带域名后缀,则Device上指定不携带用户名(without-domain);

·     若服务器端可接受携带域名的用户名,且服务器上配置的用户认证所使用的服务携带域名后缀,则Device上指定携带用户名(with-domain)。

4.5  配置步骤

4.5.1  配置Voice VLAN

# 创建VLAN 2。

<Device> system-view

[Device] vlan 2

[Device-vlan2] quit

# 全局开启LLDP功能。

[Device] lldp global enable

# 在接口Ten-GigabitEthernet1/0/1上开启LLDP功能,配置LLDP工作模式为TxRx,并发布Voice VLAN ID。

[Device] interface ten-gigabitethernet 1/0/1

[Device-Ten-GigabitEthernet1/0/1] lldp enable

[Device-Ten-GigabitEthernet1/0/1] lldp admin-status txrx

[Device-Ten-GigabitEthernet1/0/1] lldp tlv-enable med-tlv network-policy 2

[Device-Ten-GigabitEthernet1/0/1] quit

# 配置Voice VLAN工作在安全模式,老化时间为30分钟。

[Device] voice-vlan security enable

[Device] voice-vlan aging 30

# 开启通过LLDP自动发现IP电话功能。

[Device] voice-vlan track lldp

# 将接口Ten-GigabitEthernet1/0/1配置为Hybrid端口,并配置Voice VLAN功能。

[Device] interface ten-gigabitethernet 1/0/1

[Device-Ten-GigabitEthernet1/0/1] port link-type hybrid

[Device-Ten-GigabitEthernet1/0/1] voice-vlan mode auto

[Device-Ten-GigabitEthernet1/0/1] voice-vlan 2 enable

4.5.2  配置802.1X认证功能

# 配置RADIUS服务器,添加用户帐户,保证用户的认证/授权/计费功能正常运行(略)

# 创建RADIUS方案,并配置RADIUS方案主认证/计费服务器及其通信密钥。发送给RADIUS服务器的用户名不携带域名。

[Device] radius scheme radius1

[Device-radius-radius1] primary authentication 10.1.1.1

[Device-radius-radius1] primary accounting 10.1.1.1

[Device-radius-radius1] key authentication simple name

[Device-radius-radius1] key accounting simple money

[Device-radius-radius1] user-name-format without-domain

[Device-radius-radius1] quit

# 创建域bbb,并配置802.1X用户使用RADIUS方案radius1进行认证、授权、计费。

[Device] domain bbb

[Device-isp-bbb] authentication lan-access radius-scheme radius1

[Device-isp-bbb] authorization lan-access radius-scheme radius1

[Device-isp-bbb] accounting lan-access radius-scheme radius1

[Device-isp-bbb] quit

# 在端口Ten-GigabitEthernet1/0/1上配置802.1X功能,并指定端口上接入的802.1X用户使用强制认证域bbb。

[Device] interface ten-gigabitethernet 1/0/1

[Device-Ten-GigabitEthernet1/0/1] dot1x

[Device-Ten-GigabitEthernet1/0/1] dot1x mandatory-domain bbb

# 开启组播触发功能(此配置可选,因为缺省情况下设备开启组播触发功能)。

[Device-Ten-GigabitEthernet1/0/1] dot1x multicast-trigger

[Device-Ten-GigabitEthernet1/0/1] quit

# 开启全局802.1X。

[Device] dot1x

# 配置802.1X客户端(略)

若使用iNode 802.1X客户端,为保证备选的本地认证可成功进行,请确认802.1X连接属性中的“上传客户端版本号”选项未被选中。

4.6  验证配置

# 查看802.1X认证信息。

[Device] display dot1x interface ten-gigabitethernet 1/0/1

 Global 802.1X parameters:

   802.1X authentication                : Enabled

   CHAP authentication                  : Enabled

   Max-tx period                        : 30 s

   Handshake period                     : 15 s

   Offline detect period                : 300 s

   Quiet timer                          : Disabled

       Quiet period                     : 60 s

   Supp timeout                         : 30 s

   Server timeout                       : 100 s

   Reauth period                        : 3600 s

   Max auth requests                    : 2

   User aging period for Auth-Fail VLAN : 1000 s

   User aging period for Auth-Fail VSI  : 1000 s

   User aging period for critical VLAN  : 1000 s

   User aging period for critical VSI   : 1000 s

   User aging period for guest VLAN     : 1000 s

   User aging period for guest VSI      : 1000 s

   EAD assistant function               : Disabled

       EAD timeout                      : 30 min

   Domain delimiter                     : @

 Online 802.1X wired users              : 1

 

 Ten-GigabitEthernet1/0/1  is link-up

   802.1X authentication            : Enabled

   Handshake                        : Enabled

   Handshake reply                  : Disabled

   Handshake security               : Disabled

   Offline detection                : Disabled

   Unicast trigger                  : Disabled

   Periodic reauth                  : Disabled

   Port role                        : Authenticator

   Authorization mode               : Auto

   Port access control              : MAC-based

   Multicast trigger                : Enabled

   Mandatory auth domain            : Not configured

   Guest VLAN                       : Not configured

   Auth-Fail VLAN                   : Not configured

   Critical VLAN                    : Not configured

   Critical voice VLAN              : Disabled

   Add Guest VLAN delay             : Disabled

   Re-auth server-unreachable       : Logoff

   Max online users                 : 4294967295

   User IP freezing                 : Disabled

   Reauth period                    : 0 s

   Send Packets Without Tag         : Disabled

   Max Attempts Fail Number         : 0

   Guest VSI                        : Not configured

   Auth-Fail VSI                    : Not configured

   Critical VSI                     : Not configured

   Add Guest VSI delay              : Disabled

   User aging                       : Enabled

   Server-recovery online-user-sync : Enabled

   Auth-Fail EAPOL                  : Disabled

   Critical EAPOL                   : Disabled

 

   EAPOL packets: Tx 0, Rx 0

   Sent EAP Request/Identity packets : 0

        EAP Request/Challenge packets: 0

        EAP Success packets: 0

        EAP Failure packets: 0

   Received EAPOL Start packets : 0

            EAPOL LogOff packets: 0

            EAP Response/Identity packets : 0

            EAP Response/Challenge packets: 0

            Error packets: 0

   Online 802.1X users: 1

当IP电话输入正确的用户名和密码成功上线后,可使用命令display dot1x connection查看到上线用户的连接情况。

# 显示当前Voice VLAN的状态。

[Device] display voice-vlan state

 Current voice VLANs: 1

 Voice VLAN security mode: Security

 Voice VLAN aging time: 30 minutes

 Voice VLAN enabled ports and their modes:

 Port                        VLAN        Mode        CoS        DSCP

 XGE1/0/1                     2           Auto        6          46

4.7  配置文件

#

 voice-vlan aging 30

 voice-vlan track lldp

#

 dot1x

#

 lldp global enable

#

vlan 1

#

vlan 2

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port link-type hybrid

 port hybrid vlan 1 untagged

 voice-vlan 2 enable

 lldp tlv-enable med-tlv network-policy 2

 dot1x

 dot1x mandatory-domain bbb

#

radius scheme radius1

 primary authentication 10.1.1.1

 primary accounting 10.1.1.1

 key authentication cipher $c$3$/gxrbATUfK4BbF+73EQiCzBM7cwP86o=

 key accounting cipher $c$3$mq8b76RILWQr2lH7NTtvE9+7O0v7vd1H

 user-name-format without-domain

#

radius scheme system

 user-name-format without-domain

#

domain bbb

 accounting login radius-scheme radius1

 authentication lan-access radius-scheme radius1

 authorization lan-access radius-scheme radius1

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们