[plug] Ethernet Addresses

Christian christian at amnet.net.au
Thu May 4 11:47:09 WST 2000


On Thu, May 04, 2000 at 11:37:15AM +0800, Anthony J. Breeds-Taurima wrote:
> On Thu, 4 May 2000, Christian wrote:
> 
> > Does anyone know how to find out the ethernet (MAC) address of a given
> > interface?  After searching the manual I can't find any system calls
> > that seem to be related to doing this.  The context is I need to write a
> > program to determine the MAC address in order to assign the correct IP
> > address from a local lookup table on boot-up.
> 

> If you are on a _server_ and you need to assign an IP to a mac address what is
> wrong with rarp or dhcp ??

That was my original plan but then I realised that the only possible
DHCP server would have to be on a different physical network so it
wouldn't hear the broadcasts.  Unfortunately there probably isn't any
way to work around this so what I'm planning to do is take the
collection MAC addresses and their corresponding IP addresses and put
them into a lookup table then find out the MAC address of the current
station and assign the IP as given in the table.  To do that I need a
system call or library routine that allows me to find out the MAC
address of the given interface.

> Or have I missed the point again ?

It's an unusual situation.  Basically it's a portable distribution for
teaching a unit at Murdoch Uni.  There are a million and one better and
more elegant ways of doing it but university bureacracy prevents this.

Regards,

Christian.



More information about the plug mailing list