Public feed #528478

Untitled

public text v1 · immutable
Raw Edit
·published 2007-06-01 15:57 UTC
rendered paste body
echo 1 > /proc/sys/net/ipv4/ip_forward

#Borra todo
iptables -F
iptables -X
iptables -Z
iptables -t nat -F

#iptables -t nat -A POSTROUTING -s 0.0.0.0/0 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.1 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.2 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.4 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.7 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.19 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.20 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.21 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.22 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.35 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.45 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.47 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.49 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.51 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.59 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.84 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.90 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.93 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.106 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.112 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.114 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.115 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.117 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.118 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.119 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.120 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.175 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.176 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.177 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.190 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.192 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.194 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.200 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.201 -d 0.0.0.0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 222.0.0.237 -d 0.0.0.0/0 -j MASQUERADE

iptables -A INPUT -i ppp0 -p ICMP -j ACCEPT
iptables -A INPUT -p TCP -m state --state RELATED -j ACCEPT
iptables -A INPUT -p UDP -m state --state RELATED -j ACCEPT
iptables -A INPUT -i ppp0 -m state --state NEW,INVALID -j ACCEPT
iptables -A FORWARD -i ppp0 -m state --state NEW,INVALID -j ACCEPT

#MARIANO - Apertura de Puertos
	#www80 && redir servidor web
		iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT \
        	--to 222.0.0.2:80
           	iptables -A INPUT -p UDP --dport 80 -j ACCEPT
        #https
		iptables -A INPUT -p TCP --dport 443 -j ACCEPT
		iptables -A INPUT -p UDP --dport 443 -j ACCEPT
	#UNIX
		iptables -A INPUT -p TCP --dport 20 -j ACCEPT
		iptables -A INPUT -p TCP --dport 20 -j ACCEPT
		
	#ftp
		iptables -A INPUT -p TCP --dport 21 -j ACCEPT
		iptables -A INPUT -p UDP --dport 21 -j ACCEPT
	#ssh		
		iptables -A INPUT -p TCP --dport 22 -j ACCEPT
		iptables -A INPUT -p UDP --dport 22 -j ACCEPT

	#vnc
		iptables -A INPUT -p TCP --dport 5900 -j ACCEPT
	
#Redireccion de Puerto 5900 VNC
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 5900 -j DNAT \
           --to 222.0.0.20:5900

#Redireccion de Puerto Unix Server
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 20 -j DNAT \
           --to 222.0.0.3:20

#MARIANO Cerrado de puertos altos menos MSN
	 iptables -A INPUT -p tcp --syn --dport 1485:6890 -j DROP
	 iptables -A INPUT -p tcp --syn --dport 6991:65535 -j DROP


echo "Iptables Iniciadas... Use iptables -L"