Advertisement
lukicdarkoo

CosmicPi AP configuration script

May 20th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.02 KB | None | 0 0
  1. # Configure AP mode
  2. # This configuration is based on CosmicPi 1.5 software
  3. # We do not need it as we now have, shiny, new script that configures AP and client Wifi mode
  4. # I will leave this piece of code commented, for a while, as a fallback
  5. # Populate `/etc/dnsmasq.conf` file
  6. sudo bash -c 'cat > /etc/dnsmasq.conf' << EOF
  7. interface=wlan0
  8.   dhcp-range=192.168.12.50,192.168.12.150,255.255.255.0,24h
  9.  
  10.   address=/apple.com/192.168.12.1
  11.   address=/appleiphonecell.com/192.168.12.1
  12.   address=/airport.us/192.168.12.1
  13.   address=/akamaiedge.net/192.168.12.1
  14.   address=/akamaitechnologies.com/192.168.12.1
  15.   address=/microsoft.com/192.168.12.1
  16.   address=/msftncsi.com/192.168.12.1
  17.   address=/msftconnecttest.com/192.168.12.1
  18.   address=/google.com/192.168.12.1
  19.   address=/gstatic.com/192.168.12.1
  20.   address=/googleapis.com/192.168.12.1
  21.   address=/android.com/192.168.12.1
  22. EOF
  23.  
  24. # Populate `/etc/dhcpcd.conf` file
  25. sudo bash -c 'cat > /etc/dhcpcd.conf' << EOF
  26. hostname
  27. clientid
  28. presistent
  29. option rapid_commit
  30. option domain_name_servers, domain_name, domain_search, host_name
  31. option classless_static_routes
  32. option interface_mtu
  33. option ntp_servers
  34. require dhcp_server_identifier
  35.  
  36. slaac private
  37.  
  38. profile static_wlan0
  39. static ip_address=192.168.12.1
  40. static routers=192.168.12.1
  41. static domain_name_servers=192.168.12.1
  42.  
  43. interface wlan0
  44. fallback static_wlan0
  45. EOF
  46.  
  47. # Populate `/etc/create_ap.conf` file
  48. git clone https://www.github.com/oblique/create_ap /tmp/create_ap --depth 1
  49. sudo make -C /tmp/create_ap install
  50. sudo systemctl enable create_ap
  51.  
  52. sudo bash -c 'cat > /etc/create_ap.conf' << EOF
  53. CHANNEL=default
  54. GATEWAY=10.0.0.1
  55. WPA_VERSION=2
  56. ETC_HOSTS=0
  57. DHCP_DNS=gateway
  58. NO_DNS=0
  59. NO_DNSMASQ=0
  60. HIDDEN=0
  61. MAC_FILTER=0
  62. MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
  63. ISOLATE_CLIENTS=0
  64. SHARE_METHOD=none
  65. IEEE80211N=0
  66. IEEE80211AC=0
  67. HT_CAPAB=[HT40+]
  68. VHT_CAPAB=
  69. DRIVER=nl80211
  70. NO_VIRT=1
  71. COUNTRY=
  72. FREQ_BAND=2.4
  73. NEW_MACADDR=
  74. DAEMONIZE=0
  75. NO_HAVEGED=0
  76. WIFI_IFACE=wlan0
  77. INTERNET_IFACE=
  78. SSID=CosmicPi
  79. PASSPHRASE=
  80. USE_PSK=0
  81. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement