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

Re: IPTABLES and DHCP



Hi,
Just read the ip from ifconfig...

IP_INTERNET=`ifconfig eth0 | grep inet | awk '{ print $2 }' | cut -d: -f2 |
cut -d' ' -f1`

/Pontus
----- Original Message -----
From: "Randolph S. Kahle" <RandyKahle@KahleAssociates.com>
To: <debian-user@lists.debian.org>
Sent: Friday, December 07, 2001 06:45
Subject: IPTABLES and DHCP


> I am configuring a firewall that will run dhcpcd on eth0 (it is
> connected to a cable modem).
>
> I have a firewall rule set (for IPTABLES) that is working on another
> machine with a fixed IP for eth0
>
> In the rule set I have statements such as
>
> IF_INTERNET="eth0"
> IP_INTERNET="24.27.45.111"
>
>
> I use the $IP_INTERNET value in
>
> $IPTABLES -t nat -A POSTROUTING -o $IF_INTERNET -j SNAT --to-source
> $IP_INTERNET
>
> to give me my NAT translation.
>
> 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.
>
> Thanks!
>
> -- Randy
>
>
>
>
>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org
>
>




Reply to: