mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:24:41 -06:00
- Add comprehensive wiki documentation under .github/wiki/ (19 articles) - Add READMEs to directories that lacked them - Fix merge conflict markers in existing READMEs - Update root readme.md with improved structure Co-authored-by: Jarvis <jarvis@wickedyoda.local>
2.5 KiB
2.5 KiB
OpenWrt Router Setup
OpenWrt router configuration and management scripts.
Scripts
Location: openwrt_scripts/
| File | Purpose |
|---|---|
openwrt_full-upgrade.sh |
Full firmware upgrade |
installing_ipref.sh |
IP configuration |
openwrt_snmp_defaults.txt |
SNMP config template |
Full System Upgrade
openwrt_full-upgrade.sh
Perform a complete OpenWrt upgrade.
Usage:
ssh root@10.0.84.1
curl -sSL https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/openwrt_scripts/openwrt_full-upgrade.sh | sh
Process:
- Downloads latest firmware
- Validates checksum
- Backs up config
- Performs sysupgrade
IP Configuration
installing_ipref.sh
Configure IP addresses and interfaces.
Typical usage:
# Access router via SSH
ssh root@192.168.1.1
# Run configuration script
./installing_ipref.sh
SNMP on OpenWrt
openwrt_snmp_defaults.txt
Default SNMP configuration for OpenWrt routers.
# Edit /etc/config/snmpd
config agent
option agentaddress 'udp:161'
config view
option name 'all'
option type 'included'
option oid '.1'
config group
option groupname 'publicGroup'
option securitymodel 'v2c'
config access
option groupname 'publicGroup'
option version 'v2c'
option level 'noAuthNoPriv'
Installation
# Install SNMP
opkg update
opkg install snmpd snmp-utils
# Configure
cat /etc/config/snmpd.d/openwrt-snmp_defaults.txt > /etc/config/snmpd
# Restart
/etc/init.d/snmpd restart
OpenWrt Management Tips
SSH Access
# Default credentials
root@openwrt
# Change password
passwd
Package Management
# Install packages
opkg update
opkg install <package>
# List packages
opkg list-installed
# Remove packages
opkg remove <package>
Configuration Backup
# Backup config
tar -czf /root/backup-$(date +%Y%m%d).tar.gz /etc/config/
# Restore
tar -xzf backup-20240101.tar.gz -C /
Network Configuration
Wireguard Client
For WireGuard client setup, see WireGuard VPN.
Port Forwarding
# Add port forward
uci add firewall redirect
uci set firewall.@redirect[-1].name='MyService'
uci set firewall.@redirect[-1].src='wan'
uci set firewall.@redirect[-1].src_dport='8080'
uci set firewall.@redirect[-1].dest='lan'
uci set firewall.@redirect[-1].dest_ip='192.168.1.100'
uci set firewall.@redirect[-1].dest_port='80'
uci commit firewall
/etc/init.d/firewall restart