Using a Raspberry Pi as a WiFi repeater
Uncategorized June 8th, 2013I don't have internet, argh!
The things a person would do for WiFi
Running airmon learns me that there are 20+ discoverable networks in the neighbourhood. Too bad that they're all WPA2-protected, of VERY poor signal strength, and have no detectable associated clients. People in France have some special modemrouters that are called livebox'es and freebox'es. They are WPA2 protected by default with insane passwords like 9997AD9E3E13A6DD79E6C77241. This is a 26-character hex string: it makes me wonder if this password is some sort of hash of a few customer specific properties (eg. client ID) rather than being randomly generated. Anyhow, even if I manage to capture a WPA handshake, I would still need a dictionary with 16^26 entries (4.36e+22) in order to crack it succesfully (provided that that person hasn't changed the login). Hypothetically of course, because WiFi hacking is illegal.
Mind you: of course I went knocking next door, but I couldn't find someone with an AP that is reachable by me. Except for Bart's ... Â strangely I'm still able to capture his WiFi although he lives in a different wing of the residence... And by "being able to capture" I mean taking the laptop in my hands, go stand at the doorstep about 6 meters away from my desk, and tilt it in the right direction.
Don't throw away old hardware
When it comes to technical devices, I'm a hoarder. It might be the only good explanation why I brought my old HTC HD2, my old Nokia 3120c, a Raspberry Pi, and an old D-link DI-524 with me to France. Knowing that I can capture WiFi at the doorstep, I was thinking how I could use all of those things to make some sort of WiFi repeater so I could access Bart's internet at my desk.
I tried a few setups:
WiFi → HD2 → Bluetooth → Laptop
The HTC HD2 captures the WiFi signal at the doorstep, and has a bluetooth DUN server running (BlueDUN). I would then be able to connect my laptop using bluetooth to the HD2. Sadly the desk was too far away for bluetooth to work fast and reliable.
WiFi → HD2 → USB → Raspberry Pi → Ethernet → DI-524 → WiFi → Laptop
The HTC HD2 captures the WiFi signal at the doorstep, is connected via USB to the Raspberry Pi. Then the Raspberry Pi is connected via Ethernet to the old D-link router, which I will connect to via WiFi. Sadly the old D-link router didn't appear to work anymore (it sort of did until I put it in a different subnet, but now all of a sudden it won't boot anymore, can't be reset anymore, and basically turned into a piece of garbage).
Since the DI-524 was dead, I connected the Raspi directly to my laptop via Ethernet. Now how does this setup work?
WiFi → HD2 → USB → Raspberry Pi → Ethernet → Laptop
Setting up the devices
The HTC HD2 still had a WP7 ROM on it. Since I know my way a bit better with Android, I flashed it a NAND ROM called "Sense of Eclipse".
After booting it up, native USB tethering seemed to be not working.
I tried a  different approach: a tool called Azilink, which is basically an implementation of an OpenVPN server for Android. I would have to run the OpenVPN client on my laptop, while tunneling the connection through the RasPi. The RasPI needed an ARM-compiled version of the Android debugging tool "adb" (you may find a precompiled binary at XDA). Surprisingly, the RasPi had no trouble recognizing the USB device, and I was able to forward the tcp ports. Sadly Azilink crashed each time after succesfully tunneling a few 100 bytes.  Their bugtracker on google code is full of messages, but they all remained unanswered.
So for a few days I had a working solution:
On the HD2, there was a SOCKS proxy server running on port 5555. Again with the adb-tool from XDA, I executed "adb forward tcp:5555 tcp:5555". This would make the proxy server port locally available on the Raspberry Pi on port 5555. I was now able to connect from my laptop using SSH "ssh -L5555:localhost:5555". Now all that is left, is making the browser use the SOCKS server at localhost port 5555.
Using Proxifier or SocksCap (which forces all your connections to go through the proxy), it becomes a bit easier. I still didn't have UDP though
Although I had internet now, it remained a pain to be bound by the Ethernet cable: I wasn't able to sit at my desk. The easy solution may be buying an extra Ethernet cable, but I decided to buy a WiFi dongle from LDLC instead that can be put into access point mode. I bought the D-link DWA-121, which is a dongle that is said to work with the Raspberry Pi.
A WiFi repeater
WiFi → HD2 → USB → Raspberry Pi → (USB) WiFi
Now we arrive at the real thing: an actual WiFi repeater.
First of all, I installed a new ROM on the HD2 that had working native USB tethering (NexusHD2-CM9). This way, I would be able to eliminate the SOCKS server and turn the Raspberry Pi into a WiFi router. Running speed tests on the HD2 now showed that the WiFi connection was wonky. I couldn't find the "Improve Wi-Fi performance" mode in the settings, so installed an app from the market called "WIFI High Performance". This improved WiFi latency and speeds drastically. I now enabled native USB tethering.
Using the adb shell, I found out that USB tethering was enabled on a new subnet 192.168.42.0/24, with the HD2 having 192.168.42.129 as IP.
root@raspberrypi:/home/pi# adb shell * daemon not running. starting it now on port 5037 * * daemon started successfully * # ip route 192.168.1.1 dev wlan0 scope link 192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.17 metric 314 192.168.42.0/24 dev usb0 proto kernel scope link src 192.168.42.129 default via 192.168.1.1 dev wlan0
With the WiFi dongle plugged in, and with the newly available usb interface on the Raspberry Pi, I had the following interfaces available:
root@raspberrypi:/home/pi# ifconfig -s | cut -d' ' -f1 | tr '\n' ',' | sed 's/,\(.*\),$/s: \1\n/' Ifaces: eth0,lo,usb0,wlan0
With usb0 being the connection to the HD2 and wlan0 being the WiFi dongle, I had to make some modifications to the /etc/network/interfaces file:
auto lo iface lo inet loopback
auto eth0 iface eth0 inet static address 192.168.15.1 # For if I need to connect via Ethernet to the Raspi again netmask 255.255.255.0
iface wlan0 inet static address 192.168.60.1 # Wireless clients netmask 255.255.255.0
allow-hotplug usb0 iface usb0 inet static address 192.168.42.130 gateway 192.168.42.129 # IP of the HD2 netmask 255.255.255.0 up sysctl -w net.ipv4.ip_forward=1 up route add default gw 192.168.42.129 dev usb0
That is actually my whole file. I removed the gateway from eth0, so it would take the gateway to the usb0 device instead. It needs IP forwarding to be enabled as well, so I added that to the ifup command (net.ipv4.ip_forward=1). I removed all other directives from the wlan0 configuration as well.
I now set up "hostapd" which is a package that will allow to use the dongle in AP mode. My /etc/hostapd/hostapd.conf looks as follows:
interface=wlan0 driver=rtl871xdrv ssid=PirateAP hw_mode=g channel=3 macaddr_acl=0 auth_algs=3 wmm_enabled=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=piratesown wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP beacon_int=100
It needs a bit more set up than that (read the full tutorial on elinux). I needed a modified binary of hostapd as well. I configured udhcpd (a micro dhcp daemon) to use the subnet 192.168.60.0/24 as shown above in the interfaces file.
Somehow I wasn't able to connect to the RasPi via WiFi. The connection got aborted each time. After debugging, I found out that wpa_supplicant was still active (though it shouldn't be, because the WiFi dongle is in host mode, and not in client mode). I decided to remove the wpasupplicant package altogether so it wouldn't cause me any more problems.
After that, I added the following rules to iptables, to take care of the routing between the different devices:
iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE iptables -A FORWARD -i eth0 -j ACCEPT iptables -A FORWARD -i wlan0 -j ACCEPT
The RasPi is now behaving as a router 🙂 !
If you're going to be setting this up yourself, you're gonna have to find a way to get the packages installed on your RasPi first (adb, hostapd udhcpd).
August 26th, 2013 at 3:18 pm
Tethering allows a user to connect a device, like the HTC Thunderbolt, to another device such as a laptop and have internet connection via the wireless service. The proliferation of the Web as the primary means of Internet communication and content delivery is the key to understanding why hackers so frequently focus on the Web for their attacks. How often do you take your Mac - Book Pro or your Galaxy Nexus to that trendy coffee shop around the corner to get on their hotspot to get some work done.
October 6th, 2013 at 3:08 pm
Is it possible to do this with the Raspberry Pi only?
November 1st, 2013 at 6:56 pm
It is possible if you get two Wi-Fi USB sticks. You can put one in AP mode, while the other one is in client mode forwarding the traffic.
July 4th, 2014 at 6:16 pm
I am trying to do something similar, but want the Raspberry Pi to connect to a wifi signal with a USB network adapter and then feed via CAT5 cable to my computer. I intend to place the Pi in an elevated location and use a 7.62 meter length of ethernet cable to connect my computer. Can you describe how to set this up?
November 15th, 2014 at 11:40 am
Salts are an effective storage medium as a result of they are low-cost, have a high particular
heat capacity and might deliver heat at temperatures compatible with typical power methods.
Information similar to this Electrical energy From Sunlight will assist you to
uncover How Rapidly And Simply you can Discover The Secrets Of Being Ready To Generate FREE Power On Command Magniwork Free
News will show you every little thing. All of it revolves around the energy of the unconscious thoughts.
January 7th, 2015 at 4:09 am
Interesting articles you post on your blog, i have shared this post on my facebook
January 12th, 2015 at 1:56 am
thank you
February 28th, 2015 at 3:00 am
Hi admin, your website is incredible i know very useful tool for every webmaster (for
content creation and SEO). Just search in google for:
Stoonkel's Rewriter
May 13th, 2015 at 2:01 am
Magnificent beat ! I wish to apprentice even as you amend your web site, how
can i subscribe for a blog website? The account helped me
a appropriate deal. I were tiny bit acquainted of
this your broadcast provided bright clear idea
August 6th, 2015 at 9:28 pm
Many Internet-provider-supplied wireless routers in the UK have "random" passswords like the one in your example. Your theory that these are a hash of something known has proved to be correct in at least one instance. I understand that, to avoid the provider having to transfer, track and potentially lose passwords and keys for large populations of boxes that is/was common for the key to be generated using a hash from the WiFi router's promary MAC address when it is facory reset. The provider has a piece of software that they can use to do this in-house.
One large provider got caught out with this when somebody worked out they could connect a JTAG or serial port to the boards in the routers and get them back into "factory mode" where the router config could be erased and the MAC could be set as if it was just coming off the production line.
People started recording the MAC of the router they wished to log into and working out from the MAC which of the couple of models the provider supplied the router was. They then purchased an identical-model used router off eBay. Once they had the eBay router, they connected to the board inside, put it into factory mode then changed its MAC to match the one of the router they wanted to log into. Once this was done, they did a user factory-reset on the new router which caused all its settings, including the Wi-Fi security to return to default. Most users never change their router's default Wi-Fi password. It was then just a matter of logging into the new router's web interface using a wired Ethernet connection with the default admin password (the same for all their routers), going to the wireless security tab and the password the new router had set for itself was the same as the one the target router came out the box with.
The provider ended up having to write to all their customers and advise them to change the default Wi-Fi password.
March 1st, 2016 at 8:12 pm
I pay a visit daily some websites and blogs to read posts, but this website offers quality based
content.
March 7th, 2016 at 10:19 am
I've been exploring for a bit for any high quality articles or blog posts on this sort of house .
Exploring in Yahoo I ultimately stumbled upon this site.
Reading this information So i'm glad to convey that
I've an incredibly good uncanny feeling I found out exactly what I needed.
I so much no doubt will make certain to don?t omit this site and
provides it a glance on a relentless basis.
May 8th, 2016 at 8:59 am
Pretty enlightening, look forward to visiting again
May 8th, 2016 at 11:37 pm
That is the dominant characteristic that controls persona.
Themes, use and application are offered.
May 19th, 2016 at 3:02 pm
TҺere іs ϲertainly ɑ llot tо learn аbout
thiÑ• subject. I love aâ…¼l the Ïoints you ɦave mÉ‘de.
May 29th, 2016 at 12:00 am
Sorry for the essay, would possibly as nicely rely
this as my mini evaluate of TSOHost too.
June 20th, 2016 at 8:32 am
thnx for sharing this nice website
June 20th, 2016 at 8:32 am
Passion the site-- very individual pleasant and whole lots to see!
June 22nd, 2016 at 5:26 pm
So you’re running Java, huh? God help you.
June 26th, 2016 at 10:10 am
Before they know it, the wedding is a week away and they still need to find a DJ, a
photographer, and they haven't quite decided on their centerpieces.
I'm sure that, by now you have understood that you can't rest in peace after handing over the responsibility of arranging thee wedding to wedfing
planners, so don't forget to geet out that old yoga mat you have and de-stress att times.
A photographer's wage or salary iis simply
a slice of the whle pie.
October 31st, 2016 at 9:26 am
Great delivery. Soumd arguments. Keepp up the great spirit.
November 6th, 2016 at 1:07 pm
Many thanks, this site is extremely helpful
November 29th, 2016 at 2:21 pm
Le sol en résine est un sol plastique, à l'instar des sols en PVC Il s'agit d'un revêtement de sol
qui a longtemps été utilisé dans les entreprises et
les lieux publics, mais il s'invite de plus en plus chez le
particulier.
April 24th, 2017 at 9:24 am
Hi,
I'm wondering if it would be possible for you to make http://services.ce3c.be/ciprg a little bit more api friendlier for websites? By adding both secure certificate (ssl/https) and also append the `Access-Control-Allow-Origin: *` header so that it can be accessible from 3th party websites making ajax request
best regards
Jimmy
August 27th, 2018 at 9:25 pm
Hi,
Thank you very much for sharing the information on your website, this site has helped me a lot but I have noticed that they have not updated it yet, friend could you help us by updating the information.
Best regards
Enrique
November 27th, 2018 at 12:12 pm
Every weekend i used to visit this website, as
i wish for enjoyment, foor the reason thatt this this
web page conations in fact fastdious funny material too.
January 31st, 2019 at 5:05 am
This info is invaluable. Howw can I find ouut more?
March 23rd, 2019 at 6:22 am
Valuable info. Fortunate me I discovered your site by accident, and
I'm shocked why this accident didn't came about in advance!
I bookmarked it.
April 1st, 2019 at 3:19 pm
Many businesses use an application to person messaging by SMS gateways for swift mass communication. The gateway acts as a feed relay, translating one protocol into another. Wireless network operators use SMS gateways to connect SMS centers. An SMSC is the fraction of a wireless network that manages SMS operations, such as routing, forwarding and storing incoming text messages to recipients.
April 18th, 2019 at 12:53 am
Selon les plus récentes rumeurs, le constructeur mobile Huawei va sortir son portable souple avant apple
et samsung longuement utiles, les smartphones pliables sont
à présent une réalité mais quel modèle de mobile flexible choisir ?
Guide d'Achat 2019 des bons téléphones portable
avec Écran souple. après plusieurs mois de folles rumeurs,
Samsung a dévoilé son portable souple Galaxy Fold.
longuement côtés, les téléphones portable pliables sont maintenant une
réalité. https://zik-miki.fr/smartphone-pliable/
June 10th, 2019 at 3:33 pm
vous désirez un local personnalisé à louer de maniere securisée en Suisse ?
Easystock offre des offres d’emmagasinage pour les sociétés et les particuliers avec des
container allant de 1m² à 20m².
June 17th, 2019 at 7:36 pm
It's remarkable to visit this web site and reading the views of
all friends concerning this paragraph, while I am also keen of getting
knowledge.
June 17th, 2019 at 7:57 pm
Bersama dengan agen Large Poker88, sudah pasti kalian akan mendapatkan pelayanan terbaik.
Sebagai agen poker on the web terpercaya, kami
juga memberikan kemudahan dalam daftar massive poker88
on the internet untuk calon member. Ada banyak kelebihan dalam
Agen poker deposit 10000 ini.
July 5th, 2019 at 12:10 pm
Hello
You Need Leads, Sales, Conversions, Traffic for ce3c.be ?
I Will Findet...
Don't believe me? Since you're reading this message then you're living proof that contact form advertising works!
We can send your ad to people via their Website Contact Form.
The advantage of this kind of promotion is that messages sent through feedback forms are automatically whitelisted.
I WILL SEND 5 MILLION MESSAGES VIA WEBSITE CONTACT FORM
SEE MORE HERE ==> http://bit.ly/Best_Method
Do not forget to read Review to convince you, is already being tested by many people who have trusted it !!
Regards,
feedback team
unsubscribe by reply this email
October 10th, 2019 at 12:59 am
aXPlDZTcHd
November 1st, 2019 at 3:47 pm
In addition, an added advantages in this site are that no
gambling is allowed about this site. Many adventurous slots can be found in these online gaming platforms.
5 Card Slingo Deluxe is an exciting game that combines rapid paced enjoyment
of Slingo with strategic poker playing action.
November 29th, 2019 at 7:55 am
Hello,
TIRED OF WAITING FOREVER TO EARN A PROFIT ONLINE ?
My name is Aaron Maughan and I’m talking about a new way to generate quick traffic and sales in ANY niche with ZERO video/website creation, ZERO paid advertising/SEO.
I’ve recently tried this product but quickly decide to write this review because I know this is exactly what you are looking for your ce3c.be
No Previous Skills Or Experience Required. You can literally be a COMPLETE Newbie and Get RESULTS with just 5 minutes of actual “work”..
SEE FULL REVIEW: http://bit.ly/36OJXNh
Kind Regards,
Aaron Maughan
December 12th, 2020 at 3:35 am
number of surviving European
December 13th, 2020 at 1:46 pm
Kaum zu glauben
January 3rd, 2021 at 3:46 pm
handwritten books were made,
January 7th, 2021 at 10:59 pm
Libraries of the Carolingian era). IN
January 14th, 2021 at 10:14 pm
handwritten by the author.
January 25th, 2021 at 12:47 am
manuscripts significantly
January 25th, 2021 at 9:25 pm
from lat. manus - "hand" and scribo - "I write") [1]
January 26th, 2021 at 4:17 am
from lat. manus - "hand" and scribo - "I write") [1]
January 26th, 2021 at 2:00 pm
XVII century was Nicholas Jarry [fr].
February 4th, 2021 at 6:23 pm
Займ на карту под 0%. С любой кредитной историей.
Помощь в получении кредита · Топ компаний.
Выдача 24/7. Широкий выбор. До 80
000 руб
February 12th, 2021 at 7:14 am
Western Europe also formed