OpenWRT
Contents
Logging
You probably don not need a log-file, which fills up your system memory. OpenWRT System Configuration
logread to access logd membuffer
dmesg to access kernel messages
1 logread -f
Add user
DNS with dnsmasq
DNS servers you specified in LUCI are queried in the opposite order. So if you are using --strict-order specify your backup DNS servers first.
Adblock
Install
1 opkg install luci-app-adblock
This is a config that worked out to be fast
/etc/config/adblock
1 config adblock 'global'
2 option adb_dns 'dnsmasq'
3 option adb_fetchutil 'uclient-fetch'
4 option adb_trigger 'wan'
5 option adb_debug '0'
6 option adb_whitelist '/etc/adblock/adblock.whitelist'
7 option adb_whitelist_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}'
8 option adb_backup '0'
9 option adb_backupdir '/mnt'
10 option adb_enabled '1'
11
12 config adblock 'extra'
13 option adb_debug '0'
14 option adb_nice '0'
15 option adb_whitelist '/etc/adblock/adblock.whitelist'
16 option adb_maxqueue '16'
17 option adb_forcedns '0'
18 option adb_forcesrt '1'
19
20 ### LIST SPECIFIC CONFIG OMITTED
21
You should not set adb_dnsflush = '1', it gets very slow.
UPnP
Install miniupnpc (client) on your pc
Install luci-app-upnp which depends on miniupnpd
1 opkg install luci-app-upnp
Enable UPNP IGD and NAT-PMP on Router via webif and query status again
1 % upnpc -s
2 upnpc : miniupnpc library test client, version 2.1.
3 (c) 2005-2018 Thomas Bernard.
4 Go to http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
5 for more information.
6 List of UPNP devices found on the network :
7 desc: http://192.168.182.1:5000/rootDesc.xml
8 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1
9
10 desc: http://[fd93:56fb:daf7::1]:5000/rootDesc.xml
11 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1
12
13 Found valid IGD : http://192.168.179.1:5000/ctl/IPConn
14 Local LAN ip address : fd93:2709:de35:0:fc16:acff:fe54:157e
15 Connection Type : IP_Routed
16 Status : Connected, uptime=451723s, LastConnectionError : ERROR_NONE
17 Time started : Fri Apr 3 08:07:49 2020
18 MaxBitRateDown : 33554432 bps (33.5 Mbps) MaxBitRateUp 4194304 bps (4.1 Mbps)
19 ExternalIPAddress = ww.xx.yy.zz
20 Bytes: Sent: 2283027815 Recv: 2695217145
21 Packets: Sent: 12678549 Recv: 80009359
Get external IP-address via UPNP IGD
1 /usr/bin/external-ip
opkg_upgrade
Speeds up the process
/sbin/opkg_upgrade
1 #!/bin/sh
2
3 PACKAGES="$(opkg list-upgradable|awk '{print $1}')"
4
5 if test "$PACKAGES"; then
6 echo -e "Packages to be upgraded:\n$PACKAGES"
7 read -p"Check and confirm with 'yes': " CONFIR_INPUT
8 if test "$CONFIR_INPUT" = "yes"; then
9 echo "Confirmed performing upgrade"
10 opkg upgrade $PACKAGES
11 else
12 echo "Input invalid - aborting."
13 fi
14 else
15 echo -e "No packages to be upgraded."
16 echo "Nothing to do - exiting ..."
17 fi
Trouble Shooting
Wrong Link Speed
I had a problem with link-speed between Docsis-modem in front and a OpenWRT-Router. OpenWRT displayed only 10Base-T (10Mbit/s).
It turns out that (against my expections/assumptions) OpenWRT did not support Auto MDI-X (Wikipedia EN: Medium Dependent Interface).
1 # ethtool eth0
2 Settings for eth0:
3 Supported ports: [ ]
4 Supported link modes: 1000baseT/Full
5 Supported pause frame use: No
6 Supports auto-negotiation: No
7 Supported FEC modes: Not reported
8 Advertised link modes: 1000baseT/Full
9 Advertised pause frame use: No
10 Advertised auto-negotiation: No
11 Advertised FEC modes: Not reported
12 Speed: 1000Mb/s
13 Duplex: Full
14 Port: MII
15 PHYAD: 0
16 Transceiver: external
17 Auto-negotiation: on
18 Current message level: 0x000000ff (255)
19 drv probe link timer ifdown ifup rx_err tx_err
20 Link detected: yes
So all you need to change to achieve the intended Link-Speed is to use
- a cross-over cable or
even simpler a (Amazon:) cross-over adapter, which turns some pins of any RJ-45 plug.
LUCI
Adjust container max-width to make tables readable.
/www/luci-static/bootstrap/cascade.css
Reduce horizontal padding between table cells