Re: script reglas iptables debian etch
El Sat, 25 Aug 2007 08:39:13 +0200 (CEST)
Paúl Criollo Ortiz <polcrito.debian@yahoo.es> escribió:
> saludos...
> tengo un server con debian etch, instale desde el cd
> net, solo escogio sistema base o standart, admas tengo
> el sgte.... scripot qe me funciona bien en sarge y
> centos tiuene esto....
>
> ## CARGA DE ALGUNOS MODULOS NECESARIOS
> /sbin/modprobe iptable_nat
> /sbin/modprobe ip_nat_ftp
> /sbin/modprobe ip_conntrack_ftp
>
> ## LIMPIEZA DE REGLAS ANTERIORES
> iptables -t nat -F
>
> ## SE AUMENTAN EL NUMERO DE CONEXIONES SEGUIDAS
> #echo 65535 > /proc/sys/net/ipv4/ip_conntrack_max
> ## SE IGNORAN LOS ERRORES DEL ICMP
> echo 1 >
> /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
> ## SE HABILITA EL FORWARD DE LOS PAQUETES
> echo 1 > /proc/sys/net/ipv4/ip_forward
> ## SE HABILITA LA PROTECCION CONTRA LOS SYN FLOODS
> #echo 1 > /proc/sys/net/ipv4/tcp_syncookies
>
> ## SE DECLARAN TODAS LAS VARIABLES
> LAN=192.168.10.0/24
> WAN="10.254.146.9"
> NUBE=0/0
> PTOSQUID=80
>
> ## SE QUITAN LOS REGISTROS DE BROADCAST EN
> /var/log/messages
> iptables -t mangle -I PREROUTING -j DROP -d
> 224.0.0.0/8
>
> ## SE CONECTA CON EL PROXY TRANSPARENTE
> iptables -t nat -A PREROUTING -i eth1 -p tcp -s $LAN
> -d $NUBE --dport 80 -j REDIRECT --to-port 3128
> ###### MANEJO DE PUERTOS
> #iptables -t filter -A INPUT -p tcp -s $LAN --dport 22
> -j ACCEPT
> #iptables -t filter -A INPUT -p tcp -s $LAN --dport
> 20:21 -j ACCEPT
> #iptables -t filter -A INPUT -p tcp --dport 22 -j DROP
> #iptables -t filter -A INPUT -p tcp --dport 20:21 -j
> DROP
>
>
> iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE
> --dport 53 -j MASQUERADE
> iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE
> --dport 53 -j MASQUERADE
> iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE
> --dport 5190 -j MASQUERADE
> iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE
> --dport 5190 -j MASQUERADE
> iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE
> --dport 1863 -j MASQUERADE
> iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE
> --dport 1863 -j MASQUERADE
> iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE
> --dport 1024:65535 -j MASQUERADE
>
> ## YA HACIENDO EL NAT EN LA RED
> iptables -t nat -A POSTROUTING -s $LAN -d $NUBE -j
> SNAT --to-source $WAN
>
> # /root/cbq.init stats | more
> iptables -t nat -L -n
>
> ###############################
> cuando ejecuto ./cabinas.sh
>
> sale esto
>
> : command not found3:
>
> not found.le iptable_nat
>
> not found.le ip_nat_ftp
>
> not found.le ip_conntrack_ftp
>
> : command not found8:
>
> iptables: No chain/target/match by that name
>
>
> command not found11:
>
> : No existe el fichero o el
> directoriopv4/icmp_ignore_bogus_error_responses
>
> : No existe el fichero o el directoriopv4/ip_forward
>
> : command not found20:
>
> : command not found26:
>
> ' specified.3.6: invalid mask `8
>
> Try `iptables -h' or 'iptables --help' for more
> information.
>
> : command not found29:
>
>
>
> ' specified.3.6: invalid mask `24
>
> Try `iptables -h' or 'iptables --help' for more
> information.
>
> : command not found37:
>
> : command not found38:
>
> 'ptables v1.3.6: Invalid target name `MASQUERADE
>
> Try `iptables -h' or 'iptables --help' for more
> information.
>
> 'ptables v1.3.6: Invalid target name `MASQUERADE
>
> Try `iptables -h' or 'iptables --help' for more
> information.
>
> 'ptables v1.3.6: Invalid target name `M
>
>
>
> por afvor como soliciomes linux
>
> manana hablamos
>
Vamos a ver: ejectuta iptables pero hay una orden que no puede ejecutar. O es
echo, y entonces no tienes bien configurado la variable PATH, o, más probable,
no tienes instalado module-init-tools, que contiene a modprobe.
En cuanto a los mensajes del tipo "Invalid target ..." me hace pensar que estás
usando un núcleo personalizado y que no has activado las características
necesarias. Mira en "Networking" -> "Networking options" -> "Network packet
filtering framework (Netfilter)" y siguientes submenús.
Saludos.
--
Manolo Díaz
Reply to: