Setup tun interface

Started by mfpb, September 02, 2025, 01:46:27 PM

Previous topic - Next topic
Hello!

I want to setup tun interface permanently.

I tried to use /etc/rc.conf.d/tun and /etc/rc.conf

cloned_interfaces="tun0"
ifconfig_tun0_name="mytun0"

But after reboot nothing changes.
I tried to create it manually with ifconfig and it works, but until next reboot.

We don't support most of base's RC scripting because it causes side effects during boot.

You can run custom interface creation scripts via "early" rc.syshook facility: https://docs.opnsense.org/development/backend/autorun.html

Also note that creating manual tun interfaces can mess with existing OpenVPN use as the nodes in /dev are not reordered/renamed.


Cheers,
Franco