magubuntu
(usa Ubuntu)
Enviado em 16/03/2011 - 19:27h
Meu amigo, eu não configurei o iptables ainda. Apenas instalei o sistema, configurei as duas interfaces, instalei e configurei o squid. Do servidor eu consigo pingar pra qualquer site, sem problemas. Configurei a minha máquina com o ip 10.10.10.10 e consigo pingar pro servidor também, que tem o ip 10.10.10.1. Ai vai os resultandos dos comandos:
iptables -L:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
iptables -t nat -L:
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 10.10.10.0/24 anywhere
MASQUERADE all -- 10.10.10.10 anywhere
e esse e o conteúdo do meu rc.local:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
modprobe iptables_nat
echo > 1 /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE
exit 0