If you are living in Germany and you have phone plan covering free Telekom Hotspot usage probably you wondered, like me if its possible to broadcast signal from hotspot to home.
One function that prohibits us from using simple reapeter is the fact that Telekom hotspot has html username/password authentication. The hotspot deuthenticates the user when inactive and when token expires.
The idea is to put 2 WIFI cards into raspberry PI. One will receive signal from hotspot. On another we will configure hostapd and dhcp server to broadacast signal at home. We will write simple script that authenticates user in Telekom hotspot using curl.
Step is to get raspberry PI. I’m using the B+ model that has 4 USB exists and microSD slot.
edit the following files: /etc/hostapd/hostapd.conf, /etc/dhcp/dhcpd.conf, /etc/default/isc-dhcp-server, /etc/network/interfaces:
4. Enable packet forwarding on start by adding the line “net.ipv4.ip_forward=1” to “ /etc/sysctl.conf”
5. Configure IP-Tables(I assume wlan1 is a interface connected to Telekom Hotspot.
1
sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
1
sudo iptables -A FORWARD -i wlan1 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
1
sudo iptables -A FORWARD -i wlan0 -o wlan1 -j ACCEPT
Save the rules:
1
sh -c iptables-save > /etc/iptables.ipv4.nat
Run dhcp server and hostapd:
1
sudo update-rc.d hostapd enable
1
sudo update-rc.d isc-dhcp-server enable
You should be able now to connect to raspberry PI wifi network(wlan0) from home. But no internet yet.
Move to your laptop and perform http Login with your Telekom username and password. In Chrome open console and in a network tab find the post to Telekom gateway.
Click on that request and click “save as curl command” paste the command to a script and save on raspberry.
Then write short script that will check internet connection and if there is no it will reauthenticate. Sth like this