Once upon a time, when I try to use modem on my office’s computer (which is connected by Local Area Network cable), I’m unable to connect to the internet through modem devices. After some investigation, Maybe the routing algorithm didn’t set properly.
I’m an ubuntu user, so I start with “route” command to print the routing process (connected to LAN only).
root@silver-knight:/home/denbagus# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.35.0 * 255.255.255.0 U 1 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth0
default 172.16.35.1 0.0.0.0 UG 0 0 0 eth0
As you can see on the highlighted line (6th), it’s the route to connect to the internet.
When I connect the dongle without LAN, Routing table displayed as below
root@silver-knight:/home/denbagus# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Iface
172.19.128.168 * 255.255.255.255 U 1 ppp0
default * 0.0.0.0 U 0 ppp0
Please see the highlighted line, as you can see, it use ppp0 device. So I connect both LAN and dongle, after that I modify the route table with command below
root@silver-knight:/# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Ifce
172.19.128.168 * 255.255.255.255 UH 0 0 ppp0
172.16.35.0 * 255.255.255.0 U 1 0 eth0
link-local * 255.255.0.0 U 1000 0 eth0
default 172.16.35.1 0.0.0.0 UG 0 0 eth0
root@silver-knight:/# route del default
root@silver-knight:/# route add -net default netmask 0.0.0.0 dev ppp0
root@silver-knight:/# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Ifce
172.19.128.168 * 255.255.255.255 UH 0 0 0 ppp0
172.16.35.0 * 255.255.255.0 U 1 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0
Tada…. That’s the configuration.
I Have some additional information. When I connect through wlan, route process displayed below
Destination Gateway Genmask Flags Metric Ref Iface
172.16.64.0 * 255.255.252.0 U 2 0 wlan0
link-local * 255.255.0.0 U 1000 0 wlan0
default 172.16.64.1 0.0.0.0 UG 0 0 wlan0
FYI, my PC client IP is 172.16.35.97. I need to remote this PC. So I add and delete route process with following command:
route add -net 172.16.35.0 gw 172.16.64.1 netmask 255.255.255.0 dev wlan0
route delete default
After that, I connect the modem. Route process changed as displayed below:
root@silver-knight:/home/denbagus# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Iface
172.19.129.96 * 255.255.255.255 UH 0 0 ppp0
172.16.35.0 172.16.64.1 255.255.255.0 UG 0 0 wlan0
172.16.64.0 * 255.255.252.0 U 2 0 wlan0
link-local * 255.255.0.0 U 1000 0 wlan0
default * 0.0.0.0 U 0 0 ppp0
Thanks God it’s working
Best Regards,
Nugroho Priambodo
http://priambodo.org
mail@priambodo.org