Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ### KILL EXISTING ###
- service dnsmasq stop
- killall dnsmasq
- service hostapd stop
- killall hostapd
- ifconfig wlan0 down
- ### HOSTAPD CONFIGRATION ###
- CAT <<EOF > /etc/hostapd/hostapd.conf
- interface=wlan0
- enable_karma=1
- driver=nl80211
- hw_mode=g
- channel=1
- ssid=rPI Karma WiFi API
- EOF
- ### DNSMASQ CONFIGURATION ###
- cat <<EOF > /etc/dnsmasq.conf
- interface=wlan0
- log-facility=/var/log/dnsmasq.log
- log-queries
- no-resolv
- dhcp-range=10.10.10.10,10.10.10.250,12h
- server=8.8.8.8
- server=8.8.4.4
- EOF
- ### INTERFACE SETUP ###
- ifconfig wlan0 up
- ifconfig wlan0 10.10.10.1/24
- ### IPTABLES NAT FORWARDING ###
- iptables --flush
- iptables --table nat --flush
- iptables --delete-chain
- iptables --table nat --delete-chain
- iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
- iptables --append FORWARD --in-interface wlan0 -j ACCEPT
- sysctl -w net.ipv4.ip_forward=1
- ### START PROCESSES ###
- service dnsmasq start
- service hostapd start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement