openwrt-config
OpenWRT Configuration Management
Overview
This skill provides workflows and reference documentation for managing OpenWRT router configuration via SSH. All configurations use UCI (Unified Configuration Interface) and are applied through SSH commands to the router at <router_ip> (default is typically 192.168.1.1).
Connection
All commands are executed via SSH to the router:
ssh root@<router_ip> "<command>"
For multiple related commands, chain them with &&:
ssh root@<router_ip> "uci set ... && uci commit ... && /etc/init.d/... restart"
Configuration Workflow
- Read current configuration - Check existing settings before making changes
- Apply changes - Use
uci setcommands to modify configuration - Commit changes - Run
uci commit <config>to save - Restart service - Apply changes with
/etc/init.d/<service> restart - Verify - Check that changes were applied correctly
Configuration Categories
DDNS Records
Common tasks:
- Add new DDNS record for Cloudflare
- Update existing DDNS record
- Enable/disable DDNS service
Reference: See ddns.md for Cloudflare DDNS configuration patterns, examples, and verification commands.
Example workflow:
- Read existing DDNS config:
ssh root@<router_ip> "cat /etc/config/ddns" - Add new service using UCI commands
- Commit and restart:
uci commit ddns && /etc/init.d/ddns restart - Verify:
uci show ddns.<service_name>
Firewall Rules
Common tasks:
- Add port forwarding rules
- Create traffic rules
- Configure firewall zones
Reference: See firewall.md for port forwarding patterns, traffic rules, and examples.
Example workflow:
- Add redirect rule using
uci add firewall redirect - Configure rule parameters
- Commit and restart:
uci commit firewall && /etc/init.d/firewall restart - Verify:
uci show firewall | grep redirect
Network Configuration
Common tasks:
- Add static DHCP leases
- Configure VLANs
- Set up bridges
- Add custom DNS entries
Reference: See network.md for DHCP, VLAN, bridge, and DNS configuration patterns.
Example workflow:
- Add DHCP host reservation using
uci add dhcp host - Configure MAC and IP address
- Commit and restart:
uci commit dhcp && /etc/init.d/dnsmasq restart - Verify:
cat /tmp/dhcp.leases
Wireless Settings
Common tasks:
- Add new WiFi network (SSID)
- Change WiFi password
- Configure encryption
- Enable/disable radios
Reference: See wireless.md for WiFi configuration patterns, security settings, and examples.
Example workflow:
- Add WiFi interface using
uci set wireless.<name>=wifi-iface - Configure SSID, encryption, and password
- Commit and reload:
uci commit wireless && wifi reload - Verify:
wifi status
Package Management
Common tasks:
- Install packages
- Remove packages
- Update package lists
- Search for packages
Reference: See system.md for package management commands and system configuration.
Example workflow:
- Update package lists:
opkg update - Install package:
opkg install <package> - Verify:
opkg list-installed | grep <package>
System Settings
Common tasks:
- Change hostname
- Set timezone
- View system logs
- Create backups
Reference: See system.md for system configuration, logging, and backup procedures.
Example workflow:
- Modify system setting using
uci set system.@system[0].<setting> - Commit and reload:
uci commit system && /etc/init.d/system reload - Verify:
uci show system
Best Practices
- Always read before writing - Check current configuration before making changes
- Verify after changes - Confirm settings were applied correctly
- Use descriptive names - Name services, rules, and interfaces clearly
- Chain commands - Use
&&to ensure commands execute sequentially - Commit before restart - Always
uci commitbefore restarting services - Check logs - Use
logreadto troubleshoot issues
Common Patterns
Pattern: Add and Verify Configuration
# Step 1: Read current config
ssh root@<router_ip> "cat /etc/config/<config_file>"
# Step 2: Apply changes (multiple uci commands)
ssh root@<router_ip> "
uci set ... &&
uci set ... &&
uci commit <config> &&
/etc/init.d/<service> restart
"
# Step 3: Verify
ssh root@<router_ip> "uci show <config>.<section>"
Pattern: Copy and Modify Existing Configuration
When user asks to copy an existing configuration and modify it:
- Read the source configuration
- Identify the section to copy
- Create new section with modified values
- Commit and restart
- Verify the new configuration
Example: "Copy the 'cloud' DDNS record and modify it for plex.fldc.se"
- Read:
cat /etc/config/ddns - Identify: Find the 'cloud' service configuration
- Create: Use same pattern but change service name, lookup_host, and domain
- Commit:
uci commit ddns && /etc/init.d/ddns restart - Verify:
uci show ddns.plex
More from fldc/agent-skills
loopia-dns
Manage Loopia DNS via XML-RPC API, including listing account domains and subdomains as well as listing, adding, updating, and removing DNS records in Loopia zones. Use this when the user mentions Loopia DNS, Loopia API, subdomains, domains, or A/CNAME/TXT/MX record changes.
14smhi-weather
Hämta väderprognoser från SMHI för de inbyggda orterna Mjölby, Linköping, Norrköping, Motala och Vadstena, samt vädervarningar för Östergötland. Använd när användaren frågar om väder, temperatur, nederbörd, vind eller prognos för någon av dessa orter, eller om vädervarningar i Östergötland.
9ostergotland-events
Hitta och sammanfatta tidsatta evenemang i Östergötland, som konserter, marknader, föreställningar och familjeaktiviteter. Använd när användaren frågar vad som händer i en stad eller under en viss dag eller helg i Linköping, Norrköping, Mjölby, Motala, Vadstena eller andra orter i regionen.
8mjardevi-lunch
Hämta dagens lunchmenyer från restauranger i Mjärdevi via Luncha I Mjärdevi API. Använd när användaren frågar efter dagens lunch, lunchmeny eller vad som serveras idag i Mjärdevi.
7systembolaget-skill
Help users choose, compare, and look up alcoholic products and store locations specifically within Systembolaget's catalog. Use this when the user is clearly shopping at Systembolaget or asks about artikelnummer, Systembolaget stores, budget filtering, pairings, tasting lineups, gift bottles, or best-value picks from Systembolaget's selection.
7