OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: lrosenman on March 28, 2022, 03:48:14 AM

Title: [SOLVED]I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules
Post by: lrosenman on March 28, 2022, 03:48:14 AM
I need NO-NAT, but the ability to have firewall rules.  I've looked at past posts, and BELIEVE I've done everything right, but if pf is enabled, it does NOT pass traffic.  If I disable pf it works fine.

HELP.

attached is the current state
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: chemlud on March 28, 2022, 08:39:09 AM
Hmmm, Firewall -> Settings -> Advances has

If you only want to disable NAT, and not firewall rules, visit the Outbound NAT page.

..and Firewall -> NAT -> Outbound says

Disable outbound NAT rule generation
(outbound NAT is disabled)
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 28, 2022, 02:58:24 PM
I have that set, and it does NOT pass traffic.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: Patrick M. Hausen on March 28, 2022, 03:08:14 PM
If you do not NAT, devices on both (or more) sides of your OPNsense need to have appropriate routes configured.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 28, 2022, 03:12:32 PM
um this is a standard routing thing, with globally routable IP's. 

NOTE: If I just turn PF off, it routes JUST FINE.

I've been doing IPv4 networking for >30 years, and I've tried a thousand(estimate) things.

with PF enabled it doesn't work, with PF disabled it routes like it's supposed to.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: Patrick M. Hausen on March 28, 2022, 03:14:00 PM
Then post a live log entry of a blocked packet and the corresponding firewall rule that should have passed it, please.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 28, 2022, 03:27:25 PM
I posted the ENTIRE config, and NOTHING passes OUT. says blocked by default deny rule.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: Patrick M. Hausen on March 28, 2022, 03:30:26 PM
Please post the live log entry of a single blocked packet and a screenshot of the single firewall rule supposed to pass it - how am I supposed to make sense of a bunch of XML by staring at it?
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 28, 2022, 03:34:00 PM
anything that goes OUT to the WAN gets denied by default deny rule.

ANYTHING

and there are out rules for all interfaces with ANY ANY and all protocols, etc.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: Patrick M. Hausen on March 28, 2022, 03:41:28 PM
Most of the time you need IN rules to pass traffic.

The first packet of any given flow arrives at an interface. That's IN from the firewall's point of view. Once that gets passed by the rule, a state is set up to pass packets in the matching return direction until the flow terminates.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 28, 2022, 03:55:44 PM
there are those too.  and the established etc TCP sessions should allow it.

LITERALLY NOTHING GOES OUT FROM THE LAN TO THE WAN WITH PF ON. 

I'VE BEEN DOING THIS FOR A LONG TIME.

https://www.lerctr.org/~ler/wan_rules.png
https://www.lerctr.org/~ler/LAN_rules.png

Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: Patrick M. Hausen on March 28, 2022, 04:30:39 PM
"Reject private networks" in your interface settings?

You still have not shown a live log entry of a rejected packet.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 28, 2022, 04:33:46 PM
Um, these are *NOT* private IP's.  (192.147.25.0/24, 216.82.192.224/28)

and I don't have one currently and if I turn PF back on, I will *LOSE* access to it, as it's in a colo
20 miles away.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 28, 2022, 06:44:40 PM
@franco any comments here?
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: AdSchellevis on March 28, 2022, 07:55:46 PM
first try to disable reply-to : Firewall: Settings: Advanced --> Disable reply-to

If that doesn't work, try not to comment in capitals (shouting unlikely brings you closer to a solution   :) ) and do as @pmhausen suggested, collect relevant details using live log. Traffic capture is usually also a good tool to see where traffic is heading (download the pcap in wireshark for more details)

Best regards,

Ad
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 28, 2022, 08:02:51 PM
I will try this later this week when I head over to the Colo when I can keep access local.  I've set that option.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: 5SpeedFun on March 29, 2022, 02:48:58 PM
Not direclty as a suggestion to your problem, but I believe opnsense has a serial access option.  If your colo offers OOB serial port access this may make it easier for you to troubleshoot without the possibility of losing connectivity:

https://docs.opnsense.org/manual/how-tos/serial_access.html
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on March 30, 2022, 02:47:15 AM
unfortunately, the colo doesn't provide OOB serial, but thanks for the suggestion.
Title: Re: I've beat my head against the wall: How do I do NO-NAT but HAVE FW rules?
Post by: lrosenman on April 01, 2022, 11:53:49 PM
apparently what I needed was to turn off the REPLY-TO on the WAN -- works a treat now.

Thanks, ALL!