[gilug.org] gateway debian
Raul Perez raul web4linux org
2006-02-13 17:37:26 UTC
On Mon, 2006-02-13 at 16:59 +0100, David Casals wrote:
> Estic intentant montar un gateway amb debian.
>
> la maquina te
> eth0 ip 192.168.1.254 netmask 255.255.255.0 gateway 192.168.1.1 aquesta
> seria la de sortida
> eth1 ip 192.168.0.254 netmask 255.255.255.0 aquesta es la interna.
>
> La veritat es que no en tinc ni idea i vaig trobar una web on et
> generava l'script iptables per a fer coses d'aquestes
>
> #!/bin/sh
>
> # iptables script generator: V0.1-2002
> # Comes with no warranty!
> # e-mail:
> # Portado para PHP-Nuke pelo portal Tux-BR: www.tux-br.org
> # Todos os direitos reservados para o autor original:
> http://iptables-script.dk/
> # I (Elessar) JUST PORTED IT TO PHP-NUKE !!!
>
> # Disable forwarding
> echo 0 > /proc/sys/net/ipv4/ip_forward
>
> LAN_IP_NET='192.168.0.254/24'
> LAN_NIC='eth1'
> WAN_IP='192.168.1.254'
> WAN_NIC='eth0'
>
> # load some modules (if needed)
>
> # Flush
> iptables -t nat -F POSTROUTING
> iptables -t nat -F PREROUTING
> iptables -t nat -F OUTPUT
> iptables -F
>
> iptables -P INPUT DROP
> iptables -P FORWARD DROP
> iptables -P OUTPUT ACCEPT
>
> # enable Masquerade and forwarding
> iptables -t nat -A POSTROUTING -s $LAN_IP_NET -j MASQUERADE
> iptables -A FORWARD -j ACCEPT -i $LAN_NIC -s $LAN_IP_NET
> iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
>
> # STATE RELATED for router
> iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
>
>
> # Enable forwarding
> echo 1 > /proc/sys/net/ipv4/ip_forward
>
>
> ------------------------------------------------------------------------------------------------------------------------------------
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Aixo em permet navegar i pop3 pero missatgeria instantĂ nea no, gaires
> coses mes encara no he provat.
>
> AlgĂș em pot ajudar, passar un bon manual. Necessito apendre!!!!!!!
http://bulma.net/body.phtml?nIdNoticia=1522
iptables y NAT para vagos
L'article et va al pel jeje ;)
>
>
> Atentament
> hakd0c
>
> _______________________________________________
> Llista mailing list
>
> http://gilug.org/cgi-bin/mailman/listinfo/llista
>
Més informació sobre la llista de correu gilug