Recent posts

#1
Zenarmor (Sensei) / Re: Newest version zenarmor ca...
Last post by Sanibonani - Today at 10:10:07 AM
The same thing happens here: 2.73 -> 2.74 restarting the engine causes OPNsense to restart. The third appliance that shows this pattern.
#2
26.7, 26.10 Series / Re: Why Are VLAN Interface Nam...
Last post by Al Muckart - Today at 09:40:24 AM
Thank you for that considered and detailed explanation, I really appreciate it.
#3
26.7, 26.10 Series / Re: Why Are VLAN Interface Nam...
Last post by meyergru - Today at 09:08:59 AM
This is not a FreeBSD restriction, nor is it inherited from pfSense. In fact, I raised similar concerns when the naming scheme was changed back in 2022.

There were essentially three reasons for the current restrictions:

1. Support for stacked VLANs (QinQ): The old naming convention (`igb0_vlan100`) was abandoned in 22.1.4 because stacked VLANs (`igb0_vlan100_vlan200`) could exceed FreeBSD's 15-character interface name limit.

  https://forum.opnsense.org/index.php?topic=27931.0

2. Avoiding naming collisions: The leading zero is intentional to avoid collisions with interface names automatically generated by FreeBSD's interface cloning mechanism. The actual commit that introduced the stricter validation can be found here:

  https://github.com/opnsense/core/commit/2d74c6b641d7dfd0594cb4e8ca84b25667c599bf

3. Legacy code: This is probably the most relevant reason for not allowing arbitrary names. Franco explained in a German forum thread in January 2023 that OPNsense has historically relied on string matching of interface names to determine interface types. Unfortunately, these checks are not consistent throughout the codebase. Allowing arbitrary names could therefore cause subtle problems, while refactoring those checks could introduce regressions.

  https://forum.opnsense.org/index.php?topic=31802.0

Technically, you can still rename VLAN interfaces by editing `config.xml`, provided you update all references accordingly. I would be cautious about completely arbitrary names, though, given Franco's explanation.

IMHO, decoupling VLAN interface names from their parent interfaces and enforcing a particular naming convention are two separate design decisions. While I can understand the rationale for the former, the latter appears to be primarily a consequence of technical debt rather than an inherent technical necessity.

It would be interesting to know whether these limitations in the OPNsense codebase still exist today as technical debt to the same extent as they did in 2022/2023.
#4
26.7, 26.10 Series / Re: Pure non-filering bridge
Last post by lmoore - Today at 06:53:51 AM
My digression earlier with IPFW sysctls was related to a problem whereby ARP requests didn't traverse the bridge when dummynet was being used. I didn't record that specific issue and how I overcame it, but after reflecting upon it, I believe it was with Vanilla FreeBSD 15.1 installation where the problem arose and not in OPNsense.

Quote from: Cenkron on November 29, 2026, 08:15:29 PMPerhaps I will try doing it that way, but then I would just have to add another cable to the network switch.

I reviewed my notes from the other month and cobbled together (and tested) notes to simply set up OPNsense with a management interface and a bridge.

It is straightforward to get working with OPNsense, as Patrick has indicated.

If you are plugging all the bridge ports in to a switch, have you considered if STP may be influencing the connections?

Quote
Configuring OPNsense to simply act as a bridge without any firewall features being enabled.

Configuration Information used in this example.

Interface assignments:

   em0    -> [MGMT]
   igb0   -> [BM0]
   igb1   -> [BM1]
   igb2   -> [BM2]

Management IP address: 10.200.128.2/24
Management Gateway address: 10.200.128.1
Internal DNS server: 10.199.201.254

Configuration steps to prepare a system as a Bridge without Firewall using the console.

Lines beginning with '-->' are where input is required in the Command Line Interface (CLI).

Perform a Factory Reset of OPNsense.

 - Connect a computer to the serial port on the OPNsense device using a baud rate of 115200

Note: The same configurations can be performed when using a Video console.
 
 - Power on OPNsense device

Ignore the configuration importer. 

   >>> Invoking import script 'importer'
   Press any key to start the configuration importer: .......

When the message appears regarding interface assignment options, press a key when prompted.

   Default interfaces not found -- Running interface assignment option.

   Press any key to start the manual interface assignment: ..

-->   Do you want to configure LAGGs now? [y/N]: <Enter>

-->   Do you want to configure VLANs now? [y/N]: <Enter>

The list of available interfaces is presented.

   Valid interfaces are:

   igb0             b4:96:91:8c:a0:f8 Intel(R) I350 (Copper)
   igb1             b4:96:91:8c:a0:f9 Intel(R) I350 (Copper)
   igb2             b4:96:91:8c:a0:fa Intel(R) I350 (Copper)
   igb3             b4:96:91:8c:a0:fb Intel(R) I350 (Copper)
   re0              f4:f2:6d:05:4d:60 RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet
   em0              48:4d:7e:ee:1b:4e Intel(R) I219-LM SPT(5)

   If you do not know the names of your interfaces, you may choose to use
   auto-detection. In that case, disconnect all interfaces now before
   hitting 'a' to initiate auto detection.

-->   Enter the WAN interface name or 'a' for auto-detection: <Enter>

   Enter the LAN interface name or 'a' for auto-detection
   NOTE: this enables full Firewalling/NAT mode.
-->   (or nothing if finished): <Enter>

   Enter the Optional interface 1 name or 'a' for auto-detection
-->   (or nothing if finished): em0

   Enter the Optional interface 2 name or 'a' for auto-detection
-->   (or nothing if finished): <Enter>

   The interfaces will be assigned as follows:

   OPT1 -> em0

-->   Do you want to proceed? [y/N]: y

The system will continue booting to the OPNsense banner.

   *** OPNsense.internal: OPNsense 26.7.10 (amd64) ***

    OPT1 (em0)      ->

    HTTPS: SHA256 36 04 DE 9A 62 99 50 75 CA 46 24 CE AD 54 A1 3E
               77 8C A0 C0 17 41 DC 99 43 C8 CE 87 42 B9 13 98

   FreeBSD/amd64 (OPNsense.internal) (ttyu0)

-->   login: root

Log in as root.

   ------------------------------------------------
   |       Hello, this is OPNsense 26.7           |           :::::::.
   |                                              |           :::::::::.
   |  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  |           `:::::::
   ------------------------------------------------

   *** OPNsense.internal: OPNsense 26.7.10 (amd64) ***

    OPT1 (em0)      ->

    HTTPS: SHA256 36 04 DE 9A 62 99 50 75 CA 46 24 CE AD 54 A1 3E
               77 8C A0 C0 17 41 DC 99 43 C8 CE 87 42 B9 13 98

     0) Logout                              7) Ping host
     1) Assign interfaces                   8) Shell
     2) Set interface IP address            9) pfTop
     3) Reset the root password            10) Firewall log
     4) Reset to factory defaults          11) Reload all services
     5) Power off system                   12) Update from console
     6) Reboot system                      13) Restore a backup

-->   Enter an option: 2

-->   Configure IPv4 address OPT1 interface via DHCP? [y/N] <Enter>

   Enter the new OPT1 IPv4 address. Press <ENTER> for none:
-->   > 10.200.128.2


   Subnet masks are entered as bit counts (like CIDR notation).
   e.g. 255.255.255.0 = 24
       255.255.0.0   = 16
       255.0.0.0     = 8

   Enter the new OPT1 IPv4 subnet bit count (1 to 32):
-->   > 24

   For a WAN, enter the new OPT1 IPv4 upstream gateway address.
   For a LAN, press <ENTER> for none:
-->   > 10.200.128.1

-->   Do you want to use the gateway as the IPv4 name server, too? [Y/n] n
   Enter the IPv4 name server or press <ENTER> for none:
-->   > 10.199.201.254

-->   Configure IPv6 address OPT1 interface via DHCP6? [y/N] <Enter>

   Enter the new OPT1 IPv6 address. Press <ENTER> for none:
-->   > <Enter>

-->   Do you want to enable the DHCP server on OPT1? [y/N] <Enter>

-->   Do you want to change the web GUI protocol from HTTPS to HTTP? [y/N] <Enter>

-->   Do you want to generate a new self-signed web GUI certificate? [y/N] <Enter>

-->   Restore web GUI access defaults? [y/N] <Enter>

The OPNsense banner after IP assignment.

   You can now access the web GUI by opening
   the following URL in your web browser:

      https://10.200.128.2

   *** OPNsense.internal: OPNsense 26.7.10 (amd64) ***

    OPT1 (em0)      -> v4: 10.200.128.2/24

    HTTPS: SHA256 36 04 DE 9A 62 99 50 75 CA 46 24 CE AD 54 A1 3E
               77 8C A0 C0 17 41 DC 99 43 C8 CE 87 42 B9 13 98

     0) Logout                              7) Ping host
     1) Assign interfaces                   8) Shell
     2) Set interface IP address            9) pfTop
     3) Reset the root password            10) Firewall log
     4) Reset to factory defaults          11) Reload all services
     5) Power off system                   12) Update from console
     6) Reboot system                      13) Restore a backup

-->   Enter an option: 3

   The root user login behaviour will be restored to its defaults.

-->   Do you want to proceed? [y/N]: y

-->   Type a new password: <some new password>
-->   Confirm new password: <re-enter new password>

   The root user has been reset successfully.

   *** OPNsense.internal: OPNsense 26.7.10 (amd64) ***

    OPT1 (em0)      -> v4: 10.200.128.2/24

    HTTPS: SHA256 41 F9 BC 9E 68 DB C6 2A 56 01 3A E9 8C EA B0 29
               4F 15 B2 AF 4A 71 16 86 CC 05 B8 19 EB 44 6F 20

     0) Logout                              7) Ping host
     1) Assign interfaces                   8) Shell
     2) Set interface IP address            9) pfTop
     3) Reset the root password            10) Firewall log
     4) Reset to factory defaults          11) Reload all services
     5) Power off system                   12) Update from console
     6) Reboot system                      13) Restore a backup

-->   Enter an option: 0


   FreeBSD/amd64 (OPNsense.internal) (ttyu0)

   login:


Patch the network cable from your management network in to em0 and log in using the WebGUI.

Wait for the System: Configuration: Wizard to appear and click on the Abort button.

 - System Configuration Wizard
   - Welcome tab
   - Click 'Abort'

Disable Hostwatch Discovery.

 - Interfaces -> Hostwatch-> Settings
   - Enabled: untick
   - Click 'Apply'


Update description for OPT1.

 - Interfaces -> [OPT1]
   - Lock: 'tick' - Prevent interface removal
   - Description: MGMT
   - Click 'Save'
   - Click 'Apply changes'

Assign the interfaces which will be used as bridge members.

 - Interfaces -> Assignments
   - Add
   - Description: BM0
   - Select device from drop-down list: igb0 (b4:96:91:8c:a0:f8)
   - Click 'Save'

   - Add
   - Description: BM1
   - Select device from drop-down list: igb1 (b4:96:91:8c:a0:f9)
   - Click 'Save'

   - Add
   - Description: BM2
   - Select device from drop-down list: igb2 (b4:96:91:8c:a0:fa)
   - Click 'Save'

Add and assign the Bridge interface.

 - Interfaces -> Devices -> Bridge
   - Add
   - Member interfaces: BM0, BM1, & BM2
   - Description: BRIDGE0
   - Enable link-local address 'tick'
   - Click 'Save'
   - Click 'Apply'

 - Interfaces -> Assignments
   - Add
   - Description: BRIDGE0
   - Select device from drop-down list: bridge0 (BRIDGE0)
   - Click 'Save'
   - Click 'Apply'

If you do not see the newly assigned BRIDGE0 interface under Interfaces, refresh the browser page (F5).

 - Interfaces -> [BRIDGE0]
   - Enable: 'tick'
   - Lock: 'tick' - Prevent interface removal
   - IPv4 Configuration Type: None
   - IPV6 Configuration Type: None
   - Click 'Save'
   - Click 'Apply changes'

Disable firewall functions.

 - Firewall -> Settings -> Advanced
   - Disable Firewall: 'tick' Disable all packet filtering
   - Click 'Save'

Configure System DNS settings

 - System -> Settings -> General -> Networking
   - DNS Server options: 'tick' Do not use the local DNS service as a nameserver for this system
   - Click 'Save'

Disable the Unbound service.

 - Services -> Unbound -> General
   - Enable Unbound: 'un-ticked'
   - Click 'Apply'

Patch the network lead from the other OPNsense router/firewall in to igb0.

Patch the network lead from the device under test in to igb1.

If the device under test is able to respond to icmp-echo requests, it will respond to ping.

Review the status of the interfaces in Interfaces -> Overview.

Quote
         +-----------------+                 +-----------------+
Internet |                 |      BM0 (igc0) |     (Bridge)    |     BM1 (igc1)
-------->| OPNsense Router |---------------->|     OPNsense    |----------> DUT
         |                 |                 |    No Firewall  |
         +-----------------+                 |                 |     BM2 (igc2)
                                             |                 |----------> DUT
                                             |                 |
                                             +-----------------+
                                                      | Management - MGMT (em0)
                                                      |-------------------> Switch - Access port
#5
26.7, 26.10 Series / Why Are VLAN Interface Names F...
Last post by Al Muckart - Today at 06:00:46 AM
OPNsense won't let me create a VLAN interface whose name doesn't start with 'vlan0'.

This isn't a FreeBSD restriction, and it makes it impossible to properly associate a VLAN subinterface's name with its parent. It also eats five of the 15 characters available for naming.

Is it inherited from pfSense or is there some hidden reason for it?

Thanks.
#6
Tutorials and FAQs / Re: Setup guide for os-sftp-ba...
Last post by AzharAbbasPK - Today at 05:00:48 AM
Nice guide, thanks for writing it up. Two small things though: in step 8 you should append the public key (id_ed25519.pub) to authorized_keys, not the private one, and step 9 should be chmod 700 for the Backups folder since a directory needs the execute bit to be entered.
#7
Tutorials and FAQs / Setup guide for os-sftp-backup...
Last post by arrowd - Today at 01:26:48 AM
Setup Guide for Automatic Backups of
OPNsense configuration to a TrueNAS server

There are different ways of setting up the process, some possibly more efficient than this, but these settings worked for me after a lot of false starts and web searching. I've generated this to both help future me and possibly help other non-experts interested in doing automatic backups. Improvements welcome.

1.   Enable SSH in OPNsense. At the web page go to System – Settings – Administration. In Secure Shell enable Secure Shell; Permit root user login; Permit password login; Port 22; Listen on your LAN (and perhaps VPN) interfaces.

2.   Use PuTTY or some other terminal program to connect by 'ssh root@<opnsense_IP> using the root password. Later on you can setup login by using SSH key pairs.

3.   Make a key pair to authenticate the SSH backup session. At the shell prompt enter
'ssh-keygen -t ed25519 -C "your_email@example.com" -f id_ed25519'. This will result in 'id_ed25519' and 'id_ed25519.pub' files in your /root directory. The email address after the -C is just a comment to label the keys and is not used for actual emails.

4.   If there is no .ssh directory in /root, 'mkdir .ssh' to add it. Set directory permissions to 'chmod 700. Move the two key files into /root/.ssh, and set their permissions with 'chmod 600'.

5.   Enable SSH on your TrueNAS server. At the web page go to System – Services – SSH; enable it to start automatically; no further editing is required.

6.   Use PuTTY or some other terminal program to connect by 'ssh root@<truenas_IP> using the root password.

7.   Create a home directory for the new user on your TrueNAS unit. Enter 'mkdir /mnt/<your pool name>/opnsense'.

8.   Enter 'cd /mnt/<your pool name>/opnsense'. If there is no .ssh directory there, 'mkdir .ssh' to add it. Set directory permissions with 'chmod 700. If not present, create an '.authorized_keys' file, and set the permissions with 'chmod 600'. Edit the file and append the contents of id_ed25519 to it.

9.   Enter 'mkdir Backups', and set permissions with 'chmod 600'.

10.   Configure a user on TrueNAS. Go to Credentials – Users. Click Add. For Username, enter opnsense; Allow Access for SMB and SSH. In 'Public SSH Key' field, paste in the contents of the id_ed25519.pub file. In Home Directory under Additional Details, set it to '/mnt/<your pool name>/opnsense'.

11.   Install the os-sftp-backup plugin on OPNsense at System – Firmware – Plugins.

12.   Configure the plugin at System – Configuration – Backups. Under sftp, Enable it; set the URL to 'sftp://opnsense@<your_truenas_IP>/Backups'. (Yes, there is a double slash.) For SSH private key, 'Click to edit' and paste in the contents of id_ed25519. Set the Backup Count to how many you want to keep. If you want to encrypt your backups, enter a password and confirm it. Click 'Setup/Test sftp'.

13.   If everything worked, you should see a message at the top of the screen that says 'Backup successful, current file list:' followed by a list of XML file names with the Unix times they were made as part of the names.

14.   If you get an error message instead, try this: get to a shell prompt on OPNsense and enter 'sftp opnsense@<your_truenas_IP>'. If successful, this started sftp in interactive mode – see the FreeBSD man page on sftp to see allowed commands. If instead, you get an error message from this sftp command, you can see expanded errors to diagnose the problem by entering 'sftp -v opnsense@<your_truenas_IP>'.

15.   Each time you manually run the Setup/Test, you will get another backup. When enabled, the process will run as a cron job at a random time between 1 and 2 AM every night. You can verify this by entering 'crontab -l' at a shell prompt, and finding the line that includes 'remote backups'. If your configuration hasn't changed, a new backup won't be transferred to TrueNAS.

16.   Backup events are recorded in System - Log Files – General.

17.   If you need to restore a previous configuration, copy the saved file to your workstation. In OPNsense go to System – Configuration – Backups. In the Restore section, Choose the file you just downloaded, and click 'Restore configuration'. If you encrypted the backup, click 'Configuration is encrypted' and enter the password in the field provided.

#8
26.7, 26.10 Series / Re: No DNS query entries showi...
Last post by Maurice - November 29, 2026, 11:34:15 PM
Might be too obvious, but Reporting: Unbound DNS: Settings: Enabled is checked?

Cheers
Maurice
#9
Virtual private networks / Re: New OpenVPN Setup Issues
Last post by Kitdrewne - November 29, 2026, 11:24:53 PM
Thanks so much for the reply! I believe that helped with the issue, those errors are no longer appearing in the log. I'm now getting this when I try to connect:
Code (openvpn.log) Select
2026-11-24T10:47:25-07:00 Error openvpn_server1 udp6:IPADDRESSHERE:35364 TLS Error: TLS handshake failed
2026-11-24T10:47:25-07:00 Error openvpn_server1 udp6:IPADDRESSHERE:35364 TLS Error: TLS object -> incoming plaintext read error
2026-11-24T10:47:25-07:00 Error openvpn_server1 udp6:IPADDRESSHERE:35364 TLS_ERROR: BIO read tls_read_plaintext error
2026-11-24T10:47:25-07:00 Error openvpn_server1 udp6:IPADDRESSHERE:35364 OpenSSL: error:0A000413:SSL routines::ssl/tls alert unsupported certificate:SSL alert number 43
2026-11-24T10:08:19-07:00 Error openvpn_server1 TLS Error: cannot locate HMAC in incoming packet from [AF_INET6]::ffff:IPADDRESSHERE:33366 (via ::ffff:WANADDRESSHERE%[undef])
2026-11-24T09:32:39-07:00 Error openvpn_server1 TLS Error: cannot locate HMAC in incoming packet from [AF_INET6]::ffff:IPADDRESSHERE:60602 (via ::ffff:WANADDRESSHERE%[undef])
2026-11-24T09:30:28-07:00 Error openvpn_server1 TLS Error: cannot locate HMAC in incoming packet from [AF_INET6]::ffff:IPADDRESSHERE:61036 (via ::ffff:WANADDRESSHERE%[undef])
2026-11-24T05:20:31-07:00 Error openvpn_server1 TLS Error: cannot locate HMAC in incoming packet from [AF_INET6]::ffff:IPADDRESSHERE:34240 (via ::ffff:WANADDRESSHERE%[undef])
2026-11-24T05:05:21-07:00 Error openvpn_server1 TLS Error: cannot locate HMAC in incoming packet from [AF_INET6]::ffff:IPADDRESSHERE:57321 (via ::ffff:WANADDRESSHERE%[undef])
2026-11-24T02:14:28-07:00 Error openvpn_server1 TLS Error: cannot locate HMAC in incoming packet from [AF_INET6]::ffff:IPADDRESSHERE:59618 (via ::ffff:WANADDRESSHERE%[undef])
(The first four lines repeat indefinitely as long as my VPN client tries connecting.)

I only had a few minutes at the site this device is at, so I'll have to look into it further while I'm there next week. I probably just misconfigured something with a cert when I was trying to find the original problem.
#10
26.7, 26.10 Series / Re: Pure non-filering bridge
Last post by Maurice - November 29, 2026, 11:21:30 PM
@Cenkron As you said, a bridge is a layer 2 device. From a layer 2 perspective, a gateway is just a host like any other one.

The discussion does not make it clear what frames are lost where. As Patrick said: Packet capture. Look at what's actually going on on the wire. Work your way up: When attempting to ping the gateway from the OPNsense bridge device itself, does it send corresponding ARP requests? Do these arrive at the gateway? Does the gateway send ARP responses? Do these reach the igc interface on the bridge device? And then the bridge0 interface? If that's all a yes, then check the same for ICMP. If not, at what point does it fail?

Cheers
Maurice