OPNsense Forum

English Forums => General Discussion => Topic started by: mfpb on September 02, 2025, 01:46:27 PM

Title: Setup tun interface
Post by: mfpb on September 02, 2025, 01:46:27 PM
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.
Title: Re: Setup tun interface
Post by: franco on September 02, 2025, 02:21:56 PM
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