Sponsored Content
Top Forums UNIX for Advanced & Expert Users C program to detect duplicate ip address if any after assigning ip address to ethernet interface Post 302952492 by Corona688 on Wednesday 19th of August 2015 11:43:46 AM
Old 08-19-2015
It's open source. Download the source and read it.

It involves opening a raw network interface, then sending and receiving ARP packets and understanding their meaning. A bit more complicated than a single function sadly, unless you choose to use the command itself as intended.

Last edited by Corona688; 08-19-2015 at 12:50 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ethernet Address?

How do I find my ethernet address (HostID) under OS X in the terminal? (2 Replies)
Discussion started by: Dimyas
2 Replies

2. Windows & DOS: Issues & Discussions

DCHP server assigning a wrong Address

Pls could you help me diagnose my problem. I have a system which is a DHCP server and also the Remote Access Server. The DHCP server allocate normal address within the scope range to the LAN system. why it allocates abitrary number such as 169.254.217.90 255.255.0.0 class B address to the remote... (1 Reply)
Discussion started by: kayode
1 Replies

3. IP Networking

How to Achive IP address through MAC(Ethernet) address

Hi sir, i want to make such programe which takes MAC(Ethernet) address of any host & give me its IP address....... but i'm nt getting that how i can pass the MAC address to Frame........ Please give me an idea for making such program... Thanks & regards Krishna (3 Replies)
Discussion started by: krishnacins
3 Replies

4. Shell Programming and Scripting

how to detect ip address based location using PHP

I am interested in finding out if there is a reliable and economical way for extracting user's location based on his ip address, using php I tried to get the job done using ip2location.com, but I am not happy how it deals with result inconsistently. (2 Replies)
Discussion started by: siftin-com
2 Replies

5. UNIX for Advanced & Expert Users

detect mac address modication in linux

Hi, How Detect the mac address modification of a machine...in linux Thanks (1 Reply)
Discussion started by: shivarajM
1 Replies

6. Solaris

No value in Ethernet address and Host ID at Ok prompt

Hi All, In Ultra 10 at time system is not displaying value for Ethernet address and Host ID. Also, when i am trying to change the value of environment variables i am getting below message and value is not changing Thanks (4 Replies)
Discussion started by: kumarmani
4 Replies

7. UNIX for Dummies Questions & Answers

Static IP address works on Ethernet but not Wireless

Hi all, I have literally spent all day trying dozens of different combinations, re-installs and tweaks to try and resolve this problem. I would be EXTREMELY grateful if anyone can help/point me in the right direction. I am using OpenBSD 4.6 and am trying to connect to my wireless network with... (1 Reply)
Discussion started by: wcontm
1 Replies

8. Solaris

Get ethernet address

Hi, How do I get ethernet (mac) address of all the interfaces (including the unplumbed interfaces) ? I do not want to use ifconfig -a plumb and unplumb. Looking for some other ways. Even c program will help. I am looking for S9 as well as S10. So dladm also wont work as it is only for S10 ... (2 Replies)
Discussion started by: patjones
2 Replies

9. UNIX for Dummies Questions & Answers

How to detect ip address from last reboot done?

Hi How would i detect the ip address from where the reboot command been given to linux host. My linux host details are as below. # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: EnterpriseEnterpriseServer Description: ... (1 Reply)
Discussion started by: pinga123
1 Replies

10. Solaris

How to set gateway address to a particular interface?

How to set gateway address to a particular interface? waht are the files need to update to make it permanent? (2 Replies)
Discussion started by: Naveen.6025
2 Replies
ARPWATCH(8)						      System Manager's Manual						       ARPWATCH(8)

NAME
arpwatch - keep track of ethernet/ip address pairings SYNOPSIS
arpwatch [ -dN ] [ -f datafile ] [ -i interface ] [ -n net[/width ]] [ -r file ] [ -s sendmail_path ] [ -p ] [ -a ] [ -m addr ] [ -u username ] [ -R seconds ] [ -Q ] [ -z ignorenet/ignoremask ] DESCRIPTION
Arpwatch keeps track for ethernet/ip address pairings. It syslogs activity and reports certain changes via email. Arpwatch uses pcap(3) to listen for arp packets on a local ethernet interface. The -d flag is used enable debugging. This also inhibits forking into the background and emailing the reports. Instead, they are sent to stderr. The -f flag is used to set the ethernet/ip address database filename. The default is arp.dat. The -i flag is used to override the default interface. The -n flag specifies additional local networks. This can be useful to avoid "bogon" warnings when there is more than one network running on the same wire. If the optional width is not specified, the default netmask for the network's class is used. The -N flag disables reporting any bogons. The -r flag is used to specify a savefile (perhaps created by tcpdump(1) or pcapture(1)) to read from instead of reading from the network. In this case, arpwatch does not fork. (Debian) The -s flag is used to specify the path to the sendmail program. Any program that takes the option -odi and then text from stdin can be substituted. This is useful for redirecting reports to log files instead of mail. (Debian) The -p flag disables promiscuous operation. ARP broadcasts get through hubs without having the interface in promiscuous mode, while saving considerable resources that would be wasted on processing gigabytes of non-broadcast traffic. OTOH, setting promiscuous mode does not mean getting 100% traffic that would concern arpwatch . YMMV. (Debian) -a By default, arpwatch reports bogons (unless -N is given) for IP addresses that are in the same subnet than the first IP address of the default interface. If this option is specified, arpwatch will report bogons about every IP addresses. (Debian) The -m option is used to specify the e-mail address to which reports will be sent. By default, reports are sent to root on the local machine. (Debian) The -u flag instructs arpwatch to drop root privileges and change the UID to username and GID to the primary group of username . This is recommended for security reasons, but username has to have write access to the default directory. (Debian) The -R flag instructs arpwatch to restart in seconds seconds after the interface went down. By default, in such cases arpwatch would print an error message and exit. This option is ignored if either the -r or -u flags are used. (Debian) The -Q flags prevents arpwatch from sending reports by mail. (Debian) The -z flag is used to set a range of ip addresses to ignore (such as a DHCP range). Netmask is specified as 255.255.128.0. Note that an empty arp.dat file must be created before the first time you run arpwatch. REPORT MESSAGES
Here's a quick list of the report messages generated by arpwatch(1) (and arpsnmp(1)): new activity This ethernet/ip address pair has been used for the first time six months or more. new station The ethernet address has not been seen before. flip flop The ethernet address has changed from the most recently seen address to the second most recently seen address. (If either the old or new ethernet address is a DECnet address and it is less than 24 hours, the email version of the report is suppressed.) changed ethernet address The host switched to a new ethernet address. SYSLOG MESSAGES
Here are some of the syslog messages; note that messages that are reported are also sysloged. ethernet broadcast The mac ethernet address of the host is a broadcast address. ip broadcast The ip address of the host is a broadcast address. bogon The source ip address is not local to the local subnet. ethernet broadcast The source mac or arp ethernet address was all ones or all zeros. ethernet mismatch The source mac ethernet address didn't match the address inside the arp packet. reused old ethernet address The ethernet address has changed from the most recently seen address to the third (or greater) least recently seen address. (This is similar to a flip flop.) suppressed DECnet flip flop A "flip flop" report was suppressed because one of the two addresses was a DECnet address. FILES
/var/lib/arpwatch - default directory arp.dat - ethernet/ip address database /usr/share/arpwatch/ethercodes.dat - vendor ethernet block list SEE ALSO
arpsnmp(8), arp(8), bpf(4), tcpdump(1), pcapture(1), pcap(3) AUTHORS
Craig Leres of the Lawrence Berkeley National Laboratory Network Research Group, University of California, Berkeley, CA. The current version is available via anonymous ftp: ftp://ftp.ee.lbl.gov/arpwatch.tar.gz BUGS
Please send bug reports to arpwatch@ee.lbl.gov. Attempts are made to suppress DECnet flip flops but they aren't always successful. Most error messages are posted using syslog. 4th Berkeley Distribution 8 October 2000 ARPWATCH(8)
All times are GMT -4. The time now is 03:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy