Applying Network Configuration
Apply generated configuration to networking devices. Because these devices don't support declarative configuration management the way the cluster does, the general workflow is to reset a device to a known (factory-default) state and then apply configuration from scratch, rather than attempt to reconcile in-place changes.
Prerequisites
-
Ensure the networking configuration reflects the desired changes
-
Generate rendered device configuration into
network-config/:homelab generate-network-config
RouterOS
-
Copy the rendered script to the device:
scp network-config/[script].rsc admin@[router-address]:/script.rsc: -
SSH into the router and reset its configuration, applying the script immediately on reboot:
/system/reset-configuration no-defaults=yes run-after-reset=script.rsc -
Once the router is back online, log in as
adminand set the router password.
SwitchOS
-
Factory-reset the switch using one of:
- Hold the reset button while powering the switch on, keeping it held until it boots to factory defaults
- If the switch's web UI is already reachable, trigger a reset from there
tipAfter the reset, connect directly to one of the switch's ports, then manually configure your network interface with a static IP of
192.168.1.2, subnet255.255.255.0, and gateway/DNS server192.168.1.1. The switch should then be reachable atadmin@192.168.1.1. -
Once the switch is back online at its default address (
192.168.1.1) with default credentials (admin, no password), apply the rendered configuration:homelab apply-swos network-config/switch.core.yaml --address [switch-address]tipPass
--dry-runto preview changes before writing them. If credentials differ from the SwOS defaults (adminwith no password), pass--usernameand--password.
OpenWrt
-
SSH into the access point and reset it to factory defaults:
firstboot && rebootThe device reboots into a default, unconfigured state.
tipAfter the reset, connect directly to one of the access point's LAN ports. It will be reachable at
root@192.168.1.1with no password. -
Once back online, copy the rendered script onto it:
scp -O network-config/ap.[name].sh root@[ap-address]:tipThe
-Oflag forces the legacy SCP protocol, which copies over SSH directly. OpenWrt devices don't ship withsftp-server, so a plainscp(which defaults to SFTP) fails. -
SSH into the access point and run the script:
sh ap.[name].shtipAfter applying the configuration, you'll likely need to re-connect the device via it's WAN 1 port.
-
Navigate to the device's web UI and set the admin password.
-
Reboot the device