From 9cd83ebbb78d2f7d6870d48865ba5a8b5aa4f177 Mon Sep 17 00:00:00 2001 From: Rich Brown Date: Wed, 25 Sep 2024 20:44:43 -0400 Subject: [PATCH] First cut at config-spare-router.sh --- config-spare-router.sh | 290 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 config-spare-router.sh diff --git a/config-spare-router.sh b/config-spare-router.sh new file mode 100644 index 0000000..e421a1f --- /dev/null +++ b/config-spare-router.sh @@ -0,0 +1,290 @@ +#!/bin/sh +# Conigure a "spare router" in a known-good state. + +# This script configures the factory default settings of OpenWrt +# to make it easy to swap it in when a new router is needed. +# It also displays important configuration information when complete. +# You can print out those lines and tape them to the router so +# the next person will know how to access the router in the future. +# The format is: +# +# Configured: YYYY-MMM-DD +# Device: Belkin RT3200 +# OpenWrt: 22.03.5 r20134-5f15225c1e +# LAN: 192.168.253.1 +# User: root +# Login PW: SpareRouter +# WiFi SSID: SpareRouter +# WiFi PW: none + +# The default settings of the script are generic, but the router will work. +# You could make a copy of this script, customize it to your needs, +# then use the "To run this script" procedure (below). +# +# ***** 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 +# can reset the wireless network. +# +# ssh root@192.168.1.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.) + +# === CONFIGURATION PARAMETERS === +# Set the variables in this section to be used for configuration + +NEWPASSWD="SpareRouter" +TIMEZONE='EST5EDT,M3.2.0,M11.1.0' # see link to other time zones below +ZONENAME='America/New York' +LANIPADDRESS="172.30.42.1" +LANSUBNET="255.255.255.0" +SNMP_COMMUNITYSTRING=public +WIFISSID="SpareRouter" +WIFIPASSWD='' +ENCRMODE='none' + +# === Update root password ===================== +# Update the root password. +# +echo 'Updating root password' +passwd <