/* HINT: Search archives @ http://www.indyramp.com/masq/ before posting! 
/* ALSO: Don't quote this header. It makes you look lame :-) */

Hi all. Here's one it took me a respectable amount of time to find out, (I'm
not an expert on Linux networking), I guess the solution could help other
peoples outside of english language countries.

I had successfully configured my iptables on a Mandrake 8.2 (kernel 2.4.18),
using both Simple-Masquerading Howto and TOS MASQ Howto's basic ruleset.
However when I tried the "strong" ruleset it failed on a "bad parameter"
error at the following line :

   # Allow any related traffic coming back to the MASQ server in
   #
   $IPTABLES -A INPUT -i $EXTIF -s $UNIVERSE -d $EXTIP -m state --state
ESTABLISHED,RELATED -j ACCEPT

Tracing it, the reason for this error is that $EXTIP is empty. At the
beginning of the script, there's a line for detecting a dynamic IP :

   # Determine the external IP automatically:
   # ----------------------------------------
   #
   EXTIP="`$IFCONFIG $EXTIF | $GREP 'inet addr' | $AWK '{print $2}' | \
   $SED -e 's/.*://'`"

Unfortunately, in a french localized ifconfig says "inet adr:" and not "inet
addr:". (In french, "address" translates into "adresse".)

grep fails to find a match and EXTIP is empty.

So I changed the line for this :

   EXTIP="`$IFCONFIG $EXTIF | $GREP 'inet' | grep ':' | $AWK '{print $2}' |
\
   $SED -e 's/.*://'`"

Any other I guess there are little chance that "inet" and ":" change in any
translated version of ifconfig.

Regards.


_______________________________________________
Masq maillist  -  [EMAIL PROTECTED]
Admin requests can be handled at http://www.indyramp.com/masq-list/ -- 
THIS INCLUDES UNSUBSCRIBING!
or email to [EMAIL PROTECTED]

PLEASE read the HOWTO and search the archives before posting.
You can start your search at http://www.indyramp.com/masq/
Please keep general linux/unix/pc/internet questions off the list.

Reply via email to