arp 是 Address Resolution Protocol (地址解析协议) 的缩写, arp 用于管理和查看 ipv4 网络 ARP 缓存。
arp 显示的是 IP 到 MAC 地址转换的缓存记录; 当发生通讯时, arp 会向缓存添加和删除相关 ipv4 网络 MAC 地址记录。
root:~# arp Address HWtype HWaddress Flags Mask Iface 114.30.59.203 ether ee:ff:ff:ff:ff:ff C eth0
基本语法
| arp [-vn] [<HW>] [-i <if>] [-a] [<hostname>] | 显示 ARP 缓存 |
| arp [-v] [-i <if>] -d <host> [pub] | 删除 ARP 条目 |
| arp [-vnD] [<HW>] [-i <if>] -f [<filename>] | 添加条目从文件 |
| arp [-v] [<HW>] [-i <if>] -s <host> <hwaddr> [temp] | 添加条目 |
| arp [-v] [<HW>] [-i <if>] -Ds <host> <if> [netmask <nm>] pub |
注意:
<HW> 等于使用 -H <hw> 去指定硬件地址类型。 默认:ether
选项参数
| 参数 | EN 解释 | 中文翻译 | Remarque |
|---|---|---|---|
| -a | display (all) hosts in alternative (BSD) style | 以备用 (BSD) 样式显示 (所有) 主机 | |
| -s, --set | set a new ARP entry | 设置新 ARP 条目 | |
| -d, --delete | delete a specified entry | 删除指定条目 | |
| -v, --verbose | be verbose | 冗余 | |
| -n, --numeric | don't resolve names | 不解析名称 | |
| -i, --device | specify network interface (e.g. eth0) | 指定网络接口 (例如 eth0) | |
| -D, --use-device | read <hwaddr> from given device | 从给定设备读取 <hwaddr> | |
| -A, -p, --protocol | specify protocol family | 指定协议族 | |
| -f, --file | read new entries from file or from /etc/ethers | 从文件 (或 /etc/ethers) 读取新条目 |
| 参数 | EN 解释 | 中文翻译 | Remarque |
|---|---|---|---|
| ash | Ash | ||
| ether | Ethernet | ||
| ax25 | AMPR AX.25 | ||
| netrom | AMPR NET/ROM | ||
| rose | AMPR ROSE | ||
| arcnet | ARCnet | ||
| dlci | Frame Relay DLCI | ||
| fddi | Fiber Distributed Data Interface | ||
| hippi | HIPPI | ||
| irda | IrLAP | ||
| x25 | generic X.25 | ||
| eui64 | Generic EUI-64 |
| Fonction | Commande | 文字解释 | 示例 | 示例解释 |
|---|---|---|---|---|
| 帮助 | arp --help | 展示帮助信息 | ||
| Version | arp --version | 展示版本信息 |
版权声明: 本文为独家原创稿件,版权归 Logiciel Numérique Heureux ,未经许可不得转载。