Jump to content
Sign in to follow this  
Fernando Mercês

Configurações rápidas com iptables

Recommended Posts

Pá-pum, quem precisar no iptables:

1. Compartilhar uma conexão IPv4 de Internet, admitindo que eth0 é a interface conectada ao roteador/modem:

# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# echo 1 > /proc/sys/net/ipv4/ip_forward

2. Redirecionar o tráfego de entrada na porta TCP 81 para um host específico, no caso, 192.168.0.100 (útil para acesso externo de servidores de câmeras, por exemplo):

# iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 81 -j DNAT --to-destination 192.168.0.100

3. Redirecionar o tráfego entrante numa interface interna (útil quando temos um proxy escutando na porta 3128):

# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...