[IPFW] Fehler beim starten

07/15/2013 09:18 .Seriously#1
Hallo,
bekomme immer den fehler beim starten:
PHP Code:
'pfw: bad command 'add 
ipfw.rules:
PHP Code:
IPF="ipfw -q add"
ipfw --f flush

#loopback
$IPF 10 allow all from any to any via lo0
$IPF 20 deny all from any to 127.0.0.0
/8
$IPF 30 deny all from 127.0.0.0
/8 to any
$IPF 40 deny tcp from any to any frag

# statefull
$IPF 50 check-state
$IPF 60 allow tcp from any to any established
$IPF 70 allow all from any to any out keep
-state
$IPF 80 allow icmp from any to any

# open port ftp (20,21), ssh (22), mail (25)
# http (80), dns (53) etc
$IPF 110 allow tcp from any to any 21 in
$IPF 120 allow tcp from any to any 21 out
$IPF 130 allow tcp from any to any 22 in
$IPF 140 allow tcp from any to any 22 out
$IPF 170 allow udp from any to any 53 in
$IPF 175 allow tcp from any to any 53 in
$IPF 180 allow udp from any to any 53 out
$IPF 185 allow tcp from any to any 53 out 
rc.conf:
PHP Code:
# -- sysinstall generated deltas -- # Wed Mar 13 17:17:50 2013
# Created: Wed Mar 13 17:17:50 2013
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="0x72967.host.de"
ifconfig_em0="DHCP"
inetd_enable="YES"
keymap="german.iso"
sshd_enable="YES"
mysql_enable=YES
firewall_enable
="YES"
firewall_script="/etc/ipfw.rules" 
Version ist Freebsd 8.3
woran liegts?
07/15/2013 10:42 Uepsilon#2
Starte putty, gehe zu

cd /etc/ && ee ipfw.rules (oder wie deine Datei heißt). Dann überprüfe die Datei. Ich hatte sie damals auch mit einem normalen Texteditor bearbeitet und hochgeladen und danach hatte ich exakt den gleichen "Fehler" wie bei dir. Grund war das hinter jeder Zeile ein "^M" stand.
07/15/2013 13:18 .Seriously#3
Danke hat funktioniert.
07/15/2013 13:18 sucopowa#4
^richtig genau, wegen "windows-lehrzeichen", hatte ich auch das problem, dan einfach, copiert, un per putty die datei geöffnet so wie Uepsilon sagt, und dan einfach rechtsclik (einfügen in linux, like ctrl+v in windows), und dan sieht man auch diese scheis "^M" oä...