Ver Resposta Única
Antigo 15-09-2005, 09:33   #1 (permalink)
cag
 
Avatar de cag
 
Registrado em: Sep 2005
Posts: 388
Agradeceu: 0
Agradecido 1 vez em 1 Post
Reputação: 0
cag
Padrão problema firewall

Tenho uma rede, com os seguintes ips: 192.168.254.1 até 192.168.254.12

Código:
#!/bin/bash
IF_EXTERNA="eth0";
IF_INTERNA="eth1";

REDE_INTERNA="192.168.254.0/24"

iptables -F
iptables -Z
iptables -X
iptables -F -t nat
iptables -X -t nat
iptables -F -t mangle
iptables -X -t mangle

echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_dynaddr

iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT

iptables -t mangle -A OUTPUT -o $IF_EXTERNA -p tcp -m multiport --dports 22,8080 -j TOS --set-tos 0x10

iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i $IF_INTERNA -j ACCEPT
iptables -A FORWARD -i $IF_INTERNA -j ACCEPT

iptables -A INPUT -i $IF_EXTERNA -p tcp --dport 777 -j ACCEPT

iptables -t nat -A PREROUTING -i $IF_INTERNA -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -i $IF_EXTERNA -p tcp --dport 8080 -j REDIRECT --to-port 80
iptables -t nat -A POSTROUTING -s $REDE_INTERNA -j MASQUERADE
Não funciona, a porta 8080 não redireciona tb.

Tem algo com 192.168.254.0/24 ?
cag está offline