cover

We use Windows PowerShell (Win + X » Windows Powershell):

SSH into OpenWrt Router

rm -r  "~\.ssh"
ssh root@192.168.1.1

next time just use ssh root@192.168.1.1

How to tell: DSA vs Swconfig

DSA (eg: Mi Router 4A, D-Link DIR-882, Linksys E8450)

swconfig list
-ash: swconfig: not found

Swconfig (eg: Tp-Link Archer C7, D-Link DIR-842)

swconfig list
Found: switch0 - mdio.0

For Swconfig please use this guide instead.

Set up UniFi PPPoE Username & Password

PPPOE_USERNAME=xxxx@unifi
PPPOE_PASSWORD=xxxxxxxxxxxxxx
DNS_1=1.1.1.1
DNS_2=8.8.8.8
DNS6_1=2606:4700:4700::1111
DNS6_2=2001:4860:4860::8888
uci set network.wan.proto='pppoe'
uci set network.wan.username=$PPPOE_USERNAME
uci set network.wan.password=$PPPOE_PASSWORD
uci set network.wan.device='wan.500'
uci set network.wan.ipv6='1'
uci set network.wan.peerdns='0'
uci set network.wan.dns="$DNS_1 $DNS_2"
uci set network.wan6.proto='dhcpv6'
uci set network.wan6.device='@wan'
uci set network.wan6.peerdns='0'
uci set network.wan6.dns="$DNS6_1 $DNS6_2"
uci commit network
ifup wan
echo 'Waiting for link to initialize'
sleep 20

Extras

Set Router Passsword

echo 'Updating root password'
NEWPASSWD=123
passwd <<EOF
$NEWPASSWD
$NEWPASSWD
EOF

Set Correct Timezone

TIMEZONE='<+08>-8'
ZONENAME='Asia/Kuala Lumpur'
echo 'Setting timezone to' $TIMEZONE
uci set system.@system[0].timezone="$TIMEZONE"
echo 'Setting zone name to' $ZONENAME 
uci set system.@system[0].zonename="$ZONENAME"
uci commit system
/etc/init.d/system reload

Set Router Hostname

HOSTNAME="LiNKSYS"
uci set system.@system[0].hostname=$HOSTNAME
uci set network.lan.hostname="`uci get system.@system[0].hostname`"
uci commit system
/etc/init.d/system reload

Install Optional Packages

opkg update                # retrieve updated packages
opkg install luci-app-sqm  # install the SQM modules to get fq_codel etc
opkg remove wpad-basic-wolfssl  # remove the non-mesh version of wpad
opkg install wpad-mesh-wolfssl  # Install the mesh supporting version
opkg intall luci-app-attendedsysupgrade # Install Attended Sysupgrade for keeping firmware up-to-date

Research