AOA,
on my network I have 4 subnets. People on one subnet add the other subnet free ip address to bypass the gateway (lynx box). e.g
# arp -aven | grep 00:16:76:94:49:BB
192.168.59.38 ether 00:16:76:94:49:BB C eth0
192.168.79.50 ether 00:16:76:94:49:BB C eth0
I was wondering is there any way to find out duplicate hosts (ip's) with same mac address?
Any help, guidance would be much appreciated.
Multiple IP's with same MAC Address
Multiple IP's with same MAC Address
Regards,
-----------------------------------------------------------------
A wise monkey never monkies w/ another monkey's monkey!
-----------------------------------------------------------------
A wise monkey never monkies w/ another monkey's monkey!
Re: Multiple IP's with same MAC Address
sure. here's a little script to help you out:sevensins wrote:I was wondering is there any way to find out duplicate hosts (ip's) with same mac address?
Code: Select all
#!/usr/bin/env ruby
reg = Regexp.new /^([0-9.]+)\s+\w+\s+([0-9A-F:]+)/
macs = {}
f = IO.popen '/usr/sbin/arp -aven'
f.each_line do |line|
matches = reg.match line
if matches
ip = matches[1]
ether = matches[2]
if macs[ether]
macs[ether] << ip
else
macs[ether] = [ip]
end
end
end
macs.each { |mac, iplist| puts "#{mac} has more than one ip: #{iplist}" if iplist.size > 1 }
exit 0
-
- Naik
- Posts: 87
- Joined: Tue Mar 06, 2007 4:58 am
- Location: Karachi
- Contact: