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
DHCP-HELPER(8)						      System Manager's Manual						    DHCP-HELPER(8)

NAME
dhcp-helper - A DHCP/BOOTP relay agent. SYNOPSIS
dhcp-helper [OPTION]... DESCRIPTION
dhcp-helper is a DHCP and BOOTP relay agent. It listens for DHCP and BOOTP broadcasts on directly connected subnets and relays them to DHCP or BOOTP servers elsewhere. It also relays replies from the remote servers back to partially configured hosts. Once hosts are fully config- ured they can communicate directly with their servers and no longer need the services of a relay. OPTIONS
The only required option is at least one DHCP server to relay to. The simplest way to configure dhcp-helper on a router is just to give the interface to the network containing the DHCP server with a -b option. All the other interfaces present on the machine will then accept DHCP requests. On a machine which does not have an interface on the network containing the DHCP server, use a -s option instead. -s <server> Specify a DHCP or BOOTP server to relay to. The server may be given as a machine name or dotted-quad IP address. More than one server may be specified. -b <interface> Relay to a DHCP or BOOTP server using broadcast via <interface>. This eliminates the need to give a server address. <interface> is automatically added to the list of interfaces which will not receive DHCP requests. -i <interface> Specify which local interfaces to listen on for DHCP/BOOTP broadcasts. If no -i flags are given all interfaces are used except those specified by -e flags and those specified by -b flags. -e <interface> Specify which local interfaces to exclude. -p Use alternative ports (1067/1068) for the DHCP client and server. -v Report the software release version and copyright information. -d Debug mode, do not change UID, write a pid-file or go into the background. -r <file> Specify an alternate path for dhcp-helper to record its process-id in. Normally /var/run/dhcp-helper.pid. -u <username> Specify the userid to which dhcp-helper will change after startup. The daemon must normally be started as root, but it will drop root priviledges after startup by changing id to another user. Normally this user is "nobody" but that can be over-ridden with this switch. NOTES
Dhcp-helper requires a 2.2 or later Linux kernel. The "Linux packet filter" and "packet socket" facilities are not required, which is the chief advantage of this software over the ISC DHCP relay daemon. AUTHOR
This manual page was written by Simon Kelley <simon@thekelleys.org.uk>. DHCP-HELPER(8)
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy