Re: Problem with ipfw rules



On Sat, 28 Feb 2009 21:56:46 UTC, "Rodney Pont"
<pmmspamuxxj@xxxxxxxxxxxxxxxxxxxxx> wrote:

On Sat, 28 Feb 2009 21:01:12 +0100, Torfinn Ingolfsen wrote:

Bob Melson wrote:
But, every time I attempt to start ipfw from /etc/rc.d/ipfw or to manually
start ipfw from the command line with "ipfw /etc/ipfw.rules I get the
following error:
Line 9: bad command `ipfw'

Try using the whole path to the ipfw command instead of just 'ipfw':
tingo@kg-work2$ which ipfw
/sbin/ipfw

See if that works better.

The problem here is that the script is calling ipfw:

It's defining fwcmd in the line below
fwcmd="ipfw -q add"
pif="xl0"
#------------------------------------
# keep loopback "open"
#------------------------------------
$fwcmd 00001 allow all from any to any via lo0

and then using it in the line about to make it

ipfw -q add 00001 allow all from any to any via lo0

All it needs is:
sh /etc/ipfw.rules

It's actually a script and, as Bob says, not the file containing the
firewall rules.

As I said, two solutions:

1) set it as the script by changing rc.conf
2) remove the 'ipfw' bit

--
Bob Eager
UNIX since v6..
http://tinyurl.com/2xqr6h

.



Relevant Pages

  • Re: my lame attempt at a shell script...
    ... In order for the script to work, ... > and just write a new line to a ruleset and let ipfw figure it out. ... I meant by manually typing in a new rule on the command ...
    (freebsd-questions)
  • Re: Problem with "ipfw flush"
    ... kldload ipfw && ipfw add 65000 allow ip from any to any ... I have tables and pipes in play, and I believe a regular ipfw flush doesn't clear them. ... Is there a universal "reset EVERYTHING" command? ... > isn't working via ssh. ...
    (freebsd-questions)
  • Re: Problem with "ipfw flush"
    ... firewall_script on line 131 with "sh", not with ipfw. ... writes to the terminal, which after the flush, it can't. ... mend the following command line: ... isn't working via ssh. ...
    (freebsd-questions)
  • Re: Problem with "ipfw flush"
    ... ipfw -f /etc/ipfw.rules right from the command line, ... This allows the rest of the ipfw command to run, ... rules across a remote login session. ...
    (freebsd-questions)
  • Re: ipfw log command
    ... IPFW runs fine and logs a bunch of things to my /var/log/security file as ... But when I add this to the firewall rules from the command line: ... How do I get a listing of what ports are being diverted? ...
    (comp.unix.bsd.freebsd.misc)