Next Previous Contents

8. Neighbor Discovery(發現芳鄰)

IPv6 的 Neighbor Discovery繼承了IPv4 的 ARP (Address Resolution Protocol地址解析協議). 您可以重新得到芳鄰的資訊. 並且可以編輯/刪除它.

Neighbor detection(對芳鄰進行探測)

核心負責對探測成功的芳鄰進行追蹤. 您可以用 "ip" 來挖掘其中的信息.

8.1 Displaying neighbors using "ip" (用"ip"命令列印芳鄰)

使用以下的命令,您可以知道芳鄰的設定.


# ip -6 neigh show [dev <device>]

下面的例子當中列印了一個芳鄰,它是一個可到達的路由器.


# ip -6 neigh show
fe80::201:23ff:fe45:6789 dev eth0 lladdr 00:01:23:45:67:89 router nud reachable

8.2 用 "ip" 對芳鄰的列印表進行處理

用以下的命令可以加入一個entry(列印項)


# ip -6 neigh add <IPv6 address> lladdr <link-layer address> dev <device>
 

例子:


# ip -6 neigh add fec0::1 lladdr 02:01:02:03:04:05 dev eth0
 

用以下的命令可以移除一個entry(列印項)


# ip -6 neigh del <IPv6 address> lladdr <link-layer address> dev <device>
 

例子:


# ip -6 neigh del fec0::1 lladdr 02:01:02:03:04:05 dev eth0
 

更高階的設定

"ip"工具非常強大, 但沒有足夠的幫助資訊.


# ip -6 neigh help
Usage: ip neigh { add | del | change | replace } { ADDR [ lladdr LLADDR ] 
          [ nud { permanent | noarp | stale | reachable } ] 
          | proxy ADDR } [ dev DEV ] 
       ip neigh {show|flush} [ to PREFIX ] [ dev DEV ] [ nud STATE ]
 

有點像IPv4的列印, 如果您知道它的詳細用法,請幫我 send 一份過來.


Next Previous Contents