曲径通幽论坛

 找回密码
 立即注册
搜索
查看: 4590|回复: 0
打印 上一主题 下一主题

arp

[复制链接]

4918

主题

5880

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34397
跳转到指定楼层
楼主
发表于 2009-5-13 08:31:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在 /etc/ethers 里配置网关MAC和IP对应地址:
beyes@linux-beyes:~/network> cat /etc/ethers
#
# ethers    This file contains 48 bit Ethernet addresses and their
#        corresponding IP number or hostname. The two items are
#        separated by any number of SPACE and/or TAB char acters.
#        A at the beginning of a line starts a comment which extends
#        to the end of the line. The Ethernet-address is written as
#        x:x:x:x:x:x, where x is a hexadecimal number between 0 and
#        ff which represents one byte of the address, which is in
#        network byte order (bigendian). The IP-number may be a
#        hostname which can be resolved by DNS or a dot separated
#        number.
#
# Syntax:
#    Ethernet-address    IP-number
#
#
04:4b:80:80:80:03 192.168.0.1

这样直接运行命令 arp -f 就可以实现对网关的绑定;查看一下 arp 缓存:
beyes@linux-beyes:~/network> sudo /sbin/arp
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.0.1              ether   04:4b:80:80:80:03   CM                    wlan0
192.168.0.104            ether   00:c0:9f:8d:06:77   C                     wlan0
192.168.174.129          ether   00:0c:29:14:19:a8   C                     vmnet8
上面,在 Flags Mask 里,看到 M 标志,表示绑定成功。

假如不是修改 /etc/ethers 文件,也可以编辑另外一个相应格式的文件,然后 arp -f 后面加上这个文件名即可。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )

GMT+8, 2025-6-19 05:01 , Processed in 0.074961 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表