Monday, September 6, 2010

Sharing internet connection in Linux

In this article I want to share about "how to share internet connection in Linux", in my condition, internet come from usb modem interface (ppp0) and I want to share with another network interface, wlan0 interface.  To share internet connection in Linux, you must following some steps bellow:

  1. Enable IP Forward

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

  2. Clear ip table
    #iptables -F -t nat

  3. Using ip tables to create internet packet routing
    #iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
    #iptables --append FORWARD --in-interface wlan0 -j ACCEPT

  4. Restart network
    /etc/init.d/networking restart

I'm using Ubuntu 10.10 (Maverick) 32 bit

No comments:

Post a Comment