Wednesday, 11 September 2013

Internet Connection Sharing via Router

If you want to share this internet connection to the rest of the family since you have a huge quota every month (my case I am having 5GB), the rest of the family is connecting their network thru a wireless router, so following the steps below:

Follow these steps carefully:
  1. Make sure your 3G connection is connected and running well with your PC.
  2. Make sure your PC either connected to home router via network cable or wireless, in my case I prefer the later because some reason network cable will set as default resulted the internet connection won't work in local surfing.
  3. Make sure your router wireless and admin access are protected with at least WPA2 AES password to prevent unauthorized access especially your neighbor.
  4. Now, to setup your local PC, you need to have dnsmasq package, if not already installed as mentioned in my previous article, do so now by $ sudo yum install dnsmasq
  5. Find out the network interface that your 3G connection and wired/wireless connection is using, for my case 3G is using usb0 and wireless connection is wlan0. You can check this by right click on the Network Manager icon from the system tray and select Connection Information.
  6. Now, you need to configure Fedora to enable both IP masquerading and IP forwarding. To enable, run the following command in the terminal as root:

    # iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE   

    # echo 1 > /proc/sys/net/ipv4/ip_forward                                         
  7. Start up your firewall editor, in my case i am using system-config-firewall, configure usb0 to allow Masquerading interface.
    Add usb0 interface and check it. Apply the rules.
  8. Now, using another PC and connecting to the router. You need to change the gateway/router connection IP address to the IP address shared above.
  9. Also change the DNS address to either a public DNS like Google DNS or others.
  10. Launch a browser and it should works.
If you can't get it working, comment below.

No comments:

Post a Comment