RE: How filter IP address if it *changes* often?? (think dhcp)

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

 



> How do this if IP address changes uncontrollably
> like with DHCP??


The following sh script will extract the ip address of the external
interface. If the address changes forcable ie not just when you renew
your lease volentarily then run the script on cron

$IFCONFIG = /path/ifconfig
$EXTIF = ppp0 or whatever
$AWK=/patch/awk

EXTIP="`$IFCONFIG $EXTIF | $AWK \
 /$EXTIF/'{next}//{split($0,a,":");split(a[2],a," ");print a[1];exit}'`"



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux