Skip to content

Share internet in a SERVER connected to WAN port.


The last days I keep trying to configure my server. I know how to configure the network to this:

MODEM -> (eth0) Servidor (eth1) -> (LAN Port) Router (LAN Ports) -> Computers

This topology don`t work for me, because in this way I lost one WAN Port. So I thought in this topology:

MODEM -> (eth0) Servidor (eth1) -> (Porta WAN) Router (Portas LAN) -> Computadoresauto eth1
iface eth1 inet static

After this I add this iptables rules:

sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
iptables -A FORWARD --in-interface eth0 -j ACCEPT

I need to setup the router manually:

IP Address :
Subnet Mask :
ISP Gateway Address :
Primary DNS Address : (DNS)
Secondary DNS Address : (DNS)

So up and running


Published inAprendendoLinux

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.