Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6944912
  • 博文数量: 701
  • 博客积分: 10821
  • 博客等级: 上将
  • 技术积分: 12021
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-02 10:41
个人简介

中科院架构师,专注企业数字化各个方面,MES/ERP/CRM/OA、物联网、传感器、大数据、ML、AI、云计算openstack、Linux、SpringCloud。

文章分类

全部博文(701)

分类: LINUX

2016-03-16 11:24:49

Linux用ipwatchd检测ip冲突
在Windows系统中,如果有IP地址冲突,系统会弹出一个对话框来报警。但是Linux服务器一般工作在文本模式下,而且内核对于这种错误没有记录,所有在/var/log/message里也无从查起。
该软件有两种工作模式:主动和被动。
  主动模式:类似于360安全卫士的ARP防火墙,可以保护地址不受冲突。
  被动模式:只记录冲突信息到系统日志中。


安装:apt-get install ipwatchd
修改/etc/ipwatchd.conf,配置工作模式和监听的网卡,下边是在eth1上开启被动模式。

#eth0 active
eth1 passive
开启:
ipwatchd -c /usr/local/etc/ipwatchd.conf

这样ipwatchd就作为守护进程跑在了后台,如果发生了IP地址冲突,则在/var/log/message中会看到类似下边的信息:

Oct 21 17:22:15 test-vm IPwatchD[31094]: IPwatchD started
Oct 21 17:23:12 test-vm IPwatchD[31094]: MAC address 0:12:4b:d3:dd:a6 causes IP conflict with address 212.12.36.12 set on interface eth1 - passive mode - reply not sent
Oct 21 17:23:12 test-vm IPwatchD[31094]: MAC address 0:12:4b:d3:dd:a6 causes IP conflict with address 212.12.36.12 set on interface eth1 - passive mode - reply not sent
Oct 21 17:23:13 test-vm IPwatchD[31094]: MAC address 0:12:4b:d3:dd:a6 causes IP conflict with address 212.12.36.121 set on interface eth1 - passive mode - reply not sent


阅读(4243) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~