Sharing Internet in Ubuntu Linux

I have router linux with 2 ethernet (eth0 and eth1). eth1 connection to WAN (ISP Tabina) and eth0 to LAN. Actualy, in my computer has 3 ethernet; 1 onboard and 2 PCI, but ethernet onboard no good or not normal fuction. Then, I non active in BIOS ethernet onboard (User Intel Mainboard).


  1. Install Ubuntu Linux
  2. Setting eth0 to LAN (IP Address :, subnet Mask :, Gateway: blank) and eth1(IP Address:, Subnet Mask:, Gateway : and than DNS and
  3. Run command with root access cek ip_forward:
    cat /proc/sys/net/ipv4/ip_forward
    echo “1”>/proc/sys/net/ipv4/ip_forward
  4. Run command with root access iptables :
    iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

For permanent edit file /etc/rc.local and delete exit 0 and write:

#!/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.
#Non Active
#exit 0
echo “1” > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE


About zacknov

This blog about programming and my activity
This entry was posted in Computer, Internet and tagged , , , . Bookmark the permalink.

Leave a Reply

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

You are commenting using your 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