On Monday 20 May 2002 4:23 pm, Robert wrote:

>    I have a simple single-user workstation MDK 8.1 system that uses DSL and
> DHCP.
>   Most scripts deal with a solid IP address for internet use, and it would
> be nice to build on these scripts if I could gather the assigned IP address
> from the DHCP assignment.
>   Is there a way to do this?

Have a look in /etc/dhcpc

You should find a file called dhcpcd-eth0.info which you should be able to 
grep/awk etc for the information you need.

>   Not to complicate matters, but I am connected (along with my wife) to a
> LinkSys Etherfast router for the DSL, so we can both use this service.  I
> see that the router assigns a consistant address of 192.168.1.100 for me,
> and *.101 for my wife.   Not being a guru like most of the people here,
> would a standard script work if I inserted this 192.168.1.100 address
> instead of trying to determine the address otherwise?

Yes, but it's not the *right* way to do it...... :-)

>  The way I understand
> the router, is that whatever IP the server assigns, is stored by the
> router, and then the router distributes the packets to whomever they belong
> to at either the *.100 or *.101 address, depending on who sent them.

I'm not sure where the DHCP server is on your ADSL arrangement - it might be 
somewhere at the ISPs premises, but I think it's more likely to be inside the 
LinkSys box itself.   You're correct that a DHCP server keeps a table of MAC 
addresses and IP addresses so that a machine which comes back (a long time 
after the lease has run out) and re-requests an IP address will get 
recognised by its MAC address and given the same IP as it got last time 
(unless the DHCP server has run out in the meantime and given it to someone 
else).


By the way, this is a Netfilter mailing list :-)



Antony.

Reply via email to