Wireless RasberryPi OpenWRT AP - Deathraymind/StemLabMK2 GitHub Wiki
Materials Needed:
- RaspberryPi
- RaspberryPi Power Cable or USB to USB Mini
- MicroSD Card
- MicroSD Card Reader
- Ethernet Cable
- Laptop
- Internet Connection
Download:
- Insert MircoSD card into MicroSD Card Reader
- Insert Card Reader into computer
- Open up your browser and go to https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi
- Install the OpenWRT image that matches your Pi
- Install RaspberryPi Imager
- Next click on "Choose Device" and select the RaspberryPi your are using
- Next click on "Choose OS"
- Select "Use Custom" and select the OpenWRT image you recently installed
- Afterwards select "Choose Storage" and select your microSD card
- Finally, select "Write"
- Once downloading is completed, remove microSD reader and mircoSDD card
- Insert SD card into RaspberryPi and power it on
SSHing:
- Use an Ethernet cable to connect your device to the RaspberryPi
- Configure your Ethernet adapter to have a static address of "192.168.1.10" ~ If on Windows, this can be done through the Control Panel
- Open up your terminal and SSH into the RaspberryPi ~ On Windows: "ssh [email protected]"
*If ssh did not work, then ensure that you have installed it. Else install PuTTY
Configurations:
- Type: "cd /etc/config"
- Afterwards type: "cp firewall firewall.bk"
*This makes a backup of the default firewall configs
3) Do it again with network & wireless: "cp network network.bk" and "cp wireless wireless.bk"
4) Configure the network file: "vi network"
5) Configure lan interface:
"
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.84.1'
option netmask '255.255.255.0'
option ip6assign '60'
option force_link '1'
"
*The ipaddr field can be any private ip address
- Create wwan interface:
" config interface 'wwan' option proto 'dhcp' option peerdns '0' option dns '8.8.8.8' "
- Exit and save with: "ctrl+c" and ":wq"
Firewall Configurations:
- Type: "vi firewall"
- Go to "config zone" with option name "wan"
- Configure "option input" to "ACCEPT"
- Exit and save with: ctrl+c and :wq
- Reboot device: "reboot"
- Lastly, set your Ethernet adapter to automatically be assign an IP address (DHCP)
Wireless Configurations:
- SSH into your RaspberryPi
- Configure wireless with "vi /etc/config/wireless"
- Set "channel" to '7'
- Set "band" to '5g'
- Insert "option short_gi_40 '0'" at the end of "config wifi-device 'radio0'"
- Finally set "option disable" to '0'
- Exit and save with: ctrl+c and :wq
- Type "uci commit wireless"
- Lastly, type "wifi"
* If you configure it properly nothing should pop up when "wifi" is entered
Internet Configuration Through the GUI:
- Open up your browser and type the IP address of your RaspberryPi
- Login into OpenWRT
- Click on "Network" and then "Wireless"
- Next click on "Scan"
- Select the network you wish to recieve your internet connection from
- Then check the box that says "Replace wireless configurations" and enter the password of the network you're joining
- Scroll to the bottom of the screen and click "Save"
- Lastly, click "Save and Apply"
USB to Wireless Adapter Configuration:
- SSH into your RaspberryPi
- Type "opkg update"
* If the command fail then type "reboot" and SSH again into the device
- Next copy and paste this command: "opkg install kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb kmod-usb-core kmod-usb-uhci kmod-usb-ohci kmod-usb2 usbutils openvpn-openssl luci-app-openvpn nano"
- Insert your USB to Wireless Adapter into your RaspberryPi
- Type: "usbls" to confirm that your RaspberryPi can see your wireless adapter 6)Type: "ifconfig wlan1 up"
* If using a Linksys WUSB6300 use: "opkg install kmod-rtl8812au-ct"
Wireless LAN GUI Configurations:
- Login into OpenWRT through your browser
- Go to "Network" then "Wireless"
- You should see that a new radio device was added and SSID
- Configure SSID and password
- Select enable
- Save and Apply