gesousa
(usa Ubuntu)
Enviado em 29/07/2009 - 20:50h
vc deve primeiro ativar o ipv4_forward
echo 1 > /proc/sys/net/ipv4/ip_forward
depois criar as regras de iptables de mascaramento e redirecionamente:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
iptables -A FORWARD -s 192.168.0.0/24 -o eth0 -j ACCEPT
iptables -A FORWARD -d 192.168.0.0/24 -m state --state ESTABLISHED,RELATED -i eth0 -j ACCEPT
Depois basta configurar o arquivo de interfaces de rede do debian e do windows...
Debian
sudo gedit /etc/network/interfaces
# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback
#REDE INTERNET
auto eth0
iface eth1 inet static
address 192.168.4.2
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.4.1
#REDE INTERNA
auto eth1
iface eth1 inet static
address 192.168.0.1
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
salve e saia
Condigure o dns:
sudo gedit /etc/resolv.conf
nameserver 180.0.0.0
nameserver 201.0.0.0
Carregue as configurações:
sudo /etc/init.d/networking restart
Windows
Vc deve configurar a placa de rede com a seguinte configuração
ip 192.168.0.2
mascara 255.255.255.0
gateway 192.168.0.1
Dns primario 192.168.0.1
Dns secundario 180.0.0.0