Usually, I use my HotSpot @home to connect internet through local ISP, so do My Laptop.
But today I want try to change that route, because now I have an unlimited GSM Broadband 3.5G account in my laptop
This is the architecture changes that I’ve made :
Objective : “I want to let my PC connect to the internet through my laptop. PC use Edubuntu 7.10, laptop use Ubuntu 8.04 LTS”
For simpler working, I made my PC and my WiFi Hub in the same network; 192.168.1.0
1. Connect the laptop to the internet using GSM Modem using kppp or wvdial (see this) until I could browse anywhere. I got IPĀ 10.15.33.107 through ppp0 device.
2. Activate the Laptop’s WiFi then it directly connected to Wireless HUB and got IP 192.168.1.61 through wlan0 device. Until now, we haven’t connect both network yet (10.15.33.107 & 192.168.1.0)
3. To connect both network, I created a route to 192.168.1.0 network :
# sudo route add -net 192.168.1.0 netmask 255.255.255.0 dev wlan0
4. Now, I have connect both network, I can ping to my WiFi HUB :
$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.94 ms
— 192.168.1.1 ping statistics —
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.947/2.947/2.947/0.000 ms
5. The next step is, let the laptop become a gateway for the PC.
$ sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
$ echo 1 > /proc/sys/net/ipv4/ip_forward
6. The last, set gateway from the PC to laptop (I got 192.168.1.61 in my wlan0)
PC$ sudo route add default gw 192.168.1.61
7. done !

October 5, 2008 at 6:41 pm
Please document this somewhere on official Ubuntu forums. If tried on other distros, it will be good.
October 5, 2008 at 7:11 pm
Hi, Harshad Joshi.
Thank you for step by and also for commenting, I’m glad to do your suggestion, that’s sound good.
regards.
November 10, 2008 at 11:25 am
ini blognya bang Toosa toh….(he..he..)