Update and/or upgrade of OPNsense in GCP
Considerations:
Time: from v24 to v25 it took around two-three hours to complete upgrades.
Prepare
Console
gcloud config set disable_usage_reporting false
gcloud config set accessibility/screen_reader false
gcloud auth login
? gcloud auth login --no-browser
gcloud auth list
gcloud config set account (account)
gcloud projects list
gcloud config set project (project)
gcloud config list project
gcloud compute regions list
gcloud config set compute/region europe-north1
gcloud compute zones list
gcloud config set compute/zone europe-north1-c
Backup
Take a snapshot
gcloud compute disks list
? gcloud compute disks list --filter="users:instance='gcp1fw1'" --zone=europe-north1-c
# no dots allowed in the name
gcloud compute snapshots create gcp1fw1-2025-05-03-1256 --source-disk='gcp1fw1'
gcloud compute snapshots list
Perform update
This can be performed over WebUI or CLI:
WebUI
screenshots here
CLI
Connect to OPNsense console (in my case, I do it from jumphost within GCP)
ssh root@10.166.0.x
Choose 8) Shell
# Unlock to permit updates
opnsense-update -U
uname -a
opnsense-version
# seelct and update base
opnsense-update -b
opnsense-update -B
# select and update kernel
opnsense-update -k
opnsense-update -K
? pkg clean -a
? pkg update -f
pkg upgrade -n
pkg upgrade
opnsense-shell reboot
? reboot
pkg info
# Lock to avoid updates
opnsense-update -L
After
Clean
gcloud compute snapshots list
gcloud compute snapshots delete gcp1fw1-2025-05-03-1256
gcloud compute snapshots list
for archive
ASCII logo changed
Last login: Mon Apr 7 15:23:47 2025 from 10.166.0.x
----------------------------------------------
| Hello, this is OPNsense 25.1 | @@@@@@@@@@@@@@@
| | @@@@ @@@@
| Website: https://opnsense.org/ | @@@\\\ ///@@@
| Handbook: https://docs.opnsense.org/ | )))))))) ((((((((
| Forums: https://forum.opnsense.org/ | @@@/// \\\@@@
| Code: https://github.com/opnsense | @@@@ @@@@
| Reddit: https://reddit.com/r/opnsense | @@@@@@@@@@@@@@@
----------------------------------------------
to
Last login: Sat May 3 14:05:23 2025 from 10.166.0.x
------------------------------------------------
| Hello, this is OPNsense 25.1 | :::::::.
| | :::::::::.
| Website: https://opnsense.org/ | ::: :::
| Handbook: https://docs.opnsense.org/ | ::: :::
| Forums: https://forum.opnsense.org/ | ::: :::
| Code: https://github.com/opnsense | `:::::::::
| Reddit: https://reddit.com/r/opnsense | `:::::::
------------------------------------------------