LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1138|回复: 12

请大家帮帮忙!!有关 ip 与 mac 绑定问题!!

[复制链接]
发表于 2005-1-16 16:39:05 | 显示全部楼层 |阅读模式
是这样的,我们学校的IP盗用极为严重,故想出一个办法,想通过IP与MAC绑定来解决!
我经已通过搜索功能,并一一察看了这些贴,但都是不行啊!

我的方法如下:
1、touch /etc/ethers
2、增加IP与MAC到该文件!格式如下:
192.168.10.10 00:10:5C9:EE:9A
3、arp -f /etc/ethers
4、在 /etc/rc.d/rc.local 里增加
arp -f /etc/ethers
但还行啊!我的操作是不是有什么问题!

还有我的问题就是:
1、完成以上操作要不要重启?
2、iptables 的写法不是还有什么特别的要求??
3、我的服务器是双网卡的!
 楼主| 发表于 2005-1-17 08:21:39 | 显示全部楼层
没人理我,顶一下!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-1-18 11:35:41 | 显示全部楼层
还没人理我吗?
回复 支持 反对

使用道具 举报

发表于 2005-1-18 20:26:27 | 显示全部楼层
这个方法是行的,我没搞过 , 看不出哪里有问题

或许你可以用iptables来限制
回复 支持 反对

使用道具 举报

发表于 2005-1-18 23:04:51 | 显示全部楼层
本人对这个不太清楚
不、过我也想知道啊
!!!!!!!!!!!!!!!!!!!!!··!·#!··!·!·!·!·!#·#·!¥#·
回复 支持 反对

使用道具 举报

发表于 2005-1-19 11:04:28 | 显示全部楼层
用iptables:
用法,让mac为xx:xx:xx:xx:xx:xx 绑定ip 192.168.10.2
iptable -A FORWARD -s 192.168.10.2 -m mac --mac-source xx:xx:xx:xx:xx:xx -j ACCEPT
iptables -A FORWARD -s 192.168.10.0/24 -j DROP
回复 支持 反对

使用道具 举报

发表于 2005-1-19 11:47:16 | 显示全部楼层
直接 arp  -f就成了,后面不要加东西。
回复 支持 反对

使用道具 举报

发表于 2005-1-19 13:57:19 | 显示全部楼层
应该是可以的啊, 我以前也用过.

你可以看一下现在的arp表的状态
回复 支持 反对

使用道具 举报

发表于 2005-1-19 15:33:49 | 显示全部楼层
man ethers
Reformatting ethers(5), please wait...
ETHERS(5)                                                 File formats                                                 ETHERS(5)

NAME
       ethers - Ethernet address to IP number database

DESCRIPTION
       /etc/ethers contains 48 bit Ethernet addresses and their corresponding IP numbers, one line for each IP number:

              Ethernet-address  IP-number

       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 num-
       ber  between 0 and ff which represents one byte of the address, which is in network byte order (big-endian).  The IP-number may be a hostname which can be resolved by DNS or a dot separated number.

EXAMPLES
       08:00:20:00:61:CA  pal

FILES
       /etc/ethers

看清楚在问!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-1-24 12:02:19 | 显示全部楼层
我的意思是说,我在 /etc/ethers 里面增加了内容之后,iptables  应该怎样去写!
是不是要把这个网段 DROP!
像这样??
iptables -A FORWARD -s 192.168.10.0/24 -j DROP
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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