OPNsense Forum

English Forums => General Discussion => Topic started by: bravosecure on September 20, 2024, 11:42:23 PM

Title: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 20, 2024, 11:42:23 PM
I have an OPNsense box connected to another firewall on its WAN port (Daisy chained). I want to access from another system that is connected to that higher up firewall.

When I run this command in the Opnsense console:

echo "pass in quick on ix1 proto tcp from 192.168.10.101 to (ix1) port 443 keep state" | pfctl -f -

I can access the webui.

I then add the rule for the WAN interface to allow in the traffic that matches that rule, click save, then apply, then I get nothing but a small hang and white web page. PLUS, I then have to redo the console command to even access the webui again.

How can I acheive what im trying to do?
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: newsense on September 21, 2024, 07:30:58 AM
Don't block RFC1918 in  Interfaces - WAN
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 21, 2024, 10:42:46 PM
I actually saw that and disabled it when I was trying to fix things. (Block private networks). I confirmed it was disabled again and I still have the same issue.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: ClayJ on September 22, 2024, 06:34:26 PM
Here's what finally fixed my WEBui access from the WAN

Firewall / Settings / Advanced  -  Disable anti-lockout = Checked

I already had  - Disable administration anti-lockout rule = Checked
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 23, 2024, 04:19:16 AM
That didnt work neither
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 24, 2024, 01:19:52 AM
Can anyone pls help? Surely I am not the first to want to do something like this.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: Patrick M. Hausen on September 24, 2024, 10:50:37 AM
Disable the anti-lockout rule and also disable force gateway (in Firewall > Settings > Advanced). That *should* do it.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 25, 2024, 12:35:02 AM
It didn't. :(
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 26, 2024, 04:07:48 AM
Quote from: Patrick M. Hausen on September 24, 2024, 10:50:37 AM
Disable the anti-lockout rule and also disable force gateway (in Firewall > Settings > Advanced). That *should* do it.

Do you have any other ideas?
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: Patrick M. Hausen on September 26, 2024, 07:55:23 AM
Use tcpdump to observe what is happening.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: Monviech (Cedrik) on September 26, 2024, 08:09:59 AM
I also disable "Firewall: Settings: Advanced - Reply To" for my daisy chained OPNsenses since when you communicate with them on the WAN port they send the packet back to their default gateway instead.

In my experience that one needs a restart of the router.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 26, 2024, 03:01:02 PM
Quote from: Monviech on September 26, 2024, 08:09:59 AM
I also disable "Firewall: Settings: Advanced - Reply To" for my daisy chained OPNsenses since when you communicate with them on the WAN port they send the packet back to their default gateway instead.

In my experience that one needs a restart of the router.

In my case, wouldnt the default gateway be the router which my system is using? So it would be right?
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 26, 2024, 03:03:13 PM
I did try that, and rebooted, and I still need to do my console command to get access.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: Patrick M. Hausen on September 26, 2024, 03:04:25 PM
Quote from: bravosecure on September 26, 2024, 03:01:02 PM
In my case, wouldnt the default gateway be the router which my system is using? So it would be right?
Right when trying to access across the Internet. Wrong if there is an entire WAN network and you are trying to access the UI from a PC connected to that same network as OPNsense and the default gateway.

In that case sending the reply packets to the gateway instead of using ARP on the local network is exactly what makes the UI access fail.

I wonder why that "magic" exists at all. OPNsense should follow its routing table and that's that. Unless explicit policy routing is configured.

P.S. use tcpdump on WAN and observe what happens.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 26, 2024, 03:07:21 PM
Quote from: Patrick M. Hausen on September 26, 2024, 03:04:25 PM
Quote from: bravosecure on September 26, 2024, 03:01:02 PM
In my case, wouldnt the default gateway be the router which my system is using? So it would be right?
Right when trying to access across the Internet. Wrong if there is an entire WAN network and you are trying to access the UI from a PC connected to that same network as OPNsense and the default gateway.

In that case sending the reply packets to the gateway instead of using ARP on the local network is exactly what makes the UI access fail.

I wonder why that "magic" exists at all. OPNsense should follow its routing table and that's that. Unless explicit policy routing is configured.

P.S. use tcpdump on WAN and observe what happens.

Given this, what should I set here (in the rule)

Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 26, 2024, 03:11:55 PM
Also, why would this behaviour not be happening when I use the console command? It seems to be only linked to the GUI. I may need to screenshot my entire rule... maybe there is something I am doing wrong.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 26, 2024, 03:16:38 PM
Here is the full rule in PDF format. The source "Lan Address" was the last thing I tried. Before I had it set to the actual IP address of 192.168.10.101.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 28, 2024, 01:12:08 AM
Nobody has anymore ideas?
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: Patrick M. Hausen on September 28, 2024, 01:23:28 AM
The source needs to be "any".
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 28, 2024, 05:49:26 AM
Quote from: Patrick M. Hausen on September 28, 2024, 01:23:28 AM
The source needs to be "any".

Tried that and it's still timing out. Still need to do the console command to connect.
Title: Re: Opnsense access from WAN system (Daisy chained router)
Post by: bravosecure on September 28, 2024, 05:58:07 AM
Scratch that. It worked. Thank you!