maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Bridging wifi (https://talk.maemo.org/showthread.php?t=90720)

optimaxxx 2013-07-13 13:50

Bridging wifi
 
I have a raspberry pi, and as you or may not know, the pi doesn't support wifi.

Been googling to no avail, everyboy just wants to use that 3g, but all I want is that wifi.


Is there any way to turn my N900 into a wifi dongle for my pi?

Cheers

optimaxxx 2013-07-14 01:44

Re: Bridging wifi
 
Or even if you can do it with an N9?

Halftux 2013-07-14 21:18

Re: Bridging wifi
 
It is possible with both but easier with N900 I will make a tutorial in the next days. At the moment I am pretty busy.

PWN900 2013-07-14 21:25

Re: Bridging wifi
 
I believe if you should search " how to tether the raspberry pi" you might find some usefull tutorial or something. Does the raspberry pi recognize the n900 when you plug it in?

optimaxxx 2013-07-16 08:13

Re: Bridging wifi
 
the issue is, all those tutorials just bridge usb > 3g

I need usb > wifi

Halftux 2013-07-17 18:06

Re: Bridging wifi
 
I hope I did understand you right.

Here a small example that it looks like your rasperry pi is connected to the wlan:

Requirements:
N900 with iptables (powerkernel)

Assuming your networks are:

Wlan 192.168.1.x
USB 192.168.2.x

PC in wlan network 192.168.1.10
N900 in wlan 192.168.1.14 and usblan 192.168.2.15
raspberry pi (RPI) in usblan 192.168.2.14

PC
Code:

route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.14 dev wlan0
N900
Code:

route delete default

iptables -t nat -A PREROUTING -s 192.168.1.0/16 -i wlan0 -j DNAT --to-destination 192.168.2.15

iptables -t nat -A PREROUTING -s 192.168.2.0/16 -i usb0 -j DNAT --to-destination 192.168.1.14

When you want to use only the local lan (no internet), you don't need the iptable rules. Instead you can activate forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forwarding


RPI
Code:

route add default gw 192.168.2.15 dev usb0
When you need internet don't forget to add a DNS.


All times are GMT. The time now is 20:21.

vBulletin® Version 3.8.8