Sponsored Content
Top Forums Shell Programming and Scripting getting mac from ip (or the contrary) Post 302296505 by chebarbudo on Wednesday 11th of March 2009 08:15:51 AM
Old 03-11-2009
getting mac from ip (or the contrary)

Hi there,
I need to find a way to check that a remote machine got the correct ip address. I have a dhcp server and need to run some commands after machine M acquired address A.
There are lots of reasons why machine M could have another address:
1) DHCP not reloaded
2) Machine M offline or powered off
3) Machine M has not renewed its ip address

Is there a way to do one of the following?
Code:
if [$(getmacfromip $ip) == $mac]; then ...
if [$(getipfrommac $mac) == $ip]; then ...

Can you help me lead me in the right direction?
Thanks in advance
Santiago
 

We Also Found This Discussion For You

1. OS X (Apple)

Let's get a .mac top level domain! As in www.xyz.mac

ICANN, the Internet Corporation for Assigned Names and Numbers, is inviting proposals for new sponsored top level domains. This may be wishful thinking, but isn't that a chance to push for a .mac top level domain (TLD)? I for one would VASTLY like the idea of having a domain of something.mac --... (0 Replies)
Discussion started by: ropers
0 Replies
MTEST(8)						    BSD System Manager's Manual 						  MTEST(8)

NAME
mtest -- test multicast socket operations SYNOPSIS
mtest DESCRIPTION
The mtest utility is a small program for testing multicast socket operations. It accepts the following commands, interactively, or as part of a scripted input file (useful for automated testing): a ifname mac-addr Join the link-layer group address mac-addr on interface ifname. The group address should be in IEEE 802 MAC format, delimited by colon (':') characters. d ifname mac-addr Leave the link-layer group address mac-addr on interface ifname. m ifname 1/0 Set or reset ALLMULTI mode on interface ifname. This option is deprecated and is now a no-op. p ifname 1/0 Set or reset promiscuous mode on interface ifname. j mcast-addr ifname [source-addr] Join the multicast address mcast-addr on the interface with name ifname. If an optional source source-addr is specified, a source-specific join will be performed; if mtest is already joined to the multicast address, the source will be added to its filter list. l mcast-addr ifname [source-addr] Leave the multicast address mcast-addr on the interface with address ifname. If a source source-addr is specified, only that source will be left. i mcast-addr ifname n source-addr ... Set the socket with membership of mcast-addr on interface ifname to include filter mode, and add n sources beginning with source-addr to the inclusion filter list. e mcast-addr ifname n source-addr ... Set the socket with membership of mcast-addr on interface ifname to exclude filter mode, and add n sources beginning with source-addr to the exclusion filter list. t mcast-addr ifname source-addr Set the socket with membership of mcast-addr on interface ifname to block traffic from source source-addr. b mcast-addr ifname source-addr Set the socket with membership of mcast-addr on interface ifname to allow traffic from source source-addr. g mcast-addr ifname n Print n source filter entries for mcast-addr on interface ifname. f filename Read commands from the file filename. s n Sleep for n seconds. ? List legal commands. q Quit the program. IMPLEMENTATION NOTES
For each command implemented by mtest, the address family of each argument must be identical; it is not possible to mix IPv4 multicast mem- berships with IPv6, for example. To support IPv6, all commands have now changed to accept an interface name rather than an interface address. For IPv4, the program will per- form a lookup of the primary IP address based on the interface name. This may fail if no primary IP address is assigned. SEE ALSO
D. Thaler, B. Fenner, and B. Quinn, Socket Interface Extensions for Multicast Filters, RFC 3678. AUTHORS
Bruce Simpson Steve Deering Wilbert De Graaf BSD
April 29, 2009 BSD
All times are GMT -4. The time now is 02:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy