Compartilhar Internet no Linux

Limitar o tamanho de pacotes IP

iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:1536 -j TCPMSS --clamp-mss-to-pmtu

Mascarar conexão

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o ppp0 -j MASQUERADE

*A conexão pode ser mascarada pegando a interface do gateway padrão

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o $(ip route | awk '/default/{print $NF}') -j MASQUERADE

Habilitar repasse de pacotes

echo 1 > /proc/sys/net/ipv4/ip_forward

Carregue os módulos de acompanhamento de conexão para o serviço FTP

modprobe ip_nat_ftp
modprobe ip_conntrack_ftp
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s