keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Sat Oct 19, 2013 4:31 pm Post subject: ifconfig - Warning about autodetecting the IP address |
|
|
Hello all,
Mostly inside the rc.firewall script I use to autodetect the NIC ip addresses by:
Code: |
EXTIP="`$IFCONFIG $EXTIF | $GREP 'inet addr' | $AWK '{print $2}' | $SED -e 's/.*://'`"
## or
EXTIP="`$IFCONFIG $EXTIF | $AWK /$EXTIF/'{next}//{split($0,a,":");split(a[2],a," ");print a[1];exit}'`"
|
I've noticed after a fresh install of SMS64 2.0.5 that ifconfig has changed it's answer format.
A quick workaround is to use:
Code: |
EXTIP="`$IFCONFIG $EXTIF | $GREP 'inet addr' | $AWK '{print $2}'`"
|
I have to mention that the basic firewall script I use, is rc.firewall-iptables-stronger ver 0.88s from tldp.org |
|