通过ARP实现二层拓扑探测配置示例
首页 > HuaWei > ARP   作者:圈哥  2016年2月12日 17:07 星期五  字号:   评论:1 条
时间:2016-2-12 17:07   评论:1 条 

通过ARP实现二层拓扑探测配置示例

 

1、组网需求

 ARP实现二层拓扑探测示例.png

                  图1  ARP实现二层拓扑探测示例

如上图1所示,两个GE接口加入VLAN100,两个GE口所连主机的IP地址如图所示。

 

2、配置思路

2.1、配置两个GE接口的缺省VLAN配置为VLAN 100

2.2、使能二层拓扑探测功能,查看ARP表项的变化。

 

3、操作步骤

3.1、创建VLAN 100,并配置Switch的两个GE接口加入VLAN 100

# 创建VLAN100,配置VLANIF接口的IP地址。

<HUAWEI> system-view

[HUAWEI] vlan 100

[HUAWEI-vlan100] quit

[HUAWEI] interface vlanif 100

[HUAWEI-Vlanif100] ip address 10.1.1.2 24

[HUAWEI-Vlanif100] quit

 

# 配置GE接口加入VLAN100

[HUAWEI] interface gigabitethernet 1/0/1

[HUAWEI-GigabitEthernet1/0/1] port link-type access

[HUAWEI-GigabitEthernet1/0/1] port default vlan 100

[HUAWEI-GigabitEthernet1/0/1] quit

[HUAWEI] interface gigabitethernet 1/0/2

[HUAWEI-GigabitEthernet1/0/2] port link-type access

[HUAWEI-GigabitEthernet1/0/2] port default vlan 100

[HUAWEI-GigabitEthernet1/0/2] quit

 

3.2、使能二层拓扑探测功能。

[HUAWEI] l2-topology detect enable

 

3.3、重启接口GE1/0/1,并查看ARP表项及老化时间的变化。

# Switch上分别Ping网段10.1.1.110.1.1.3内的主机后,查看SwitchARP表项,可以看到Switch已经学习到了PCMAC地址。

[HUAWEI] ping 10.1.1.1

  PING 10.1.1.3: 56  data bytes, press CTRL_C to break                         

    Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=10 ms                

    Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms                 

    Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms                 

    Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms                 

    Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms                 

                                                                               

  --- 10.1.1.1 ping statistics ---                                             

    5 packet(s) transmitted                                                     

    5 packet(s) received                                                       

    0.00% packet loss                                                          

    round-trip min/avg/max = 1/2/10 ms

[HUAWEI] ping 10.1.1.3

  PING 10.1.1.3: 56  data bytes, press CTRL_C to break                         

    Reply from 10.1.1.3: bytes=56 Sequence=1 ttl=255 time=10 ms                

    Reply from 10.1.1.3: bytes=56 Sequence=2 ttl=254 time=1 ms                 

    Reply from 10.1.1.3: bytes=56 Sequence=3 ttl=254 time=1 ms                 

    Reply from 10.1.1.3: bytes=56 Sequence=4 ttl=254 time=1 ms                 

    Reply from 10.1.1.3: bytes=56 Sequence=5 ttl=254 time=1 ms                 

                                                                               

  --- 10.1.1.3 ping statistics ---                                             

    5 packet(s) transmitted                                                    

    5 packet(s) received                                                       

    0.00% packet loss                                                          

    round-trip min/avg/max = 1/2/10 ms

[HUAWEI] display arp all

IP ADDRESS      MAC ADDRESS     EXPIRE(M)  TYPE          INTERFACE   VPN-INSTANCE 

                                           VLAN/CEVLAN

-----------------------------------------------------------------------------

10.1.1.2        00e0-c01a-4900              I -           Vlanif100

10.1.1.1        00e0-c01a-4901  20          D-0           GE1/0/1

                                            100               

10.1.1.3        00e0-de24-bf04  20          D-0           GE1/0/2

                                            100           

-----------------------------------------------------------------------------

Total:3         Dynamic:2       Static:0    Interface:1

 

# 依次shutdownundo shutdown接口GE1/0/1,并查看ARP表项的老化时间。

shutdown接口GE1/0/1,查看ARP表项的老化超时时间。

[HUAWEI] interface gigabitethernet 1/0/1

[HUAWEI-GigabitEthernet1/0/1] shutdown

[HUAWEI-GigabitEthernet1/0/1] display arp all

IP ADDRESS      MAC ADDRESS     EXPIRE(M) TYPE          INTERFACE   VPN-INSTANCE 

                                          VLAN/CEVLAN

----------------------------------------------------------------------------

10.1.1.2        00e0-c01a-4900              I -           Vlanif100                

10.1.1.3        00e0-de24-bf04  18          D-0           GE1/0/2

                                            100            

------------------------------------------------------------------------------

Total:2         Dynamic:1       Static:0    Interface:1

 

undo shutdown接口GE1/0/1,从SwitchPing网段10.1.1.1内的主机后,查看ARP表项的老化超时时间。

[HUAWEI] interface gigabitethernet 1/0/1

[HUAWEI-GigabitEthernet1/0/1] undo shutdown

[HUAWEI-GigabitEthernet1/0/1] quit

[HUAWEI] ping 10.1.1.1

  PING 10.1.1.3: 56  data bytes, press CTRL_C to break                         

    Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=10 ms                

    Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms                 

    Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms                 

    Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms                 

    Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms                 

                                                                               

  --- 10.1.1.1 ping statistics ---                                             

    5 packet(s) transmitted                                                     

    5 packet(s) received                                                       

    0.00% packet loss                                                          

    round-trip min/avg/max = 1/2/10 ms

[HUAWEI] display arp all

IP ADDRESS      MAC ADDRESS     EXPIRE(M)  TYPE          INTERFACE   VPN-INSTANCE 

                                           VLAN/CEVLAN

-----------------------------------------------------------------------------

10.1.1.2        00e0-c01a-4900              I -           Vlanif100

10.1.1.1        00e0-c01a-4901  20          D-0           GE1/0/1

                                            100              

10.1.1.3        00e0-de24-bf04  20          D-0           GE1/0/2

                                            100           

-----------------------------------------------------------------------------

Total:3         Dynamic:2       Static:0    Interface:1

 

由输出信息可以看到,GE1/0/1shutdown之后,从GE1/0/1学习到的ARP表项被删除。GE1/0/1undo shutdown,接口状态重新变为Up后,从GE1/0/2学习到的ARP表项被老化。此时,设备会发送ARP探测报文,更新从GE1/0/2学习到的ARP表项,表项更新后,老化超时时间重新变为默认值20(分钟)。

 

4、配置文件

Switch的配置文件

#

sysname HUAWEI

#

l2-topology detect enable

#

vlan batch 100

#

interface Vlanif100

 ip address 10.1.1.2 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-type access

 port default vlan 100

#

interface GigabitEthernet1/0/2

 port link-type access

 port default vlan 100

#

return

 您阅读这篇文章共花了: 
二维码加载中...
技术交流:欢迎在本文下方留言或加入QQ群:481294053/474079428互相学习。     
本文地址:http://www.023wg.com/arp/168.html
版权声明:若无注明,本文皆为“重庆网管”原创,转载请保留文章出处。
美女多2016-02-13 00:32
通俗易懂 收藏

返回顶部    首页   
版权所有:重庆网管    圈哥