<?xml version="1.0"?>
<opnsense>
  <trigger_initial_wizard/>
  <theme>opnsense</theme>
  <system>
    <optimization>normal</optimization>
    <hostname>{{OPNSENSE_HOSTNAME}}</hostname>
    <domain>{{DOMAIN}}</domain>
    <dnsallowoverride>1</dnsallowoverride>
    <dnsallowoverride_exclude/>
    <group>
      <name>admins</name>
      <description>System Administrators</description>
      <scope>system</scope>
      <gid>1999</gid>
      <member>0</member>
      <priv>page-all</priv>
    </group>
    <user>
      <name>root</name>
      <descr>System Administrator</descr>
      <scope>system</scope>
      <groupname>admins</groupname>
      <password>{{ROOT_PASSWORD_HASH}}</password>
      <uid>0</uid>
    </user>
    <timezone>Etc/UTC</timezone>
    <timeservers>{{NTP_UPSTREAM_SERVERS}}</timeservers>
    <webgui>
      <protocol>https</protocol>
    </webgui>
    <disablenatreflection>yes</disablenatreflection>
    <usevirtualterminal>1</usevirtualterminal>
    <disableconsolemenu/>
    <ipv6allow>1</ipv6allow>
    <bogons>
      <interval>monthly</interval>
    </bogons>
    <pf_share_forward>1</pf_share_forward>
    <ssh>
      <group>admins</group>
    </ssh>
  </system>
  <interfaces>
    <wan>
      <enable>1</enable>
      <if>{{WAN_IF}}</if>
      <mtu/>
      <ipaddr>{{WAN_IPADDR}}</ipaddr>
      <subnet>{{WAN_SUBNET_BITS}}</subnet>
      <gateway>WAN_GW</gateway>
      <blockpriv>1</blockpriv>
      <blockbogons>1</blockbogons>
    </wan>
    <lan>
      <enable>1</enable>
      <if>{{LAN_IF}}</if>
      <ipaddr>{{LAN_IPADDR}}</ipaddr>
      <subnet>{{LAN_SUBNET_BITS}}</subnet>
    </lan>
  </interfaces>
  <gateways>
    <gateway_item>
      <interface>wan</interface>
      <gateway>{{WAN_GATEWAY}}</gateway>
      <name>WAN_GW</name>
      <weight>1</weight>
      <ipprotocol>inet</ipprotocol>
      <descr>simulated ISP uplink gateway (D-100)</descr>
    </gateway_item>
  </gateways>
  <staticroutes>
{{ROUTE1_BLOCK}}
{{ROUTE2_BLOCK}}
  </staticroutes>
  <unbound>
    <enable>1</enable>
  </unbound>
  <nat>
    <outbound>
      <mode>automatic</mode>
    </outbound>
  </nat>
  <filter>
  </filter>
  <rrd>
    <enable/>
  </rrd>
  <ntpd>
    <prefer>{{NTP_PREFER_SERVER}}</prefer>
    <ispool>{{NTP_UPSTREAM_SERVERS}}</ispool>
  </ntpd>
  <OPNsense>
    <Firewall>
      <Filter>
        <rules>
          <rule>
            <enabled>1</enabled>
            <statetype>keep</statetype>
            <sequence>1</sequence>
            <action>pass</action>
            <quick>1</quick>
            <interface>lan</interface>
            <direction>in</direction>
            <ipprotocol>inet</ipprotocol>
            <protocol>any</protocol>
            <source_net>lan</source_net>
            <destination_net>any</destination_net>
            <description>Default allow LAN to any rule</description>
          </rule>
          <rule>
            <enabled>1</enabled>
            <statetype>keep</statetype>
            <sequence>11</sequence>
            <action>pass</action>
            <quick>1</quick>
            <interface>lan</interface>
            <direction>in</direction>
            <ipprotocol>inet6</ipprotocol>
            <protocol>any</protocol>
            <source_net>lan</source_net>
            <destination_net>any</destination_net>
            <description>Default allow LAN IPv6 to any rule</description>
          </rule>
          <rule>
            <enabled>1</enabled>
            <statetype>keep</statetype>
            <sequence>20</sequence>
            <action>pass</action>
            <quick>1</quick>
            <interface>wan</interface>
            <direction>out</direction>
            <ipprotocol>inet</ipprotocol>
            <protocol>UDP</protocol>
            <source_net>{{WAN_IPADDR}}</source_net>
            <destination_net>any</destination_net>
            <destination_port>123</destination_port>
            <description>D-107 controlled egress: NTP only, WAN uplink</description>
          </rule>
          <rule>
            <enabled>1</enabled>
            <statetype>keep</statetype>
            <sequence>21</sequence>
            <action>pass</action>
            <quick>1</quick>
            <interface>wan</interface>
            <direction>out</direction>
            <ipprotocol>inet</ipprotocol>
            <protocol>{{MIRROR_SYNC_PROTOCOL}}</protocol>
            <source_net>{{WAN_IPADDR}}</source_net>
            <destination_net>{{MIRROR_UPSTREAM_NET}}</destination_net>
            <destination_port>{{MIRROR_SYNC_PORT}}</destination_port>
            <description>D-107 controlled egress: per-DC mirror upstream sync only</description>
          </rule>
          <rule>
            <enabled>1</enabled>
            <statetype>keep</statetype>
            <sequence>99</sequence>
            <action>block</action>
            <quick>1</quick>
            <interface>wan</interface>
            <direction>out</direction>
            <ipprotocol>inet</ipprotocol>
            <protocol>any</protocol>
            <source_net>any</source_net>
            <destination_net>any</destination_net>
            <description>D-107 controlled egress: default-deny everything else outbound on WAN</description>
          </rule>
        </rules>
        <snatrules/>
        <npt/>
        <onetoone/>
      </Filter>
    </Firewall>
  </OPNsense>
</opnsense>
