• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S12500X-AF & S12500-X & S9800系列以太网交换机 典型配置举例-Release 27xx系列-6W100

目录

35-IP Source Guard典型配置举例

本章节下载 35-IP Source Guard典型配置举例  (311.90 KB)

docurl=/cn/Service/Document_Software/Document_Center/Home/Switches/00-Public/Configure/Typical_Configuration_Example/H3C_S12500X-AF_S12500-X_S9800_CE-6W100/201907/1212655_30005_0.htm

35-IP Source Guard典型配置举例

H3C S12500X-AF & S12500-X & S9800产品IP Source Guard配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

资料版本:6W100-20190628

 

Copyright © 2019 新华三技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。

除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。

本文档中的信息可能变动,恕不另行通知。

 



1  简介

本文档介绍IP Source Guard的配置举例。

IP Source Guard功能用于对端口收到的报文进行过滤控制,以防止非法用户报文通过。

配置了IP Source Guard功能的端口只转发与绑定表项匹配的报文。IP Source Guard绑定表项可以通过手工配置(命令行手工配置产生静态绑定表项)和动态获取(根据DHCP的相关表项动态生成绑定表项)两种方式生成。

2  配置前提

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

本文假设您已了解本文档中的IP Source Guard特性。

3  基于IPv4静态绑定的IP Source Guard配置举例

3.1  组网需求

图1所示,在一个小型网络中,各主机和服务器均使用静态配置的IPv4地址。要求在Device A和Device B上配置IP Source Guard全局静态绑定表项和端口静态绑定表项,并在端口下开启IP Source Guard功能(IP+MAC绑定),对Device A和Device B接收到的报文进行过滤,以防止非法用户报文通过。

具体需求如下:

·     Device A的端口XGE1/0/1允许Host A发送的IP报文通过。

·     Device A的所有端口都允许Host B发送的IP报文通过。

·     Device B的端口XGE1/0/1只允许Host A和Host B发送的IP报文通过。

·     Device B的端口XGE1/0/2只允许File Server发送的IP报文通过。

图1 基于IPv4静态绑定的IP Source Guard组网图

3.2  配置思路

由于各主机和服务器都是用静态IP地址和固定MAC地址,因此若要实现Device A的某个端口上仅允许特定主机通过,可在端口下配置IP Source Guard静态绑定表项;若要实现允许特定主机的报文通过Device A的任意端口,则需要配置IP Source Guard全局静态绑定表项。若要实现Device B的某个端口上仅允许特定主机通过,可在端口下配置IP Source Guard静态绑定表项。

3.3  使用版本

本举例进行配置和验证所使用的版本,如表1所示。

表1 产品与软件版本适配关系

产品

软件版本

S12500X-AF系列交换机

S12500X-CMW710-R2712

S12500-X系列交换机

S12500X-CMW710-R2712

S9800系列交换机

S9800-CMW710-R2712

 

3.4  配置注意事项

IP Source Guard功能静态绑定表项中的VLAN参数不作为过滤报文的特征项,VLAN参数指定与否,不影响IP Source Guard功能对报文的过滤结果。

缺省情况下,S12500X-AF系列、S12500-X系列、S9800系列交换机的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。

 

3.5  配置步骤

3.5.1  Device A的配置

# 创建VLAN 10,并将端口Ten-GigabitEthernet1/0/1~Ten-GigabitEthernet1/0/3加入VLAN 10。

<DeviceA> system-view

[DeviceA] vlan 10

[DeviceA-vlan10] port ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/3

[DeviceA-vlan10] quit

# 配置VLAN接口10的IP地址。

[DeviceA] interface vlan-interface 10

[DeviceA-Vlan-interface10] ip address 192.168.0.10 255.255.255.0

[DeviceA-Vlan-interface10] quit

# 在端口Ten-GigabitEthernet1/0/1、Ten-GigabitEthernet1/0/2上配置IP Source Guard端口绑定功能,绑定源IP地址和MAC地址。

[DeviceA] interface ten-gigabitethernet 1/0/2

[DeviceA-Ten-GigabitEthernet1/0/2] ip verify source ip-address mac-address

[DeviceA-Ten-GigabitEthernet1/0/2] quit

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

[DeviceA-Ten-GigabitEthernet1/0/1] ip verify source ip-address mac-address

# 在端口Ten-GigabitEthernet1/0/1上配置只允许MAC地址为0001-0203-0401、IP地址为192.168.0.1的终端Host A发送的IP报文通过。

[DeviceA-Ten-GigabitEthernet1/0/1] ip source binding ip-address 192.168.0.1 mac-address 0001-0203-0401

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

# 在Device A上配置允许MAC地址为0001-0203-0402、IP地址为192.168.0.2的终端Host B发送的IP报文通过。

[DeviceA] ip source binding ip-address 192.168.0.2 mac-address 0001-0203-0402

3.5.2  Device B的配置

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

<DeviceB> system-view

[DeviceB] vlan 10

[DeviceB-vlan10] port ten-gigabitethernet 1/0/1

[DeviceB-vlan10] quit

# 配置VLAN接口10的IP地址。

[DeviceB] interface vlan-interface 10

[DeviceB-Vlan-interface10] ip address 192.168.0.100 255.255.255.0

[DeviceB-Vlan-interface10] quit

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

[DeviceB] vlan 20

[DeviceB-vlan20] port ten-gigabitethernet 1/0/2

[DeviceB-vlan20] quit

# 配置VLAN接口20的IP地址。

[DeviceB] interface vlan-interface 20

[DeviceB-Vlan-interface20] ip address 192.168.2.100 255.255.255.0

[DeviceB-Vlan-interface20] quit

# 在端口Ten-GigabitEthernet1/0/1上配置IP Source Guard端口绑定功能,绑定源IP地址和MAC地址。

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

[DeviceB-Ten-GigabitEthernet1/0/1] ip verify source ip-address mac-address

# 配置在Device B的Ten-GigabitEthernet1/0/1上只允许MAC地址为0001-0203-0401且IP地址为192.168.0.1的终端Host A与MAC地址为0001-0203-0402且IP地址为192.168.0.2的终端Host B发送的IP报文通过。

[DeviceB-Ten-GigabitEthernet1/0/1] ip source binding ip-address 192.168.0.1 mac-address 0001-0203-0401

[DeviceB-Ten-GigabitEthernet1/0/1] ip source binding ip-address 192.168.0.2 mac-address 0001-0203-0402

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

# 在端口Ten-GigabitEthernet1/0/2上配置IP Source Guard端口绑定功能,绑定源IP地址和MAC地址。

[DeviceB] interface ten-gigabitethernet 1/0/2

[DeviceB-Ten-GigabitEthernet1/0/2] ip verify source ip-address mac-address

# 配置在Device B的Ten-GigabitEthernet1/0/2上只允许MAC地址为0001-0203-0403与IP地址为192.168.2.3的终端File server发送的IP报文通过。

[DeviceB-Ten-GigabitEthernet1/0/2] ip source binding ip-address 192.168.2.3 mac-address 0001-0203-0403

[DeviceB-Ten-GigabitEthernet1/0/2] quit

3.6  验证配置

完成上述配置后,Host A、Host B可以ping通Device A、Device B上三层接口的IP地址;File server可以ping通Device B上Vlan-interface20的IP地址。且在Device A和Device B上可以查看到已配置成功的IP Source Guard静态绑定表项。

# 在Device A上显示静态绑定表项。

[DeviceA] display ip source binding static

Total entries found: 2

IP Address      MAC Address    Interface                VLAN Type

192.168.0.2     0001-0203-0402 N/A                      N/A  Static

192.168.0.1     0001-0203-0401 XGE1/0/1                 N/A  Static

# 在Device B上显示静态绑定表项。

[DeviceB] display ip source binding static

Total entries found: 3

IP Address      MAC Address    Interface                VLAN Type

192.168.0.1     0001-0203-0401 XGE1/0/1                 N/A  Static

192.168.0.2     0001-0203-0402 XGE1/0/1                 N/A  Static

192.168.2.3     0001-0203-0403 XGE1/0/2                 N/A  Static

保持上述配置不变,将Host B改为通过端口XGE1/0/1接入Device A,仍然可以ping通Device A,因为全局静态绑定表项不检查端口的绑定关系。

如果修改Host B的IP地址,则无法ping通Device A,因为此时不满足IP+MAC的绑定关系。

如果修改Host A的IP地址或接入端口,则无法ping通Device A,因为此时不满足IP+MAC+端口的绑定关系。

3.7  配置文件

·     DeviceA

#

 ip source binding ip-address 192.168.0.2 mac-address 0001-0203-0402

#

vlan 10

#

interface Vlan-interface10

 ip address 192.168.0.10 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 10

 ip verify source ip-address mac-address

 ip source binding ip-address 192.168.0.1 mac-address 0001-0203-0401

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 10

 ip verify source ip-address mac-address

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 port access vlan 10

#

·     DeviceB

#

vlan 10

#

vlan 20

#

interface Vlan-interface10

 ip address 192.168.0.100 255.255.255.0

#

interface Vlan-interface20

 ip address 192.168.2.100 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 10

ip verify source ip-address mac-address

 ip source binding ip-address 192.168.0.1 mac-address 0001-0203-0401

 ip source binding ip-address 192.168.0.2 mac-address 0001-0203-0402

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 20

 ip verify source ip-address mac-address

 ip source binding ip-address 192.168.2.3 mac-address 0001-0203-0403

#

4  基于DHCP Snooping动态绑定的IP Source Guard配置举例

4.1  组网需求

图2所示,DHCP客户端通过Device的端口XGE1/0/1接入网络,利用DHCP服务器获取IPv4地址。

具体应用需求如下:

·     Device上使能DHCP Snooping功能,保证客户端从合法的服务器获取IP地址。

·     在端口XGE1/0/1上启用IPv4动态绑定功能,通过DHCP Snooping功能获取的用户信息来生成IP Source Guard动态绑定表项(IP+MAC绑定),并利用该表项对端口XGE1/0/1接收到的报文进行过滤,防止非法用户报文通过。

图2 基于DHCP Snooping动态绑定的IP Source Guard组网图

 

4.2  配置思路

·     为了保证客户端从合法的服务器获取IP地址,需要将DeviceDHCP服务器相连的端口配置为信任端口(缺省情况下,使能了DHCP Snooping功能的设备上所有端口均为不信任端口)。

·     Device与客户端相连的端口上启用DHCP Snooping表项记录功能(缺省为关闭),以使Device能监听该端口上接收的报文、生成DHCP Snooping表项

4.3  使用版本

本举例进行配置和验证所使用的版本,如表2所示。

表2 产品与软件版本适配关系

产品

软件版本

S12500X-AF系列交换机

S12500X-CMW710-R2712

S12500-X系列交换机

S12500X-CMW710-R2712

S9800系列交换机

S9800-CMW710-R2712

 

4.4  配置注意事项

缺省情况下,S12500X-AF系列、S12500-X系列、S9800系列交换机的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。

4.5  配置步骤

4.5.1  配置DHCP服务器

说明

本例以S12500X-AF系列交换机作为DHCP服务器为例,说明DHCP服务器的基本配置。

 

# 配置VLAN接口1的IP地址,并将其配置为工作在DHCP服务器模式。

<DHCPserver> system-view

[DHCPserver] interface vlan-interface 1

[DHCPserver-Vlan-interface1] ip address 192.168.0.2 24

[DHCPserver-Vlan-interface1] dhcp select server

[DHCPserver-Vlan-interface1] quit

# 启用DHCP服务。

[DHCPserver] dhcp enable

# 配置DHCP地址池1,用来为192.168.0.0/24网段内的客户端分配IP地址和网络配置参数。

[DHCPserver] dhcp server ip-pool 1

[DHCPserver-dhcp-pool-1] network 192.168.0.0 24

[DHCPserver-dhcp-pool-1] expired day 7

[DHCPserver-dhcp-pool-1] quit

4.5.2  配置Device

# 开启DHCP Snooping功能。

<Device> system-view

[Device] dhcp snooping enable

# 设置与DHCP服务器相连的端口Ten-GigabitEthernet1/0/2为DHCP Snooping信任端口。

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

[Device-Ten-GigabitEthernet1/0/2] dhcp snooping trust

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

# 配置端口Ten-GigabitEthernet1/0/1的IP Source Guard绑定功能,绑定源IP地址和MAC地址。

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

[Device-Ten-GigabitEthernet1/0/1] ip verify source ip-address mac-address

# 启用端口Ten-GigabitEthernet1/0/1的DHCP Snooping表项记录功能。

[Device-Ten-GigabitEthernet1/0/1] dhcp snooping binding record

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

4.5.3  配置DHCP客户端

将终端配置为自动获取IP地址(具体过程略)。

4.6  验证配置

DHCP客户端成功获取IP地址以后,在Device上可以显示通过DHCP Snooping模块获取的IP Source Guard动态绑定表项信息。(以接入四台DHCP客户端为例)

[Device] display ip source binding dhcp-snooping

Total entries found: 4

IP Address      MAC Address    Interface                VLAN Type

192.168.0.1     0001-0203-0401 XGE1/0/1                 1    DHCP snooping

192.168.0.3     0001-0203-0403 XGE1/0/1                 1    DHCP snooping

192.168.0.4     0001-0203-0404 XGE1/0/1                 1    DHCP snooping

192.168.0.5     0001-0203-0405 XGE1/0/1                 1    DHCP snooping

DHCP客户端均可以ping通DHCP服务器接口IP地址192.168.0.2。

如果DHCP客户端通过手工配置IP地址的方式,修改了自身的IP地址,将无法ping通DHCP服务器接口IP地址。

4.7  配置文件

·     Device

#

vlan 1

#

dhcp snooping enable

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

ip verify source ip-address mac-address

dhcp snooping binding record

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

dhcp snooping trust

#

5  基于DHCP中继动态绑定的IP Source Guard配置举例

5.1  组网需求

图3所示,Device通过接口Vlan-interface10和Vlan-interface20分别与DHCP客户端和DHCP服务器相连。

具体应用需求如下:

·     Device上使能DHCP中继功能,DHCP客户端通过Device从DHCP服务器获取IP地址。

·     在接口Vlan-interface10上启用IPv4动态绑定功能,通过DHCP中继获取的用户信息来生成IP Source Guard动态绑定表项(IP+MAC绑定),并利用该表项对接口Vlan-interface10收到的报文进行过滤,防止非法用户报文通过。

图3 基于DHCP中继动态绑定的IP Source Guard组网图

 

 

5.2  配置思路

在Device上启用DHCP中继用户地址表项记录功能(缺省为关闭),以使Device能监听该接口上接收的报文、生成DHCP中继用户地址表项。

5.3  使用版本

本举例进行配置和验证所使用的版本,如表3所示。

表3 产品与软件版本适配关系

产品

软件版本

S12500X-AF系列交换机

S12500X-CMW710-R2712

S12500-X系列交换机

S12500X-CMW710-R2712

S9800系列交换机

S9800-CMW710-R2712

 

5.4  配置注意事项

缺省情况下,S12500X-AF系列、S12500-X系列、S9800系列交换机的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。

5.5  配置步骤

5.5.1  配置DHCP服务器

说明

本例以S12500X-AF系列交换机作为DHCP服务器为例,说明DHCP服务器的基本配置。

 

# 配置VLAN接口20的IP地址,并将其配置为工作在DHCP服务器模式。

<DHCPserver> system-view

[DHCPserver] interface vlan-interface 20

[DHCPserver-Vlan-interface20] ip address 10.10.0.2

[DHCPserver-Vlan-interface20] dhcp select server

[DHCPserver-Vlan-interface20] quit

# 启用DHCP服务。

[DHCPserver] dhcp enable

# 配置DHCP地址池1,用来为192.168.0.0/24网段内的客户端分配IP地址和网络配置参数。

[DHCPserver] dhcp server ip-pool 1

[DHCPserver-dhcp-pool-1] network 192.168.0.0 24

[DHCPserver-dhcp-pool-1] expired day 7

[DHCPserver-dhcp-pool-1] quit

由于DHCP中继连接客户端的接口IP地址与DHCP服务器的IP地址不在同一网段,因此需要在DHCP服务器上通过静态路由或动态路由协议保证两者之间路由可达,这里以配置静态路由为例。

[DHCPserver] ip route-static 192.168.0.0 24 10.10.0.1

5.5.2  配置Device

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

<Device> system-view

[Device] vlan 10

[Device-vlan10] port ten-gigabitethernet 1/0/1

[Device-vlan10] quit

# 配置VLAN接口10的IP地址。

[Device] interface vlan-interface 10

[Device-Vlan-interface10] ip address 192.168.0.1 255.255.255.0

[Device-Vlan-interface10] quit

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

[Device] vlan 20

[Device-vlan20] port ten-gigabitethernet 1/0/2

[Device-vlan20] quit

# 配置VLAN接口20的IP地址。

[Device] interface vlan-interface 20

[Device-Vlan-interface20] ip address 10.10.0.1 255.255.255.0

[Device-Vlan-interface20] quit

# 开启DHCP服务。

[Device] dhcp enable

# 开启DHCP中继用户地址表项记录功能。

[Device] dhcp relay client-information record

# 配置接口Vlan-interface10工作在DHCP中继模式。

[Device] interface vlan-interface 10

[Device-Vlan-interface10] dhcp select relay

# 在DHCP中继上指定DHCP服务器的地址。

[Device-Vlan-interface10] dhcp relay server-address 10.10.0.2

[Device-Vlan-interface10] quit

# 在接口Vlan-interface10上配置IPv4接口绑定功能,绑定源IP地址和MAC地址。

[Device] interface vlan-interface 10

[Device-Vlan-interface10] ip verify source ip-address mac-address

[Device-Vlan-interface10] quit

5.5.3  配置DHCP客户端

将终端配置为自动获取IP地址(具体过程略)。

5.6  验证配置

DHCP客户端成功获取IP地址以后,在Device上可以显示通过DHCP relay模块获取的IP Source Guard动态绑定表项信息。(以接入四台DHCP客户端为例)

<Device> display ip source binding dhcp-relay

Total entries found: 4

IP Address      MAC Address    Interface                VLAN Type

192.168.0.2     0001-0203-0402 Vlan10 10   DHCP relay

192.168.0.3     0001-0203-0403 Vlan10 10   DHCP relay

192.168.0.4     0001-0203-0404 Vlan10 10   DHCP relay

192.168.0.5     0001-0203-0405 Vlan10 10   DHCP relay

DHCP客户端均可以ping通DHCP服务器接口IP地址10.10.0.2。

如果DHCP客户端通过手工配置IP地址的方式,修改了自身的IP地址,将无法ping通DHCP服务器接口IP地址。

5.7  配置文件

·     Device

#

 dhcp enable

 dhcp relay client-information record

#

vlan 10

#

vlan 20

#

interface Vlan-interface10

 ip address 192.168.0.1 255.255.255.0

 dhcp select relay

 dhcp relay server-address 10.10.0.2

 ip verify source ip-address mac-address

#

interface Vlan-interface20

 ip address 10.10.0.1 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 10

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 20

#

6  基于IPv6静态绑定表项与DHCPv6 Snooping动态绑定的IP Source Guard配置举例

6.1  组网需求

图4所示,File server、Host A、Host B和DHCPv6服务器都与Device相连。File server静态配置IPv6地址,Host A和Host B为DHCPv6客户端。

·     在Device的端口XGE1/0/1上配置IPv6静态绑定表项和IPv6绑定功能,使得该端口只允许File server(MAC地址为0001-0203-0405、IPv6地址为2001::1)发送的IPv6报文通过。

·     在端口XGE1/0/2和端口XGE1/0/3上启用IPv6动态绑定功能,通过DHCPv6 Snooping功能获取的用户信息来生成IP Source Guard动态绑定表项(IP+MAC绑定),并利用该表项对端口接收到的报文进行过滤,防止非法用户报文通过。

图4 基于IPv6静态绑定表项与DHCPv6 Snooping动态绑定的IP Source Guard组网图

 

6.2  配置思路

·     为了保证客户端从合法的服务器获取IP地址,需要将DeviceDHCPv6服务器相连的端口配置为信任端口(缺省情况下,使能了DHCPv6 Snooping功能的设备上所有端口均为不信任端口)。

·     在DeviceDHCPv6客户端相连的端口上启用DHCPv6 Snooping表项记录功能(缺省为关闭),以使Device能监听该端口上接收的报文、生成DHCPv6 Snooping表项。

6.3  使用版本

本举例进行配置和验证所使用的版本,如表4所示。

表4 产品与软件版本适配关系

产品

软件版本

S12500X-AF系列交换机

S12500X-CMW710-R2712

S12500-X系列交换机

S12500X-CMW710-R2712

S9800系列交换机

S9800-CMW710-R2712

 

6.4  配置注意事项

IP Source Guard功能静态绑定表项中的VLAN参数不作为过滤报文的特征项,VLAN参数指定与否,不影响IP Source Guard功能对报文的过滤结果。

缺省情况下,S12500X-AF系列、S12500-X系列、S9800系列交换机的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。

6.5  配置步骤

# 配置DHCPv6服务器和DHCPv6客户端。(略)

# 配置端口Ten-GigabitEthernet1/0/1的IPv6 Source Guard绑定功能,绑定源IPv6地址和MAC地址。

<Device> system-view

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

[Device-Ten-GigabitEthernet1/0/1] ipv6 verify source ip-address mac-address

# 配置在Device的端口Ten-GigabitEthernet1/0/1上只允许MAC地址为0001-0203-0405、IPv6地址为2001::1的终端发送的IPv6报文通过。

[Device-Ten-GigabitEthernet1/0/1] ipv6 source binding ip-address 2001::1 mac-address 0001-0203-0405

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

# 全局使能DHCPv6 Snooping功能。

[Device] ipv6 dhcp snooping enable

# 配置与DHCPv6服务器相连的端口Ten-GigabitEthernet1/0/4为DHCP Snooping信任端口。

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

[Device-Ten-GigabitEthernet1/0/4] ipv6 dhcp snooping trust

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

# 配置端口Ten-GigabitEthernet1/0/2的IPv6 Source Guard绑定功能,绑定源IPv6地址和MAC地址。

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

[Device-Ten-GigabitEthernet1/0/2] ipv6 verify source ip-address mac-address

# 启用端口Ten-GigabitEthernet1/0/2的DHCPv6 Snooping表项记录功能。

[Device-Ten-GigabitEthernet1/0/2] ipv6 dhcp snooping binding record

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

# 配置端口Ten-GigabitEthernet1/0/3的IPv6 Source Guard绑定功能,绑定源IPv6地址和MAC地址。

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

[Device-Ten-GigabitEthernet1/0/3] ipv6 verify source ip-address mac-address

# 启用端口Ten-GigabitEthernet1/0/3的DHCPv6 Snooping 表项记录功能。

[Device-Ten-GigabitEthernet1/0/3] ipv6 dhcp snooping binding record

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

6.6  验证配置

File server可以ping通DHCPv6服务器与客户端相连的接口IPv6地址。

在Device上可以查看到已配置成功的IP Source Guard静态绑定表项。

[Device] display ipv6 source binding static

Total entries found: 1

IPv6 Address         MAC Address    Interface               VLAN Type

2001::1              0001-0203-0405 XGE1/0/1                N/A  Static

客户端通过DHCPv6服务器成功获取IPv6地址之后,通过执行以下命令可查看到已生成的IPv6动态绑定表项信息。

[Device] display ipv6 source binding dhcpv6-snooping

Total entries found: 2

IPv6 Address         MAC Address    Interface               VLAN Type

2001::2              0001-0203-0406 XGE1/0/2                1    DHCPv6 snooping

2001::3              0001-0203-0407 XGE1/0/3                1    DHCPv6 snooping

DHCPv6客户端可以ping通DHCPv6服务器接口IPv6地址。

如果DHCPv6客户端通过手工配置IPv6地址的方式,修改了自身的IPv6地址,将无法ping通DHCPv6服务器接口IPv6地址。

6.7  配置文件

·     Device

#

ipv6 dhcp snooping enable

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 ipv6 verify source ip-address mac-address

 ipv6 source binding ip-address 2001::1 mac-address 0001-0203-0405

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 ipv6 verify source ip-address mac-address

 ipv6 dhcp snooping binding record

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 ipv6 verify source ip-address mac-address

 ipv6 dhcp snooping binding record

#

interface Ten-GigabitEthernet1/0/4

 port link-mode bridge

 ipv6 dhcp snooping trust

#

7  相关资料

·     H3C S12500X-AF & S12500-X & S9800以太网交换机 安全配置指导(R27xx)

·     H3C S12500X-AF & S12500-X & S9800以太网交换机 安全命令参考(R27xx)

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

新华三官网
联系我们