OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: matlink on December 23, 2022, 09:26:53 PM

Title: Port closed from firewall itself on ISP WAN
Post by: matlink on December 23, 2022, 09:26:53 PM
Hello,
I am trying to replace my SFR box (neufbox, france) by an OPNsense. This OPNsense is currently virtualized on a Proxmox.
However, everything goes well until I try to telnet on some ports (i.e. 53 and 80) from the firewall itself to external IPs (i.e. 9.9.9.9, 8.8.8.8, 1.1.1.1 ) using SSH.

Here is what I found:

What make me think the issue comes from the OPNsense firewall itself is when I disable the firewall and add route to specific IPs (/32), telnet works.

Here is the complete setup:

What I've tried:

I'm quite out of ideas for solving this. I don't believe that it comes from ISP nor ONT/DHCP configuration. I've checked a bunch of topics over there, found some related issues but none that solved my issue. This one looks very similar: https://forum.opnsense.org/index.php?topic=12665.0.

Thanks in advance for anyone who would try to help me.
Mat.
Title: Re: Port closed from firewall itself on ISP WAN
Post by: matlink on December 24, 2022, 07:02:29 PM
After some more investigation here is what I found.
I simulate a DHCP server with another machine, connected to the WAN of the OPNsense. When the server returns a lease in a /31 network, telnet does not work from OPNsense, but I give a /24 network lease, it does work. Here are the 2 differents routes that are created in OPNsense routing table :

when /31:
(https://i.postimg.cc/Gt5h7rbf/31.png)

when /24:
(https://i.postimg.cc/DzTfYxK7/24.png)

With /24, telnet does work for every destination, not only those having a dedicated route in OPNsense.

Howeever, when manually adding the route when connected to ISP, the /31 route seems to have a higher priority...
Title: Re: Port closed from firewall itself on ISP WAN
Post by: cookiemonster on December 24, 2022, 11:08:02 PM
Hi.
The firewall rules straight out of installation work with all traffic out of WAN is allowed and anything coming in needs to match an outgoing request, as per normal stateful firewall behaviour. The state violation block suggests the connection coming in is not matching the one that left the firewall, but it also suggests there something outside OPN causing it. Whether is the tagging, proxmox firewalling/ragging or something else is hard to know.
Title: Re: Port closed from firewall itself on ISP WAN
Post by: matlink on December 25, 2022, 09:02:59 AM
Yes I realized that this default denied packets comes from another equipment and is not really related to the given problem. Mostly the final issue is due to a routing misconfiguration, but I still can't see where.
Title: Re: Port closed from firewall itself on ISP WAN
Post by: matlink on December 26, 2022, 04:27:55 PM
Interesting thing: If I edit the WAN_DHCP gateway (automatically created by the DHCP configuration) by putting any public IP in "IP address" and mark it as "Far Gateway", everything works as expected.