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).
- Install Ubuntu Linux
- Setting eth0 to LAN (IP Address : 192.168.0.1, subnet Mask : 255.255.255.0, Gateway: blank) and eth1(IP Address: 192.168.168.2, Subnet Mask: 255.255.255.0, Gateway : 192.168.168.1) and than DNS 172.20.1.1 and 172.20.1.2
- Run command with root access cek ip_forward:
- 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:
# 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
# By default this script does nothing.
echo “1” > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE