# Using OPNsense

OPNsense is an open-source operating system that was created from pfSense firewall software. You can use OPNsense template to create your own firewall.

### 1. Create the antlet

Create a new antlet based on the `OPNsense` template. If you don't know how to create antlets yet, please check out [this article](https://docs.antsle.com/antlets/create-and-manage-antlet).

### 2. Set up access

To make sure your antlet and the site running on it is reachable, you will need to configure access. We recommend three different ways to do it. Choose the one that suits your needs best.

{% tabs %}
{% tab title="Using a bridged NIC" %}
Configure a bridged network interface, to expose your antlet to your local network. By doing this, your antlet gets another IP address in the same network that your edgeLinux server is in (in addition to the 10.1.1.X address.) This method gives you full access to the antlet from your local network. You can find detailed instructions on how to configure a bridged NIC [here](https://docs.antsle.com/networking/bridge#configure-virtual-nic).

1\) Go to your antlet - **Virtual Network**.  Click on **+Virtual NIC**.  Select the interface and click on **Create**.<br>

![Create Bridged NIC](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-MjpN_VjbtcEuBjeKbJV%2F-MjpPD802DQxu5yRYe6x%2FOPNsense_create_bridge_nic.png?alt=media\&token=bd131813-3eaa-4bd2-9856-c48e0a51da8e)

2\) Click on **Delete** next to bblv (internal NIC).  Click on "I understand, delete the default Virtual NIC!"<br>

![Delete bblv (internal) NIC](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-MjpN_VjbtcEuBjeKbJV%2F-MjpTrtvWsSzlDQ6Wo3_%2FOPNsense_delete_virtual_nic_0.png?alt=media\&token=5919dceb-a905-457f-9582-c622bb8dd3e0)

![Confirmation of Deletion of bblv (internal) NIC](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-MjpN_VjbtcEuBjeKbJV%2F-MjpQDcFi0nz2MGzUWnL%2FOPNsense_delete_virtual_nic.png?alt=media\&token=1e1fd57b-707f-4888-9a50-3b1090d1059a)

3\)  Start the antlet by pressing **Start**.
{% endtab %}

{% tab title="Using Port Forwarding" %}
In this scenario, we will specify a port that gets redirected to port 443 on the antlet.  Since antMan is being used on standard https port 443, we need to specify a different source port.  In this example, we are using 1443 for source port and 443 for destination port.<br>

![Port Forward Rule for OPNsense](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-MjpN_VjbtcEuBjeKbJV%2F-MjpSBDu60AucrGHkt9x%2FOPNsense_port_forward_rule.png?alt=media\&token=f3e0de77-6ddb-43b5-82ee-326fb89647c0)

You can specify a different port if you'd like.  The source port should not be 3000 or 443 since these are being used by antMan.

If you have multiple antlets running web servers listening on the same port, then you must create port forward rules with different source port numbers. &#x20;

You can find detailed instructions on how to setup port forwarding [here](https://docs.antsle.com/networking/port-forwarding).
{% endtab %}
{% endtabs %}

### 3. Connect to OPNsense

f you used Bridged Networking above, then use this address in your browser to access OPNsense:

&#x20; `https://bridge-nic-ip`

Where `bridge-nic-ip` is the private IP Address of your antlet that's on your network.

If you used Port Forwarding above, then use this address in your browser to access OPNsense:

&#x20;   `https://myantsle.local:1443`\
`https://antsle-private-ip:1443`

Where `myantsle` is the host name of your antsle and `antsle-private-ip` is the private IP address of your antsle and port `1443` is the custom port we defined in Port Forwarding.

### 4. Logging into OPNsense

Use the following default credentials for Nextcloud:

Username:  `root`  \
Password:  `antsle`

For using OPNsense, you can refer to their documentation [here](https://docs.opnsense.org/system.html).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.antsle.com/templates/using-opnsense.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
