05-MSR系列路由器ARP支持授权表项典型配置举例
本章节下载: 05-MSR系列路由器ARP支持授权表项典型配置举例 (167.57 KB)
MSR系列路由器授权ARP功能的典型配置举例
Copyright © 2014 杭州华三通信技术有限公司 版权所有,保留一切权利。 非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部, 并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。 |
目 录
本文档介绍使用授权ARP功能的典型案例。
本文档不严格与具体软、硬件版本对应,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
如图1所示,Router A是DHCP服务器,Router B是DHCP客户端,DHCP服务器为同一网段中的客户端动态分配IP地址。要求:对DHCP服务器配置授权ARP功能保证客户端的合法性,并对客户端进行老化探测。
图1 MSR路由器授权ARP功能在DHCP服务器上组网图
在DHCP服务器上进行授权ARP功能配置,可以使通过DHCP服务器申请的合法用户在服务器上存在对应的ARP表项,从而保证与外界通信;而没有通过DHCP服务器申请地址的非法用户,无法与外界进行通信。
本举例是在Release 2311版本上进行配置和验证的。
目前授权ARP仅支持三层以太网接口,包含二层切三层以太网接口,不支持VLAN虚接口。
# 配置接口的IP地址。
<RouterA> system-view
[RouterA] interface ethernet 0/1
[RouterA-Ethernet0/1] ip address 10.1.1.1 255.255.255.0
[RouterA-Ethernet0/1] quit
# 使能DHCP服务,配置地址池。
[RouterA] dhcp enable
[RouterA] dhcp server ip-pool 1
[RouterA-dhcp-pool-1] network 10.1.1.0 mask 255.255.255.0
[RouterA-dhcp-pool-1] quit
# 进入以太网接口视图。
[RouterA] interface ethernet 0/1
# 使能DHCP服务器支持授权ARP功能。
[RouterA-Ethernet0/1] dhcp update arp
# 使能接口授权ARP功能。
[RouterA-Ethernet0/1] arp authorized enable
配置DHCP服务器的用户下线检测功能。
[RouterA-Ethernet0/1] dhcp server client-detect enable
# 配置接口自动获取IP地址
<RouterB> system-view
[RouterB] interface ethernet 0/1
[RouterB-Ethernet0/1] ip address dhcp-alloc
[RouterB-Ethernet0/1] quit
按照如上配置,Router B通过DHCP获取IP地址,Router A记录授权ARP表项。
# Router B以太网接口信息表示已经通过DHCP方式动态获取IP地址。
<RouterB> display interface ethernet 0/1
Ethernet0/1 current state: UP
Line protocol current state: UP
Description: Ethernet0/1 Interface
The Maximum Transmit Unit is 1500
Internet Address is 10.1.1.2/24, acquired via DHCP
IP Packet Frame Type: PKTFMT_ETHNT_2, Hardware Address: 000f-e23a-ff64
IPv6 Packet Frame Type: PKTFMT_ETHNT_2, Hardware Address: 000f-e23a-ff64
Media type is twisted pair, loopback not set, promiscuous mode not set
100Mb/s, Full-duplex, link type is autonegotiation
Output flow-control is disabled, input flow-control is disabled
Output queue : (Urgent queuing : Size/Length/Discards) 0/100/0
Output queue : (Protocol queuing : Size/Length/Discards) 0/500/0
Output queue : (FIFO queuing : Size/Length/Discards) 0/75/0
Last clearing of counters: Never
Last 300 seconds input rate 64.78 bytes/sec, 518 bits/sec, 1.01 packets/sec
Last 300 seconds output rate 3.31 bytes/sec, 26 bits/sec, 0.02 packets/sec
Input: 2159 packets, 133585 bytes, 2159 buffers
1415 broadcasts, 743 multicasts, 0 pauses
0 errors, 0 runts, 0 giants
0 crc, 0 align errors, 0 overruns
0 dribbles, 0 drops, 0 no buffers
Output:6 packets, 994 bytes, 6 buffers
6 broadcasts, 0 multicasts, 0 pauses
0 errors, 0 underruns, 0 collisions
0 deferred, 0 lost carriers
# Router B获得Router A分配的IP后,在Router A上查看授权ARP信息。
<RouterA> display arp all
Type: S-Static D-Dynamic A-Authorized
IP Address MAC Address VLAN ID Interface Aging Type
10.1.1.2 000f-e23a-ff64 N/A Eth0/1 N/A A
# 将Router B与Switch断开连接,修改Router B的IP地址为静态地址,且与Router A在同一网段,重新连接Router B与Switch,发现Router B与Router A不能互通。这是由于Router A接口上使能了授权ARP功能,就会禁止该接口学习动态ARP,同时Router B的IP地址为静态地址,所以Router A也不会生成授权ARP表项。没有ARP表项,Router A和Router B不能互通。
[RouterB-Ethernet0/1] interface ethernet0/1
[RouterB-Ethernet0/1] ip address 10.1.1.10 255.255.255.0
[RouterB-Ethernet0/1] quit
[RouterB] ping 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 10.1.1.1 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
<RouterA> display arp all
Type: S-Static D-Dynamic A-Authorized
IP Address MAC Address VLAN ID Interface Aging Type
· Router A:
#
sysname RouterA
#
dhcp server ip-pool 1
network 10.1.1.0 mask 255.255.255.0
#
interface Ethernet0/1
port link-mode route
ip address 10.1.1.1 255.255.255.0
arp authorized enable
dhcp update arp
dhcp relay client-detect enable
#
dhcp enable
#
· Router B:
#
sysname RouterB
#
interface Ethernet0/1
port link-mode route
ip address dhcp-alloc
#
如图2所示,Router A是DHCP服务器,Router C是DHCP客户端,Router C通过DHCP中继从Router A获取IP地址,现要求:在DHCP中继Router B上启用授权ARP功能保证客户端的合法性,并对客户端进行老化探测。
图2 MSR路由器授权ARP功能在DHCP中继上配置举例组网图
在DHCP中继上进行授权ARP功能配置,可以使通过DHCP服务器申请的合法用户在中继上存在对应的ARP表项,从而保证与外界通信;而没有通过DHCP服务器申请地址的非法用户,无法无外界进行通信。
# 配置接口的IP地址。
<RouterA> system-view
[RouterA] interface ethernet 0/0
[RouterA-Ethernet0/0] ip address 10.1.1.1 255.255.255.0
[RouterA-Ethernet0/0] quit
# 使能DHCP服务。
[RouterA] dhcp enable
[RouterA] dhcp server ip-pool 1
[RouterA-dhcp-pool-1] network 10.10.1.0 mask 255.255.255.0
[RouterA-dhcp-pool-1] gateway-list 10.10.1.1
[RouterA-dhcp-pool-1] quit
# 配置能够到达DHCP中继和DHCP客户端网段的静态路由。
[RouterA] ip route-static 10.10.1.0 24 10.1.1.2
# 使能DHCP服务。
<RouterB> system-view
[RouterB] dhcp enable
# 配置接口的IP地址。
[RouterB] interface ethernet 0/0
[RouterB-Ethernet0/0] ip address 10.1.1.2 24
[RouterB-Ethernet0/0] quit
[RouterB] interface ethernet 0/1
[RouterB-Ethernet0/1] ip address 10.10.1.1 24
# 配置Ethernet0/1接口工作在DHCP中继模式。
[RouterB-Ethernet0/1] dhcp select relay
[RouterB-Ethernet0/1] quit
# 配置DHCP服务器的地址。
[RouterB] dhcp relay server-group 1 ip 10.1.1.1
[RouterB] interface Ethernet 0/1
[RouterB-Ethernet0/1] dhcp relay server-select 1
# 使能DHCP同步ARP表项功能。
[RouterB-Ethernet0/1] dhcp update arp
# 使能接口授权ARP功能。
[RouterB-Ethernet0/1] arp authorized enable
配置DHCP服务器的用户下线检测功能
[RouterB-Ethernet0/1] dhcp relay client-detect enable
# 配置接口自动获取IP地址
<RouterC> system-view
[RouterC] interface ethernet 0/1
[RouterC-Ethernet0/1] ip address dhcp-alloc
[RouterC-Ethernet0/1] quit
按照如上配置,Router C通过DHCP获取IP地址,Router B记录授权ARP表项。
# Router C以太网接口信息表示已经通过DHCP方式动态获取IP地址。
<RouterC> display interface Ethernet 0/1
Ethernet0/1 current state: UP
Line protocol current state: UP
Description: Ethernet0/1 Interface
The Maximum Transmit Unit is 1500
Internet Address is 10.10.1.2/24, acquired via DHCP
IP Packet Frame Type: PKTFMT_ETHNT_2,Hardware Address: 000f-e200-0003
IPv6 Packet Frame Type: PKTFMT_ETHNT_2,Hardware Address: 000f-e200-0003
Media type is twisted pair, loopback not set, promiscuous mode not set
100Mb/s, Full-duplex, link type is autonegotiation
Output flow-control is disabled, input flow-control is disabled
Output queue : (Urgent queuing : Size/Length/Discards)0/100/0
Output queue : (Protocol queuing : Size/Length/Discards)0/500/0
Output queue : (FIFO queuing : Size/Length/Discards)0/75/0
Last clearing of counters: Never
Last 300 seconds input rate 50.31 bytes/sec, 402 bits/sec, 0.81 packets/sec
Last 300 seconds output rate 0.00 bytes/sec, 0 bits/sec, 0.00 packets/sec
Input: 414 packets, 26097 bytes, 414 buffers
271 broadcasts, 142 multicasts, 0 pauses
0 errors, 0 runts, 0 giants
0 crc, 0 align errors, 0 overruns
0 dribbles, 0 drops, 0 no buffers
Output:6 packets, 994 bytes, 6 buffers
6 broadcasts, 0 multicasts, 0 pauses
0 errors, 0 underruns, 0 collisions
0 deferred, 0 lost carriers
# Router C获得Router A分配的IP后,在Router B查看授权ARP信息。
<RouterB> display arp all
Type: S-Static D-Dynamic A-Authorized
IP Address MAC Address VLAN ID Interface Aging Type
10.10.1.2 000f-e200-0003 N/A Eth0/1 N/A A
10.1.1.1 000f-e23a-ff83 N/A Eth0/0 18 D
# 将Router C与Switch断开连接,修改Router C的IP地址为静态地址,且与Router B在同一网段,重新连接Router B与Switch,发现Router C与Router B不能互通。这是由于Router B接口上使能了授权ARP功能,就会禁止该接口学习动态ARP,同时Router C的IP地址为静态地址,所以Router B也不会生成关于Router C地址的授权ARP表项。没有ARP表项,Router C和Router B不能互通。
[RouterC] interface ethernet0/1
[RouterC-Ethernet0/1] ip address 10.10.1.10 255.255.255.0
[RouterC-Ethernet0/1] quit
[RouterC] ping 10.10.1.1
PING 10.10.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 10.10.1.1 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
<RouterB> display arp all
Type: S-Static D-Dynamic A-Authorized
IP Address MAC Address VLAN ID Interface Aging Type
10.10.1.2 000f-e200-0003 N/A Eth0/1 N/A A
10.1.1.1 000f-e23a-ff83 N/A Eth0/0 18 D
· Router A:
#
sysname RouterA
#
dhcp server ip-pool 1
network 10.10.1.0 mask 255.255.255.0
gateway-list 10.10.1.1
#
interface Ethernet0/0
port link-mode route
ip address 10.1.1.1 255.255.255.0
#
ip route-static 10.10.1.0 255.255.255.0 10.1.1.2
#
dhcp enable
#
· Router B:
#
sysname RouterB
#
dhcp relay server-group 1 ip 10.1.1.1
#
interface Ethernet0/0
port link-mode route
ip address 10.1.1.2 255.255.255.0
#
interface Ethernet0/1
port link-mode route
ip address 10.10.1.1 255.255.255.0
dhcp select relay
dhcp relay server-select 1
arp authorized enable
dhcp relay client-detect enable
dhcp update arp
#
dhcp enable
#
· Router C:
#
sysname RouterC
#
interface Ethernet0/1
port link-mode route
ip address dhcp-alloc
#
· H3C MSR 系列路由器 命令参考(V5)-R2311
· H3C MSR 系列路由器 配置指导(V5)-R2311
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!