Advertisement
D0cEvil

Linux - Create WIFI access point

Sep 19th, 2022
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.95 KB | None | 0 0
  1. ################ap-start.sh################
  2.  
  3. #!/bin/sh
  4. ifconfig wlan0 172.16.0.1
  5. service dnsmasq restart
  6. sysctl net.ipv4.ip_forward=1
  7. iptables -t nat -A POSTROUTING -j SNAT -s 172.16.0.0/24 -d  0.0.0.0/0 --to aaa.bbb.ccc.ddd # IP, на который подменяем (адрес выходной сетевухи.)
  8. # Starting WIFI hotSpot
  9. hostapd /etc/hostapd/hostapd.conf
  10.  
  11. ################hostapd.conf################
  12.  
  13. #Name:Default
  14. #Type:Hostapd
  15. interface=wlan0
  16. driver=nl80211
  17. ssid=ololo.wifi
  18. country_code=BO
  19. hw_mode=g
  20. channel=6
  21. logger_syslog=-1
  22. logger_syslog_level=2
  23. logger_stdout=-1
  24. logger_stdout_level=2
  25. debug=0
  26. macaddr_acl=0
  27. ignore_broadcast_ssid=2
  28. wpa=3
  29. wpa_key_mgmt=WPA-PSK
  30. wpa_pairwise=TKIP CCMP
  31. wpa_passphrase=$up3r$3crEtM3gAP@ssw0rD # ;-)
  32.  
  33. ################dnsmasq.conf################
  34.  
  35. #Name:Default
  36. #Type:DNSMASQ
  37. interface=wlan0
  38. dhcp-range=172.16.0.2,172.16.0.254,8h
  39. domain-needed
  40. bogus-priv
  41. interface=eth0
  42. server=8.8.8.8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement