finolinux
(usa Ubuntu)
Enviado em 18/03/2013 - 02:21h
Olá Brother
Seguindo sua linha de raciocinio, deixe seu firewall como abaixo:
IPT='/usr/sbin/iptables'
#NET_IFACE='eth0'
NET_IFACE='ppp0'
LAN_IFACE='eth1'
LAN_RANGE='192.168.0.0/24'
/sbin/modprobe ip_conntrack
/sbin/modprobe ipt_MASQUERADE
/sbin/modprobe ipt_LOG
/sbin/modprobe iptable_nat
/sbin/modprobe ip_nat_ftp
echo 1 > /proc/sys/net/ipv4/ip_forward
$IPT -F
$IPT -Z
$IPT -t nat -F
$IPT -t filter -P FORWARD DROP
$IPT -t filter -A INPUT -i lo -s 0/0 -d 0/0 -j ACCEPT
$IPT -t filter -A OUTPUT -o lo -s 0/0 -d 0/0 -j ACCEPT
$IPT -t filter -A INPUT -i $LAN_IFACE -m state --state NEW -j ACCEPT
$IPT -t filter -A INPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
#Libera Tudo
#$IPT -t filter -A FORWARD -d 0/0 -s $LAN_RANGE -o $NET_IFACE -j ACCEPT
$$IPT -t filter -A FORWARD -d $LAN_RANGE -s 0/0 -i $NET_IFACE -j ACCEPT
#Servidor(Pelo MAC)
#$IPT -t filter -A FORWARD -d 0/0 -s 192.168.0.1 -m mac --mac-source 00:00:00:54:A5:00 -j ACCEPT
#$IPT -t filter -A FORWARD -d 192.168.0.1 -s 0/0 -j ACCEPT
#Pc Temporario.
#$IPT -t filter -A FORWARD -d 0/0 -s 192.168.0.94 -j ACCEPT
#$IPT -t filter -A FORWARD -d 192.168.0.94 -s 0/0 -j ACCEPT
#######################################################################
# Redireciona DVR - ONDE ESTA "IPDVR" VC DEVE COLOCAR O IP DO SEU DVR #
#######################################################################
$IPT -A PREROUTING -m multiport -p tcp -t nat -d $NET_IFACE \
--dport 81,34567,34599 -j DNAT --to "IPDVR"
$IPT -A FORWARD -m multiport -p tcp -d "IPDVR" \
--dport 81,34567,34599 -j ACCEPT
#Redireciona porta.
$IPT -t nat -A PREROUTING -p tcp --dport 80 -i $NET_IFACE -j REDIRECT --to-port 3128
# NAT - Importante Senao a Internet nao funciona
$IPT -t nat -A POSTROUTING -o $NET_IFACE -j MASQUERADE