Editing N900 USB router

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
When the only internet link is the [[Nokia N900|N900]], how to connect a laptop to it and use it to connect to the net?
+
= N900 as a USB router =
-
 
+
When the only internet link is the N900, how to connect a laptop to it and use it to connect to the net ? This is the oposite use case of http://wiki.maemo.org/N900_USB_networking.
-
There is two modes for doing this: Using the [[Nokia N900|N900]] as a dumb mobile broadband modem to the phone network, which however will leave the linux system on N900 without connection to internet. Or set up full USB networking between the computer and the N900 using the N900 as a router to whatever network it's connected to (phone, wlan, etc..), which will allow internet access for both N900 and PC concurrently.
+
-
 
+
-
The modem model should be available mostly automatically on most OS'es when you connect the phone over USB (Bluethooth also possible with an addon). Windows may need the PC Suite installed however. This however only works for phone network connections, not wlan connections.
+
-
 
+
-
The other variant using full USB networking support is not enabled in the default USB profile of the N900 and needs some tweaking to be enabled, but once enabled it gives you full network access to both the N900 and connection sharing of whatever Internet connection the N900 currently have (phone, wlan, etc...)
+
-
 
+
== On the N900 ==
== On the N900 ==
-
 
+
/etc/apt/sources.list
-
<ol>
+
deb http://repository.maemo.org/extras-devel/ fremantle free
-
<li>[[Extras-devel#How to activate Extras-devel|Enable extras-devel]]</li>
+
apt-get install iptables
-
<li>Install [http://maemo.org/packages/view/iptables/ iptables] at a [[terminal]] with [[root access]]:<pre>apt-get install iptables</pre></li>
+
http://wiki.maemo.org/Kernel_Power#I...el_from_extras
-
<li>Install [http://maemo.org/packages/view/kernel-power-settings/ kernel-power-settings] (see [[Kernel_Power#Installation_of_the_stable_kernel_from_extras|the detailed installation instructions]]):<pre>apt-get install kernel-power-settings</pre></li>
+
apt-get install kernel-power-settings
-
<li>Setup iptables to allow forwarding:
+
echo 1 > /proc/sys/net/ipv4/ip_forward
-
<pre>
+
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
-
echo 1 > /proc/sys/net/ipv4/ip_forward
+
iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
-
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
+
cat /etc/network/interfaces
-
iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
+
iface usb0 inet static
-
</pre></li>
+
address 192.168.3.15
-
<li>Check the IP address for USB networking:<pre>cat /etc/network/interfaces</pre>
+
netmask 255.255.255.0
-
<pre>
+
ifup usb0
-
iface usb0 inet static
+
-
address 192.168.3.15
+
-
netmask 255.255.255.0
+
-
</pre>
+
-
</li>
+
-
<li>Bring the interface UP:<pre>
+
-
ifup usb0
+
-
</pre>
+
-
</li>
+
-
<li>Start dnsmasq on the usb0 interface to provide DHCP & DNS<pre>
+
-
dnsmasq -I lo -z -a 192.168.3.15 -F 192.168.3.64,192.168.3.127
+
-
</pre>
+
-
</ol>
+
-
 
+
-
Once you have verified this works then you can make the settings permanent by adding the needed commands to /usr/sbin/pcsuite-enable.sh just before "exit 0" line at the end of the file.
+
-
 
+
-
<pre>
+
-
echo 1 > /proc/sys/net/ipv4/ip_forward
+
-
iptables -t nat -F POSTROUTING
+
-
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
+
-
iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
+
-
ifup usb0
+
-
dnsmasq -I lo -z -a 192.168.3.15 -F 192.168.3.64,192.168.3.127
+
-
</pre>
+
-
 
+
-
This will make the needed settings automatically enabled when you select "PC Suite" mode on the N900 when connecting the USB cable.
+
-
 
+
== On the laptop ==
== On the laptop ==
 +
sudo ifconfig usb1 192.168.3.14
 +
sudo route add default gw 192.168.3.15
-
The networking configuration on the PC side should be almost automatic on most OS:es. If needed configure your PC to use DHCP on the USB interface.
 
-
 
-
== For Non-Power Users On Windows ==
 
-
 
-
The [http://www.nokiausa.com/get-support-and-software/software/nokia-pc-suites/compatibility-and-download Nokia PC Suite] also provides this functionality for Windows users. Once it is set up, click on the green globe icon to get started - or you can just run "OneTouchAccess" from the PC Suite program files directory (<code>C:\Program Files\Nokia\Nokia PC Suite 7\</code> by default on Windows XP)
 
-
 
-
Note: Reportedly PC Suite do not provide USB networking as described in this article. Instead it sets up dialup networking over USB, using the phone as a wireless broadband modem. Fine for Internet access, but perhaps not what you want for advanced uses where you want to be able to communicate with the N900 as well, not just Internet.
 
[[Category:Connectivity]]
[[Category:Connectivity]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)