OPNsense – Accessing ONT / Modem Management Interfaces (Complete Guide)
I know that there are existing guides to do this, like this, yet those threads have become quite cluttered.
This guide does not want to take away from these efforts, rather expand them for a complex edge case that warrants a new guide, so here goes:
Basic Requirements
First off, there are some basic requirements for this to work:
In what follows, I assume 192.168.100.1 is the ONT management IP and 192.168.100.2/24 is the OPNsense interface IP. Adjust as needed for your setup.
Important warning: Some providers (e.g., Deutsche Glasfaser) block your internet access for a few minutes if they detect traffic to RFC1918 or BOGON IPs outside your networks. Potentially, this may even be true for IPv6 ULAs, if you use those.
You cannot simply block RFC1918 on the WAN interface because it violates requirement a).
I like to have an "out" rule on the WAN interface to suppress traffic to RFC1918 destinations, but that is not so easy sometimes...
Two Main Cases
You have two separate cases if you want to enable ONT (or modem) access:
Easy Case: WAN interface ≠ ONT interface
You have the actual WAN interface on a separate interface than your ONT.
This applies if your WAN uses either a VLAN, PPPoE, or both.
In this case, you can assign the ONT interface to the management subnet, because the interface is not being used otherwise.
So, you simply configure the ONT interface like this:
You cannot view this attachment.
This is the outbound NAT rule (you can use it via manual or hybrid NAT):
You cannot view this attachment.
Now for the question on how to block WAN traffic for RFC1918 destinations - this is easy in this case, because the rule applies to WAN only (and not to ONT):
You cannot view this attachment.
And lastly, the firewall rule to allow management clients to access your ONT (in case your LAN does not have an "allow any" rule):
You cannot view this attachment.
I know that there are existing guides to do this, like this, yet those threads have become quite cluttered.
This guide does not want to take away from these efforts, rather expand them for a complex edge case that warrants a new guide, so here goes:
Basic Requirements
First off, there are some basic requirements for this to work:
- You must not block RFC1918 IPs on the OPNsense interface connected to the ONT for obvious reasons.
- Your ONT's (or modem's) management IP must be outside of any of your local networks, including remote VPN sites. This is why you should never use some well-known network ranges that ONTs often use (also covered here).
- Some ONTs shut off management access once they establish internet access (i.e., O5 state). Nokia ONTs only react to ARP, but neither ICMP nor IP access works once connected on the fiber side.
- You most probably need outbound NAT to access the ONT because it is statically configured and does not have a default gateway. By using NAT, the translated IP the ONT sees lies inside its own local network, so it can respond correctly. You could theoretically install a route via OPNsense instead, but that does not work for all ONTs. Outbound NAT is the more general solution.
- You need a firewall rule allowing access from your management client(s) to your ONT's management IP.
In what follows, I assume 192.168.100.1 is the ONT management IP and 192.168.100.2/24 is the OPNsense interface IP. Adjust as needed for your setup.
Important warning: Some providers (e.g., Deutsche Glasfaser) block your internet access for a few minutes if they detect traffic to RFC1918 or BOGON IPs outside your networks. Potentially, this may even be true for IPv6 ULAs, if you use those.
- This can happen if devices (Fritzboxes, IoT devices) attempt to reach hardcoded RFC1918 IPs that are not local.
- Such traffic goes out via your ISP router and triggers provider protections.
You cannot simply block RFC1918 on the WAN interface because it violates requirement a).
I like to have an "out" rule on the WAN interface to suppress traffic to RFC1918 destinations, but that is not so easy sometimes...
Two Main Cases
You have two separate cases if you want to enable ONT (or modem) access:
Easy Case: WAN interface ≠ ONT interface
You have the actual WAN interface on a separate interface than your ONT.
This applies if your WAN uses either a VLAN, PPPoE, or both.
In this case, you can assign the ONT interface to the management subnet, because the interface is not being used otherwise.
So, you simply configure the ONT interface like this:
You cannot view this attachment.
This is the outbound NAT rule (you can use it via manual or hybrid NAT):
You cannot view this attachment.
Now for the question on how to block WAN traffic for RFC1918 destinations - this is easy in this case, because the rule applies to WAN only (and not to ONT):
You cannot view this attachment.
And lastly, the firewall rule to allow management clients to access your ONT (in case your LAN does not have an "allow any" rule):
You cannot view this attachment.
"