OpenWRT

an open-source Linux distribution aimed at routers. - openwrt.org / r/openwrt

Raspberry-pi support

$ sudo e2fsck -f /dev/sdc2
$ sudo cfdisk /dev/sdc
$ # sudo resize2fs /dev/sdc2 # unnecessary
  • edit set ip in /etc/config/network
config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'auto'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.0.250'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option gateway '192.168.0.254'             
	option dns '212.27.40.240 212.27.40.241'
$ ssh-copy-id -i .ssh/id_rsa.pub root@192.168.1.1
$ ssh root@192.168.1.1
root@MyOpenWrt:~# mv /root/.ssh/authorized_keys /etc/dropbear/

Dropbear key-based authentication

$ uci set dropbear.@dropbear[0].PasswordAuth="0"
$ uci set dropbear.@dropbear[0].RootPasswordAuth="0"
$ uci commit dropbear
$ /etc/init.d/dropbear restart

Webserver GUI

opkg update
opkg install luci-ssl-nginx
/etc/init.d/nginx enable

Tools

opkg install usbutils	# lsusb
opkg install usbutils	# lshw

Temperature Monitoring

install Luci statistics, collectd and especially collectd mod sensors and thermal

Network

Bandwidth policy

  • SQM - ‘opkg install luci-app-sqm’

Monitor home network traffic

Network Ad Blocking with Pi-hole and OpenWrt

Wifi

$ wifi
'radio0' is disabled

$ wifi status
...

Atlernative setup

Written on July 14, 2017, Last update on May 22, 2021
raspberry-pi network security wifi ssh