Active Topics

 


Reply
Thread Tools
Posts: 2 | Thanked: 17 times | Joined on Jun 2010
#1
Hi,

Here is how I configured a N900 as a router when connected to my laptop with the USB cable in "PC Suite" mode.

on the N900
/etc/apt/sources.list
deb http://repository.maemo.org/extras-devel/ fremantle free
apt-get install iptables
http://wiki.maemo.org/Kernel_Power#I...el_from_extras
apt-get install kernel-power-settings
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
cat /etc/network/interfaces
iface usb0 inet static
address 192.168.3.15
netmask 255.255.255.0
ifup usb0

on the laptop
sudo ifconfig usb1 192.168.3.14
sudo route add default gw 192.168.3.15
 

The Following 15 Users Say Thank You to loic For This Useful Post:
pelago's Avatar
Posts: 2,121 | Thanked: 1,540 times | Joined on Mar 2008 @ Oxford, UK
#2
Thanks, what a useful first post!

It might be good to put this somewhere on http://wiki.maemo.org/ for better posterity.
 
Posts: 2 | Thanked: 17 times | Joined on Jun 2010
#3
Done, thanks for the advice. http://wiki.maemo.org/N900_USB_router
 

The Following 2 Users Say Thank You to loic For This Useful Post:
danx's Avatar
Posts: 304 | Thanked: 20 times | Joined on Jan 2010 @ irvine
#4
Huh , would like this app if I trusted myself to mess with he x terminal . good job thu.
 
Viqsi's Avatar
Posts: 115 | Thanked: 136 times | Joined on Mar 2008 @ Central Ohio
#5
It's possible to do this with the Nokia PC Suite as well - the "One Touch Access" functionality seems to work with the N900, altho I've only tried it on Windows XP.

Updated the wiki page with a mention of same.
 

The Following 2 Users Say Thank You to Viqsi For This Useful Post:
Posts: 1,378 | Thanked: 1,604 times | Joined on Jun 2010 @ Göteborg, Sweden
#6
Originally Posted by Viqsi View Post
It's possible to do this with the Nokia PC Suite as well - the "One Touch Access" functionality seems to work with the N900
I believe this is a yes and no. Yes, Nokia PC suite allows to connect a PC to the internet using the n900 as a GPRS/HSDPA modem, but I don't find anything allowing use of the n900's wireless card for this purpose.

Ioic's method allows both viz the following code:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
If I am wrong please provide pointers...

ta HA
 
Posts: 17 | Thanked: 0 times | Joined on Jul 2010
#7
In my case I had to use usb0 instead of usb1 in:
sudo ifconfig usb1 192.168.3.14

But works great, thanks!
 
Posts: 2 | Thanked: 2 times | Joined on Jul 2010
#8
Added dnsmasq to the mix and it can fully act as a router servicing both DHCP and DNS to the PC making network connection fully automatic on the PC side.

And to finish it making the setup permanent I added the following in /usr/sbin/pcsuite-enable.sh:

Code:
ifup usb0
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -j MASQUERADE
dnsmasq -I lo -z -a 192.168.2.15 -F 192.168.2.64,192.168.2.127
got the idea of /usr/sbin/pcsuite-enable.sh from a related wiki post.

/etc/network/interfaces is configured like discussed before:

Code:
auto usb0
iface usb0 inet static
        address 192.168.2.15
        netmask 255.255.255.0
        # gateway 192.168.2.14

Last edited by HenrikNordstrom; 2010-07-07 at 19:37.
 

The Following User Says Thank You to HenrikNordstrom For This Useful Post:
Posts: 2 | Thanked: 2 times | Joined on Jul 2010
#9
Wiki page expanded with automatic settings
 

The Following User Says Thank You to HenrikNordstrom For This Useful Post:
Posts: 293 | Thanked: 76 times | Joined on Jan 2008 @ Fremantle, W. Australia
#10
Thanks folks. I just did this with only extras-testing enabled, so it may be wise to removed the advice to enable -devel from the wiki page?

BTW, I previously found usb0: would not work at the same time as a usb or bluetooth PPP connection (/dev/ttyACM0 or rfcomm0) through the N900. Anyone know why?
That would have been better, as the PC gets a public internet address instead of NAT, while still being connected to the n900.
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:19.