Mittwoch, 18. März 2015

WOW-TO convert a RaspberryPi 2 B into a standalone AP with REALTEK [EDIMAX] CHIP

WOW-TO convert a RaspberryPi 2 B into a standalone AP with REALTEK [EDIMAX] CHIP



Here is a short summary of all the commands (cooking-book like) without any of the comments above. So if you succeeded once, don’t care about comments, just do the essential work now:



sudo bash
sudo apt-get update && sudo apt-get upgrade -f && sudo apt-get dist-upgrade
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get install git
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
sudo reboot
sudo apt-get install isc-dhcp-server
sudo apt-get autoremove hostapd
wget https://github.com/jenssegers/RTL8188-hostapd/archive/v2.0.tar.gz
tar -zxvf v2.0.tar.gz
cd RTL8188-hostapd-2.0/hostapd
sudo make
sudo make install
sudo service hostapd restart
sudo nano /etc/dhcp/dhcpd.conf
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;
authoritative;
subnet 10.10.10.0 netmask 255.255.255.0
{
range 10.10.10.20 10.10.10.80;
option broadcast-address 10.10.10.255;
option routers 10.10.10.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local-network";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}

sudo nano /etc/default/isc-dhcp-server
INTERFACES="wlan0"
sudo nano /etc/network/interfaces
iface wlan0 inet static
address 10.10.10.10
netmask 255.255.255.0
#iface wlan0 inet manual
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
sudo nano /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo ifup wlan0
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
sudo service isc-dhcp-server start
sudo service hostapd start
sudo update-rc.d hostapd enable
sudo update-rc.d isc-dhcp-server enable
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
sudo nano /etc/network/interfaces
up iptables-restore < /etc/iptables.ipv4.nat
sudo nano /etc/rc.local
sleep 10 && service hostapd restart
sudo reboot



Keine Kommentare:

Kommentar veröffentlichen

comments are moderated, to prevent spam and trolls: