OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: luke.camilleri on August 02, 2019, 11:17:08 am

Title: Applying OPNSense settings in a startup script
Post by: luke.camilleri on August 02, 2019, 11:17:08 am
Hi everyone, I need to find a way to apply the initial settings (mainly interface assignment, ip addressing, hostname, timezone, DNS servers and disabling DHCP) from a script.

All the values are being provided as an ISO image attached to the VM instance and filled with key value pairs that I will use to apply the settings but I need to know how can I apply them i.e. which specific opnsense commands I need to use.

These are some example values in the ISO image attached:

ETH0_DNS = "8.8.8.8",
ETH0_GATEWAY = "185.89.239.195",
ETH0_IP = "185.89.239.206",
ETH0_MAC = "02:00:b9:59:ef:ce",
ETH0_MASK = "255.255.255.224",
ETH0_NETWORK = "185.89.239.192",

For example I can use ifconfig to set the IP addresses in freebsd but is this the proper way to have them applied in opnsense... Guess you understood what I am trying to accomplish now :-)

OPNSense version 19.1.4