#!/bin/sh # Update the factory settings of OpenWrt to a known-good configuration. # You should make a copy of this script, customize it to your needs, # then use the "To run this script" procedure (below). # # This script is designed to configure all the settings needed to # set up your router after an initial "factory" firmware flash. # # There are sections below to configure many aspects of your router. # All the sections are commented out. There are sections for: # # - Set up the ge00/WAN interface to connect to your provider # - Update the software packages # - Update the root password # - Set the time zone # - Enable SNMP for traffic monitoring and measurements # - Enable NetFlow export for traffic analysis # - Enable mDNS/ZeroConf on the ge00 (WAN) interface # - Change default IP addresses and subnets for interfaces # - Change default DNS names # - Set the SQM (Smart Queue Management) parameters # - Set the radio channels # - Set wireless SSID names # - Set the wireless security credentials # # To run this script # # Flash the router with factory firmware. Then ssh in and execute these statements. # You should do this over a wired connection because some of these changes # will reset the wireless network. # # ssh root@172.30.42.1 # cd /tmp # cat > config.sh # [paste in the contents of this file, then hit ^D] # sh config.sh # Presto! (You should reboot the router when this completes.) # === Set up the WAN (ge00) interface ================== # Default is DHCP, this sets it to PPPoE (typical for DSL/ADSL) # From http://wiki.openwrt.org/doc/howto/internet.connection # Supply values for DSLUSERNAME and DSLPASSWORD # and uncomment seven lines # # DSLUSERNAME=YOUR-DSL-USERNAME # DSLPASSWORD=YOUR-DSL-PASSWORD # uci set network.ge00.proto=pppoe # uci set network.ge00.username=$DSLUSERNAME # uci set network.ge00.password=$DSLPASSWORD # uci commit network # ifup ge00 # === Update the software packages ============= # Download and update all the interesting packages # Some of these are pre-installed, but there is no harm in # updating/installing them a second time. # opkg update # retrieve updated packages # opkg install snmpd fprobe # install snmpd & fprobe # opkg install luci-app-sqm sqm-scripts # install the SQM modules to get fq_codel &c # opkg install ppp-mod-pppoe # install PPPoE module # === Update root password ===================== # Update the root password. Supply new password for NEWPASSWD and # uncomment six lines. # # echo 'Updating root password' # NEWPASSWD=enter-your-new-password # passwd <