[gilug.org] gateway debian

David Casals hakd0c telefonica net
2006-02-13 15:59:31 UTC


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!!!!!!!


Atentament
hakd0c




More information about the gilug mailing list