Problema con IPTABLES
Quisiera ver si me puedes hechar una mano con esto, lo que sucede es que, tengo este script, en fedora core 8 para iptables. Y me da una lista de errores, que se encuentra mas abajo.
#CONFIGURACION DE SEGURIDAD
#PARAR EL SERVICIO DE IPTABLES
/sbin/service iptables stop
#MODULOS
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack_ftp
#VARIABLES USADAS
eth0=192.168.5.144
eth1=10.5.1.1
subred=10.5.0.0/16
database=192.168.1.8
#POLITICAS POR DEFECTO
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
#CONSULTAS LOCALES
iptables -A FORWARD -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
#CAMINOS
Iptables -N WAN-FIR
Iptables -N LAN-FIR
Iptables -N LAN-WAN
Iptables -N WAN-LAN
#DEFINICION DE CAMINIOS
Iptables -A INPUT -d $eth0 -i eth0 -j WAN-FIR
iptables -A INPUT -s $subred -i eth1 -d $eth1 -j LAN-FIR
iptables -A FORWARD -s $subred -i eth1 -j LAN-WAN
iptables -A FORWARD -d $subred -i eth0 -j WAN-LAN
#REGLAS de NAT
iptables -t nat -A POSTROUTING -s $subred -j SNAT --to $eth0
#REGLAS WAN-FIR
Iptables -A WAN-FIR -p tcp --dport 22 -j ACCEPT
iptables -A WAN-FIR -p tcp --dport 80 -j ACCEPT
iptables -A WAN-FIR -p tcp --dport 3128 -j ACCEPT
iptables -A WAN-FIR -m state --state ESTABLISHED, RELATED -j ACCEPT
iptables -A WAN-FIR -p icmp -j ACCEPT
iptables -A WAN-FIR -j DROP
#REGLAS LAN-FIR
Iptables -A LAN-FIR -p tcp --dport 3128 -j ACCEPT
iptables -A LAN-FIR -p tcp --dport 80 -j ACCEPT
iptables -A LAN-FIR -p icmp -j ACCEPT
iptables -A LAN-FIR -j DROP
#REGLAS LAN-WAN
Iptables -A LAN-WAN -p tcp -d $database --dport 1521 -j ACCEPT
iptables -A LAN-WAN -p udp --dport 20:21 -j ACCEPT
iptables -A LAN-WAN -p tcp --dport 20:21 -j ACCEPT
iptables -A LAN-WAN -p tcp --dport 80 -j DROP
iptables -A LAN-WAN -p tcp --dport 3128 -j DROP
iptables -A LAN-WAN -p tcp --dport 135:139 -j DROP
iptables -A LAN-WAN -p udp --dport 135:139 -j DROP
iptables -A LAN-WAN -p tcp --dport 445 -j DROP
iptables -A LAN-WAN -p udp --dport 445 -j DROP
iptables -A LAN-WAN -p tcp --dport 22 -j DROP
iptables -A LAN-WAN -p tcp --dport 53 -j DROP
iptables -A LAN-WAN -p udp --dport 53 -j DROP
iptables -A LAN-WAN -p tcp --dport 3189 -j DROP
iptables -A LAN-WAN -p icmp -j ACCEPT
iptables -A LAN-WAN -j ACCEPT
# REGLAS WAN-LAN
Iptables -A WAN-LAN -s $database -j ACCEPT
iptables -A WAN-LAN -m state --state ESTABLISHED, RELATED -j ACCEPT
iptables -A WAN-LAN -p icmp -j ACCEPT
iptables -A WAN-LAN -j DROP
#SALVAR LOS CAMBIOS
/sbin/service iptables save
error
[root@serprox ~]#./crea
: command not found
Usage: iptables {start|stop|restart|condrestart|status|panic|save}
: command not found
not found.le ip_nat_ftp
not found.le ip_conntrack_ftp
: command not found
: command not found
iptables: Bad policy name
iptables: Bad policy name
iptables: Bad policy name
: command not found
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
: command not found
iptables: Chain already exists
iptables: Chain already exists
iptables: Chain already exists
iptables: Chain already exists
: command not found
'ptables v1.3.8: Invalid target name `WAN-FIR
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `LAN-FIR
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `LAN-WAN
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `WAN-LAN
Try `iptables -h' or 'iptables --help' for more information.
: command not found
'ptables v1.3.8: Bad IP address `192.168.5.144
Try `iptables -h' or 'iptables --help' for more information.
: command not found
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
: command not found
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
: command not found
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
: command not found
Usage: iptables {start|stop|restart|condrestart|status|panic|save}
#CONFIGURACION DE SEGURIDAD
#PARAR EL SERVICIO DE IPTABLES
/sbin/service iptables stop
#MODULOS
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack_ftp
#VARIABLES USADAS
eth0=192.168.5.144
eth1=10.5.1.1
subred=10.5.0.0/16
database=192.168.1.8
#POLITICAS POR DEFECTO
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
#CONSULTAS LOCALES
iptables -A FORWARD -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
#CAMINOS
Iptables -N WAN-FIR
Iptables -N LAN-FIR
Iptables -N LAN-WAN
Iptables -N WAN-LAN
#DEFINICION DE CAMINIOS
Iptables -A INPUT -d $eth0 -i eth0 -j WAN-FIR
iptables -A INPUT -s $subred -i eth1 -d $eth1 -j LAN-FIR
iptables -A FORWARD -s $subred -i eth1 -j LAN-WAN
iptables -A FORWARD -d $subred -i eth0 -j WAN-LAN
#REGLAS de NAT
iptables -t nat -A POSTROUTING -s $subred -j SNAT --to $eth0
#REGLAS WAN-FIR
Iptables -A WAN-FIR -p tcp --dport 22 -j ACCEPT
iptables -A WAN-FIR -p tcp --dport 80 -j ACCEPT
iptables -A WAN-FIR -p tcp --dport 3128 -j ACCEPT
iptables -A WAN-FIR -m state --state ESTABLISHED, RELATED -j ACCEPT
iptables -A WAN-FIR -p icmp -j ACCEPT
iptables -A WAN-FIR -j DROP
#REGLAS LAN-FIR
Iptables -A LAN-FIR -p tcp --dport 3128 -j ACCEPT
iptables -A LAN-FIR -p tcp --dport 80 -j ACCEPT
iptables -A LAN-FIR -p icmp -j ACCEPT
iptables -A LAN-FIR -j DROP
#REGLAS LAN-WAN
Iptables -A LAN-WAN -p tcp -d $database --dport 1521 -j ACCEPT
iptables -A LAN-WAN -p udp --dport 20:21 -j ACCEPT
iptables -A LAN-WAN -p tcp --dport 20:21 -j ACCEPT
iptables -A LAN-WAN -p tcp --dport 80 -j DROP
iptables -A LAN-WAN -p tcp --dport 3128 -j DROP
iptables -A LAN-WAN -p tcp --dport 135:139 -j DROP
iptables -A LAN-WAN -p udp --dport 135:139 -j DROP
iptables -A LAN-WAN -p tcp --dport 445 -j DROP
iptables -A LAN-WAN -p udp --dport 445 -j DROP
iptables -A LAN-WAN -p tcp --dport 22 -j DROP
iptables -A LAN-WAN -p tcp --dport 53 -j DROP
iptables -A LAN-WAN -p udp --dport 53 -j DROP
iptables -A LAN-WAN -p tcp --dport 3189 -j DROP
iptables -A LAN-WAN -p icmp -j ACCEPT
iptables -A LAN-WAN -j ACCEPT
# REGLAS WAN-LAN
Iptables -A WAN-LAN -s $database -j ACCEPT
iptables -A WAN-LAN -m state --state ESTABLISHED, RELATED -j ACCEPT
iptables -A WAN-LAN -p icmp -j ACCEPT
iptables -A WAN-LAN -j DROP
#SALVAR LOS CAMBIOS
/sbin/service iptables save
error
[root@serprox ~]#./crea
: command not found
Usage: iptables {start|stop|restart|condrestart|status|panic|save}
: command not found
not found.le ip_nat_ftp
not found.le ip_conntrack_ftp
: command not found
: command not found
iptables: Bad policy name
iptables: Bad policy name
iptables: Bad policy name
: command not found
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
: command not found
iptables: Chain already exists
iptables: Chain already exists
iptables: Chain already exists
iptables: Chain already exists
: command not found
'ptables v1.3.8: Invalid target name `WAN-FIR
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `LAN-FIR
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `LAN-WAN
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `WAN-LAN
Try `iptables -h' or 'iptables --help' for more information.
: command not found
'ptables v1.3.8: Bad IP address `192.168.5.144
Try `iptables -h' or 'iptables --help' for more information.
: command not found
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
: command not found
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
: command not found
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `DROP
Try `iptables -h' or 'iptables --help' for more information.
: command not found
Usage: iptables {start|stop|restart|condrestart|status|panic|save}
Respuesta de csoliss
1