
Enviado em 08/11/2012 - 15:34h
Pessoal!
#carrega modulos, compartilhamento internet
echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe iptable_nat
#limpando as regras
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -t nat -F
iptables -t mangle -F
#politica drop all
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
#nat
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#tratando da porta 80 e 443 protocolos tcp e udp para proxy transparent
iptables -t nat -A PREROUTING -s 192.168.100.0/24 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -s 192.168.100.0/24 -p tcp --dport 443 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -s 192.168.100.0/24 -p udp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -s 192.168.100.0/24 -p udp --dport 443 -j REDIRECT --to-port 3128
#a regra abaixo vai liberar protocolos udp, tcp e icmp para a rede 192.168.100.0/24;
iptables -A INPUT -p all -s 192.168.100.0/24 -j ACCEPT
iptables -A OUTPUT -p all -s 192.168.100.0/24 -j ACCEPT
iptables -A FORWARD -p all -s 192.168.100.0/24 -j ACCEPT
##A regra abaixo vai liberar o retorno dos pacotes para rede local 192.168.100/24
iptables -A FORWARD -s 192.168.100.0/24 -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
#nmap local
iptables -A INPUT -s 127.0.0.1 -j ACCEPT
iptables -A OUTPUT -s 127.0.0.1 -j ACCEPT
#consultar dns
iptables -A INPUT -p all --dport 53 -j ACCEPT
http_port 3128 transparent
cache_dir ufs /var/spool/squid3 100 16 256
cache_mem 100 MB
visible_hostname Proxy
#regras;
acl REDE01 src 192.168.100.0/24
acl LIBERAR url_regex "/etc/squid3/LIBERAR.txt"
acl NEGAR url_regex "/etc/squid3/NEGAR.txt"
#acl diretor src 192.168.100.7
#http_access allow all diretor
http_access allow all REDE01 LIBERAR
http_access deny all REDE01 NEGAR
acl REDELOCAL src 192.168.100.0/24
http_access allow REDELOCAL
Boas Práticas e Padrões Idiomáticos em Go e C
Vale a pena ter mais de uma interface grafica no seu Linux?
Estrutura e Funcionamento de um Ebuild no Gentoo Linux
Copiar Para e Mover Para no menu de contexto do Nautilus e Dolphin
Dotando o Thunar das opcoes Copiar para e Mover para no menu de contexto
Usando o ble.sh (Bash Line Editor) no lugar do bash completion
Montagem pré automática de HD externo usb em NTFS não funciona no Debian Trixie - Solução
O que você está ouvindo agora? [2] (240)
Senhor Einstein tinha razão mesmo! (0)
Instalação Dual Boot Linux+Windows 11 (2)
No Ubuntu 26.04, sudo passou a mostrar os asteriscos ao digitar por pa... (2)









