[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IPTABLES and DHCP



On 6 Dec 2001, Randolph S. Kahle wrote:

>  
> My question is this --> How do I synchronize the IP address for eth0
> that dhcpcd secures with the rule in iptables?
> 
> It seems to me that I need to run some script or take some action each
> time dhcpcd secures a new IP address.
> 
Randy,

	Here is what I did : I installed ipmasq and disabled it (remove
the symlinks if you are not using filerc - if you are, its much easier).
The ipmasq package has a number of utils like default-if, and ipofif that
can help you in your task. default-if for instance returns the net if that
has the default route. If you are using DHCP, then the default route will
be set for that interface. ipofif can be applied to the output of
default-if to tell you the ip address that has been assigned to you.

Regards,
Jor-el



Reply to: