首页 科技问答 楪舞纷飞祈愿相随,S7506E怎么做IP MAC绑定

楪舞纷飞祈愿相随,S7506E怎么做IP MAC绑定

科技问答 280
1676093667,

问题描述:

如题,怎么做才能做到没绑定的不能访问外网

最佳答案

http://www.h3c.com/cn/d_

 IPv4静态绑定表项配置举例

1. 组网需求

如图1-2所示,Host A、Host B分别与Device B的接口GigabitEthernet1/0/2、GigabitEthernet1/0/1相连;Host C与Device A的接口GigabitEthernet1/0/2相连。Device B接到Device A的接口GigabitEthernet1/0/1上。各主机均使用静态配置的IP地址。

要求通过在Device A和Device B上配置IPv4静态绑定表项,满足以下各项应用需求:

·     Device A的接口GigabitEthernet1/0/2上只允许Host C发送的IP报文通过。

·     Device A的接口GigabitEthernet1/0/1上只允许Host A发送的IP报文通过。

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

·     Device B的接口GigabitEthernet1/0/1上允许Host B发送的IP报文通过。

2. 组网图

图1-2 配置静态绑定表项组网图

3. 配置步骤

(1)     配置Device A

# 配置各接口的IP地址(略)。

# 在接口GigabitEthernet1/0/2上开启IPv4接口绑定功能,绑定源IP地址和MAC地址。

<DeviceA> system-view

[DeviceA] interface gigabitethernet 1/0/2

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

# 配置IPv4静态绑定表项,在Device A的GigabitEthernet1/0/2上只允许MAC地址为0001-0203-0405、IP地址为192.168.0.3的数据终端Host C发送的IP报文通过。

[DeviceA-GigabitEthernet1/0/2] ip source binding ip-address 192.168.0.3 mac-address 0001-0203-0405

[DeviceA-GigabitEthernet1/0/2] quit

# 在接口GigabitEthernet1/0/1上开启IPv4接口绑定功能,绑定源IP地址和MAC地址。

[DeviceA] interface gigabitethernet 1/0/1

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

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

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

[DeviceA-GigabitEthernet1/0/1] quit

(2)     配置Device B

# 配置各接口的IP地址(略)。

# 在接口GigabitEthernet1/0/2上开启IPv4接口绑定功能,绑定源IP地址和MAC地址。

<DeviceB> system-view

[DeviceB] interface gigabitethernet 1/0/2

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

[DeviceB-GigabitEthernet1/0/2] quit

# 配置IPv4静态绑定表项,在Device B上的所有接口都允许MAC地址为0001-0203-0406、IP地址为192.168.0.1的数据终端Host A发送的IP报文通过。

[DeviceB] ip source binding ip-address 192.168.0.1 mac-address 0001-0203-0406

# 在接口GigabitEthernet1/0/1上开启IPv4接口绑定功能,绑定源IP地址和MAC地址。

[DeviceB] interface gigabitethernet 1/0/1

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

# 配置IPv4静态绑定表项,在Device B的GigabitEthernet1/0/1上允许MAC地址为0001-0203-0407的数据终端Host B发送的IP报文通过。

[DeviceB] interface gigabitethernet 1/0/1

[DeviceB-GigabitEthernet1/0/1] ip source binding mac-address 0001-0203-0407

[DeviceB-GigabitEthernet1/0/1] quit

4. 验证配置

# 在Device A上显示IPv4静态绑定表项,可以看出以上配置成功。

<DeviceA> display ip source binding static

Total entries found: 2

IP Address      MAC Address    Interface                VLAN Type

192.168.0.1     0001-0203-0405 GE1/0/2                  N/A  Static

192.168.0.3     0001-0203-0406 GE1/0/1                  N/A  Static

# 在Device B上显示IPv4静态绑定表项,可以看出以上配置成功。

<DeviceB> display ip source binding static

Total entries found: 2

IP Address      MAC Address    Interface                VLAN Type

192.168.0.1     0001-0203-0406 N/A                      N/A  Static

N/A             0001-0203-0407 GE1/0/1                  N/A  Static

1.7.2  与DHCP Snooping配合的IPv4动态绑定功能配置举例

1. 组网需求

DHCP客户端通过Device的接口GigabitEthernet1/0/1接入网络,通过DHCP服务器获取IPv4地址。

具体应用需求如下:

·     Device上使能DHCP Snooping功能,保证客户端从合法的服务器获取IP地址,且记录客户端IPv4地址及MAC地址的绑定关系。

·     在接口GigabitEthernet1/0/1上启用IPv4动态绑定功能,利用动态生成的DHCP Snooping表项过滤接口接收的报文,只允许通过DHCP服务器动态获取IP地址的客户端接入网络。DHCP服务器的具体配置请参见“三层技术-IP业务配置指导”中的“DHCP服务器”。

2. 组网图

图1-3 配置与DHCP Snooping配合的IPv4动态绑定功能组网图

3. 配置步骤

(1)     配置DHCP Snooping

# 配置各接口的IP地址(略)。

# 开启DHCP Snooping功能。

<Device> system-view

[Device] dhcp snooping enable

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

[Device] interface gigabitethernet 1/0/2

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

[Device-GigabitEthernet1/0/2] quit

(2)     配置IPv4接口绑定功能

# 开启接口GigabitEthernet1/0/1的IPv4接口绑定功能,绑定源IP地址和MAC地址,并启用接口的DHCP Snooping 表项记录功能。

[Device] interface gigabitethernet 1/0/1

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

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

[Device-GigabitEthernet1/0/1] quit

4. 验证配置

# 显示接口GigabitEthernet1/0/1从DHCP Snooping获取的动态表项。

[Device] display ip source binding dhcp-snooping

Total entries found: 1

IP Address      MAC Address    Interface                VLAN Type

192.168.0.1     0001-0203-0406 GE1/0/1                  1    DHCP snooping

从以上显示信息可以看出,接口GigabitEthernet1/0/1在配置IPv4接口绑定功能之后根据DHCP Snooping表项产生了动态绑定表项。

该问题暂时没有网友解答

,S7506E怎么做IP MAC绑定