Thread
:
N900 as a wireless modem router
View Single Post
allnameswereout
2009-11-13 , 05:29
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#
4
Ahh yes. You mean something like Joikuspot. That feature is rather often requested but AFAIK nobody tried this yet, and there is not a nice GUI for this either. However the functionality is relatively simple and straightforward. Once I have the device I will write about this on the Maemo wiki. However, the solution will involve again command line interface. Maybe someone will write a GUI for this some time.
How well this works depends on if the WiFi driver can be put in Access Point/Master mode. If that doesn't work, you need ad-hoc. This means only 1 device, and WiFi PSM (Power Save Mode) will be disabled which means the device will use considerable juice. Like with Joikuspot. Actually, using both GPRS and WiFi will lower battery life significantly. There is also no encryption used between devices when using ad-hoc. It only supports plain-text or WEP. If the WiFi driver supports putting the WiFi chip in Access Point/Master mode then that is a big plus.
So first the WiFi interface must be set up correctly using iwconfig and ifconfig.
Once the connection is established do this to enable NAT on wlan0 from 192.168.0.0/24 (aka 192.168.0.*) execute as root:
ifconfig wlan0 192.168.0.1 netmask 255.255.255.0 # assign IPv4 192.168.0.1 for range 192.168.0.0/24
sysctl net.ipv4.ip_forward=1 # enable device-wide IPv4 forwarding
modprobe ip_tables # load IPT (IPTables) kernel module
modprobe iptable_nat # load IPT NAT kernel module
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -i wlan0 -o ppp0 -j MASQUERADE # NAT for dynamic IPv4 on output interface ppp0 from input interface wlan0 from source range 192.168.0.0/24
Then give client IPv4 192.168.0.2 (for example, or anything inbetween .2 and .254), netmask 255.255.255.0, gateway 192.168.0.1, and dns your provider's. Now should work. Optionally, fire up VPN client because of lack of good cryptography.
Ofcourse, best is AP/Master mode + WPA2 + DHCP server (exporting dnsmasq on WLAN)...
Assigning IPv6 range + rtadvd is also neat...
__________________
Goosfraba!
All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!
Quote & Reply
|
The Following 3 Users Say Thank You to allnameswereout For This Useful Post:
edgar2
,
thinh
,
UCOMM
allnameswereout
View Public Profile
Send a private message to allnameswereout
Find all posts by allnameswereout