Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Raspberry Access Point Setup

Reference

Commands

  • lsusb - list usb device
  • iwlist - list wifi

Installation

Dependencies
$ sudo apt-get update
$ sudo apt-get dist-upgrade 
$ sudo apt-get install -y cmake git-core zsh tmux vim-nox bridge-utils hostapd dnsmasq nginx iw slstrip
oh-my-zsh
# Install oh-my-zsh
$ sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# Change current shell to zsh
$ sudo chsh -s $(which zsh)


# Download `doubleend.zsh-theme` theme
# After download, update .vimrc
$ sudo curl -o ~/.oh-my-zsh/themes/doubleend.zsh-theme https://gist.githubusercontent.com/ralphcrisostomo/4a884751c9d9e98fab12/raw/839f35012db28e36d45b0d15d5b5066dc64e4cf1/doubleend.zsh-theme

# Update .zshrc theme
ZSH_THEME="doubleend"

# Restart
$ sudo shutdown -r now
tmux

TL-WN823N

curl -O http://fichiers.touslesdrivers.com/39144/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip

sudo mv RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip /tmp
cd /tmp
sudo unzip RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip
sudo rm RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip
sudo tar -xvf RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8_rtw_r7475.20130812.tar.gz
sudo rm -rf RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911
cd wpa_supplicant_hostapd-0.8_rtw_r7475.20130812
cd hostapd
sudo make

sudo cp /usr/sbin/hostapd /usr/sbin/hostapd.bak
sudo cp -p hostapd /usr/sbin/hostapd
sudo chown root.root /usr/sbin/hostapd
sudo chmod 755 /usr/sbin/hostapd

sudo cp /usr/sbin/hostapd_cli /usr/sbin/hostapd_cli.bak
sudo cp -p hostapd_cli /usr/sbin/hostapd_cli
sudo chown root.root /usr/sbin/hostapd_cli
sudo chmod 755 /usr/sbin/hostapd_cli

hostapd

Create hostapd.conf /etc/hostapd/hostapd.conf

interface=wlan0
driver=rtl871xdrv
ssid=NotFreeWifi
channel=1
hw_mode=g
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0

We also need to tell hostapd where to find this config file /etc/init.d/hostapd

DAEMON_CONF=/etc/hostapd/hostapd.conf

dnsmasq

Update dnsmasq.conf /etc/dnsmasq.conf

log-facility=/var/log/dnsmasq.log
address=/#/10.0.0.1
interface=wlan0
dhcp-range=10.0.0.10,10.0.0.250,12h
no-resolv
log-queries

Network

Update network interface /etc/network/interfaces

~
~
                                                                                                                                                                1,1           All
#
# LOOPBACK
#
auto lo
iface lo inet loopback

#
# ETH0
#
auto eth0
iface eth0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255

#
# WIFI
#
wireless-power on

#
# WLAN0
#
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 10.0.0.1
netmask 255.255.255.0

#
# WIFI1
#
auto wlan1
allow-hotplug wlan1
iface wlan1 inet static
address 192.168.1.21
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

wpa_supplicant

Edit /etc/wpa_supplicant/wpa_supplicant.conf

network={
ssid="PLDTMyDSL"
psk="********"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment