Chinaunix
标题:
linux redhat 9里用批处理绑定ip和mac的问题
[打印本页]
作者:
方老实
时间:
2005-04-07 16:42
标题:
linux redhat 9里用批处理绑定ip和mac的问题
我是这样操作的
vi script
/sbin/arp -s 192.168.1.1 00:10:5A:5C:09:A6
/sbin/arp -s 192.168.1.2 00:E0:4C
A:07:2F
/sbin/arp -s 192.168.1.3 00:E0:4C:E2:6D
5
/sbin/arp -s 192.168.1.4 00:E0:4C:E2:6D
D
/sbin/arp -s 192.168.1.5 00:E0:4C
B:9A:58
/sbin/arp -s 192.168.1.6 00:E0:4C:E4:8F:88
/sbin/arp -s 192.168.1.7 00:E0:4C:E2:89:78
/sbin/arp -s 192.168.1.8 00:E0:4C
6:0A:4A
/sbin/arp -s 192.168.1.9 00:E0:4C:EE
2
4
/sbin/arp -s 192.168.1.10 00:E0:4C
A:07:40
保存 退出
chmod +x script
./script
提示 SIOCSARP: Invalid argument
不知道怎么解决呢
作者:
bachelor2000
时间:
2005-04-07 16:55
标题:
linux redhat 9里用批处理绑定ip和mac的问题
chmod -x script
应该是+x吧
脚本里面会不会有一行写错了,格式应该没问题
作者:
方老实
时间:
2005-04-07 21:06
标题:
linux redhat 9里用批处理绑定ip和mac的问题
不好意思 写错了 应该是+的
脚本里面的内容应该没错 我只写一行 也不行。。。
作者:
双眼皮的猪
时间:
2005-04-07 21:08
标题:
linux redhat 9里用批处理绑定ip和mac的问题
把真实内容写出来,不要搞什么ip mac,不知道你的格式对不对...
另外可以直接在/etc/ethers里绑定 。 google搜索一下^_^
作者:
方老实
时间:
2005-04-07 21:28
标题:
linux redhat 9里用批处理绑定ip和mac的问题
因为我要帮定100多台机器 所以只好靠批处理来做了
作者:
方老实
时间:
2005-04-07 21:29
标题:
linux redhat 9里用批处理绑定ip和mac的问题
/sbin/arp -s 192.168.1.1 00:10:5A:5C:09:A6
/sbin/arp -s 192.168.1.2 00:E0:4C
A:07:2F
/sbin/arp -s 192.168.1.3 00:E0:4C:E2:6D
5
/sbin/arp -s 192.168.1.4 00:E0:4C:E2:6D
D
/sbin/arp -s 192.168.1.5 00:E0:4C
B:9A:58
/sbin/arp -s 192.168.1.6 00:E0:4C:E4:8F:88
/sbin/arp -s 192.168.1.7 00:E0:4C:E2:89:78
/sbin/arp -s 192.168.1.8 00:E0:4C
6:0A:4A
/sbin/arp -s 192.168.1.9 00:E0:4C:EE
2
4
/sbin/arp -s 192.168.1.10 00:E0:4C
A:07:40
作者:
bachelor2000
时间:
2005-04-07 21:54
标题:
linux redhat 9里用批处理绑定ip和mac的问题
哥们你写的脚本肯定没问题,我觉得是你从WINDOWS机器上的文本张贴过来时候在LINUX下出现非法字符
你用cat -v script看看有没有非法字符,这个脚本命令格式没错啊
作者:
wxxszzz
时间:
2005-04-07 23:02
标题:
linux redhat 9里用批处理绑定ip和mac的问题
不需要这么麻烦,如果LINUX那台机器是网关的的话
写个SH就可以解决了
cat /proc/net/arp | awk '{print $4 $1}' >;/etc/ethers
arp -f
复制代码
在上网的高峰时段多执行几遍就OK了。
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2