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

Re: Problems running firestarter



 Hello,
 
 Wow, I finnaly managed to solve this problem. The whole thing was the
 following:
 
 - Whenever I started firestarter, there was the following error message:
   
   >iptables v1.2.9: host/network `" not found
   >Try `iptables -h" or "iptables --help" for more information.
 
   But despite the error above, the firewall started running. But the
   whole traffic was blocked.
 
 Then I found out that this error was due to a "problem" at the firestarter
 firewall script located at "/etc/firestarter/firewall.sh". More
 specifically at this point:
 
 > # --------( Initial Setup - Network Information (required) )--------
 > 
 > IF=ppp0
 > IP=`/sbin/ifconfig $IF | grep inet | cut -d : -f 2 | cut -d \  -f 1`
 > MASK=`/sbin/ifconfig $IF | grep Mas | cut -d : -f 4`
 > NET=$IP/$MASK
 > 
 > if [ "$MASK" = "" ]; then
 >         echo "External network device $IF is not ready. Aborting.."
 >        exit 2
 > fi
 
 The result for the command:
 
 > /sbin/ifconfig $IF | grep inet | cut -d : -f 2 | cut -d \  -f 
 
 was blank! Because ifconfig printed a space between "inet addr.:" and my
 IP number, and the command above couldn"t handle it correctly. My
 ifconfig output was something like:
 
 ppp0       Link : Protocol Pointo-To-Point
         inet addr.: 200.123.123.12  P-2-P:200.132.123.132  Mask:255.255.255.255          UP
POINTOPOINT RUNNING NOARP MULTICAST  MTU:1100  Metric:1
          RX packets:11 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          colisions:0 txqueuelen:3
          RX bytes:142 (142.0 b)  TX bytes:148 (148.0 b)
 
 So in the end, my IP variable was blank and NET variable was composed
 only by the mask. So I looked a few manuals and other firewall scripts
 examples and changed the command to:
 
 >IP=`/sbin/ifconfig $IF | grep inet | awk -F: "{print $2}" | awk "{print $1}"`
 >MASK=`/sbin/ifconfig $IF | grep Mas | awk -F: "{print $4}" | awk "{print $1}"`
 
 which manages to return correctly the expression with the IP and the
 MASK. However, in my opinion, it"s not the best solution. I think it
 would be better if regular expressions were used to get the IP and the
 MASK precisely, without having to worry with ifconfig"s output format. 
 
 Well, that"s it! I"d like to thank everyone who tried to help me and I
 hope this mail helps other people with the same problem. See ya!
 
 Thomas Beresford
-- 
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.


Powered by Outblaze



Reply to: