Wednesday, January 13, 2016

The Worst Way to Extend WiFi



Let's say you have a wifi point, and you're "borrowing" the wifi. But it's like way to far away, and you don't want to make a custom antannae or you can't afford one.

I plugged the Etek wireless usb adapter into a powered usb hub, hooked it up to a raspberry pi. I run an ethernet cord from the raspberry pi to my computer, running masquerading through iptables.


Here is my /etc/network/interfaces file:

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

    address 192.168.2.1

    netmask 255.255.255.0

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

Here is my /etc/network/if-up.d file:

#!/bin/sh

echo “1” > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

Here is my wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

network={

        ssid=“home-f901f82d28-Wireless”

        psk=“neighborspassword1”

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=TKIP

        group=TKIP WEP104 WEP40

        auth_alg=OPEN

}

network={

        ssid=“HOME-213C”

        psk=“neighborspassword2”

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=TKIP

        auth_alg=OPEN

}

It’s interesting to note that neighborspassword1 is a common word, then a two digit number and two is a phone number with a local area code.

No comments: