The pfSense Store

Author Topic: [SOLVED] Curious Floating Rules Behavior  (Read 724 times)

0 Members and 1 Guest are viewing this topic.

Offline Kryptos1

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +2/-0
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #30 on: November 22, 2017, 07:15:23 am »


"egress" is "OUT of an interface." WAN or LAN, inside or outside, doesn't matter. It is traffic transmitted by an interface going out of (aka eggressing) the firewall.




So long as you don't associate the above as having anything to do with the "OUT" direction under floating rules, then I agree. If you're saying that it does and that "OUT" is OUTbound/egress traffic then it's simply not correct. And this confusion keeps perpetuating on these forums because people are posting stuff they dont really understand.

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9220
  • Karma: +1048/-308
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #31 on: November 22, 2017, 07:17:32 am »
That is exactly what it means in floating rules. That is exactly what your tests showed.

Maybe I will take that $500. Let's make that 0.0625 bitcoin before you try to pay in zim dollars or something.
« Last Edit: November 22, 2017, 07:24:36 am by Derelict »
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline Kryptos1

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +2/-0
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #32 on: November 22, 2017, 07:25:34 am »
That is exactly what it means in floating rules. That is exactly what your tests showed.

Maybe I will take that $500.

So just to be absolutely clear, if you're saying then that "OUT" in floating rules applies to egress/outbound traffic, then I'm all for doing a conference with you. My test #2 showed that OUT is NOT egress outbound traffic - it is the direction of traffic relative to the interface. So if you'r still up fo it citing "Maybe I will take that $500." lets arrange for a time this weekend or next.

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9220
  • Karma: +1048/-308
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #33 on: November 22, 2017, 07:31:42 am »
See there you go again. Can you not read? We are both saying that OUT is RELATIVE TO THE INTERFACE. You keep bandying about this nonsense about "egress outbound traffic."

Please define "egress outbound traffic" so everyone knows wtf you are talking about.

There is a diagram in my signature. Use that as a reference when you describe it.

It is per interface, nobody has ever said any different.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline Kryptos1

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +2/-0
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #34 on: November 22, 2017, 07:35:59 am »
See there you go again. Can you not read? We are both saying that OUT is RELATIVE TO THE INTERFACE. You keep bandying about this nonsense about "egress outbound traffic."

Please define "egress outbound traffic" so everyone knows wtf you are talking about.

There is a diagram in my signature. Use that as a reference when you describe it.

It is per interface, nobody has ever said any different.

Gotta go to work, but Ill respond tonight/tomorrow. I feel like Bill Nye debating Ken Ham with comments like "Can you not read?".

Online johnpoz

  • Hero Member
  • *****
  • Posts: 14439
  • Karma: +1336/-200
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #35 on: November 22, 2017, 07:36:52 am »
"Specifically, citing "green  is outbound (egress).." is a total contradiction to the drawing you posted. That green arrow is not "OUTbound", it is OUTside relative the the LAN. "

I suggest you research ingress and egress.  These are standard networking 101 terms that if you do not grasp your going to have a hard time of it. 


edit:  Lets try it another way.  A nic or even a port on a switch is like putting a door on a house..  With pfsense or the switch being the house.  If the traffic is going into the interface from the network it is ingress - your going into the house..  if the traffic exiting the nic towards the network then its egress (leaving the house)..
« Last Edit: November 22, 2017, 07:44:30 am by johnpoz »
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x SG-4860 2.4.2-RELEASE (home)

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9220
  • Karma: +1048/-308
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #36 on: November 22, 2017, 07:40:03 am »
Good God, man. If there was confusion before you have only compounded it.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Online johnpoz

  • Hero Member
  • *****
  • Posts: 14439
  • Karma: +1336/-200
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #37 on: November 22, 2017, 07:59:48 am »
Here maybe this video will help ;)

https://youtu.be/u-rkp7iuJ_w

- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x SG-4860 2.4.2-RELEASE (home)

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9220
  • Karma: +1048/-308
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #38 on: November 22, 2017, 08:27:49 am »
Even that video confuses outside/inside.

Unless you're talking about outside/inside the firewall.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Online johnpoz

  • Hero Member
  • *****
  • Posts: 14439
  • Karma: +1336/-200
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #39 on: November 22, 2017, 08:51:51 am »
Outside is always the wire..  Connected to the nic/port..  When your talking ingress/egress to a port/nic
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x SG-4860 2.4.2-RELEASE (home)

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9220
  • Karma: +1048/-308
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #40 on: November 22, 2017, 01:32:46 pm »
I disagree.

When talking outside/inside in a firewall context outside is untrusted and inside is trusted... in general terms. Toss in dmz as another branch if you like.

Everything on every interface is "on the wire" at some point. Outside/inside have special meaning.

Traffic/connections on a NIC is either received (inbound) or transmitted (outbound).
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Online johnpoz

  • Hero Member
  • *****
  • Posts: 14439
  • Karma: +1336/-200
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #41 on: November 22, 2017, 01:43:57 pm »
"Traffic/connections on a NIC is either received (inbound) or transmitted (outbound)."

Well stated... But the wire that plugs into the nic is always 'outside" the device... Traffic is either put on the wire from the device, egress.. Or in to the device from the wired - ingress..

Agree you have to be clear on what context your talking with a firewall when you say outside inside.. But thought the question was in/out of an interface.. ingress, egress.. Where the rules apply - so the context seems to be clear..
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x SG-4860 2.4.2-RELEASE (home)

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9220
  • Karma: +1048/-308
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #42 on: November 22, 2017, 02:19:33 pm »
Clear to everyone except....
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline wussupi83

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #43 on: November 22, 2017, 04:02:51 pm »
No, it controls traffic in the outbound direction on that interface. It has zero to do with whether the interface is considered to be "inside" or "outside" as is generally referred to in firewall/ASA terms.

The second example in that test sheet confirms pfsense does not behave that way. Anyone can prove it to themselves by simply 1) starting with a factory install of pfsense 2), place two machines on two different interfaces, 3) create a floating rule specifying the LAN only (this is key because you're testing how pfsense processes OUT vs IN  packets), all Ipv4, enabled quick match, and action of drop, 4) on the OPT interface, create a normal rule under the interface tab to pass all traffic ANY to ANY (which ensures pfSense's default policy of drop doesn't interfere with the test). Then simply test all three directions (all, in, out) by passing a packets from the OPT station to the LAN and vice versa.

When testing the OUT direction on the floating rule, packets originating from the OPT to the LAN station DROP - because they are OUT[side] relative the the LAN.

When testing the ANY direction on the floating rule, packets originating from the OPT to the LAN station DROP - because they include packets that are OUT[side] relative the the LAN.

When testing the IN direction on the floating rule, packets originating from the OPT to the LAN station PASS - because they are not OUT[side] relative the the LAN (i.e. the rule simply doesn't apply).

Remember, the floating rule didn't even specify the OPT at all - thus "OUT[bound]" couldn't possibly be "OUT[bound]". The second test proves this, that the floating rule does not process packets as being "OUT[bound]" but rather OUT[side] (i.e. the direction of the packet relative to the interface that's been selected in the floating rule's config.)

Quote
"When testing the OUT direction on the floating rule, packets originating from the OPT to the LAN station DROP -because they are OUT[side] relative the the LAN."
- because they are passed from the OPT client to (INBOUND) the OPT interface and then routed to the LAN interface which sends them OUTBOUND to their destination. Because they are heading OUTBOUND from the LAN interface, they meet the OUTBOUND "drop" LAN floating rule criteria and are dropped.

Code: [Select]
[PFSENSE BOX]     OPT INTERFACE (ADDRESS)  <---     OPT CLIENT (NET)    =    (INBOUND TO OPT INTERFACE)
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)   --->    LAN CLIENT (NET)    =    (OUTBOUND FROM LAN INTERFACE) = DROP BECAUSE RULE APPLIES TO OUTBOUND PACKETS
&
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)  <---     LAN CLIENT (NET)    =    (INBOUND TO LAN INTERFACE) = PASS PACKET OUT (OUTBOUND) THE LAN INTERFACE BECAUSE MY LOGIC TELLS ME TO "PASS OUT" PACKETS  MEETING THIS RULE.
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)   --->    LAN (NET)           =    (OUTBOUND FROM THE LAN INTERFACE) = YOU MUST EXCLUDE LAN NET FROM SOURCE IN THE RULE TO AVOID THIS STEP.



Quote
"When testing the ANY direction on the floating rule, packets originating from the OPT to the LAN station DROP - because they include packets that are OUT[side] relative the the LAN."
- same as above but will also drop packets originating from a LAN client heading to (INBOUND) the LAN interface.

Code: [Select]
[PFSENSE BOX]     OPT INTERFACE (ADDRESS)  <---     OPT CLIENT (NET)    =    (INBOUND TO OPT INTERFACE)
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)   --->    LAN CLIENT (NET)    =    (OUTBOUND FROM LAN INTERFACE) = DROP BECAUSE RULE APPLIES TO EITHER INBOUND OR OUTBOUND (ANY) PACKETS
&
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)  <---     LAN CLIENT (NET)    =    (INBOUND TO LAN INTERFACE) = DROP BECAUSE RULE APPLIES TO EITHER EITHER INBOUND OR OUTBOUND (ANY) PACKETS


Quote
"When testing the IN direction on the floating rule, packets originating from the OPT to the LAN station PASS - because they are not OUT[side] relative the the LAN (i.e. the rule simply doesn't apply)."
- because they are passed from the OPT client to (INBOUND) the OPT interface and then routed to the LAN interface which sends them OUTBOUND to their destination. Because they are heading OUTBOUND from the LAN interface, they do not meet the INBOUND "drop" LAN floating rule criteria and are passed.

Code: [Select]
[PFSENSE BOX]     OPT INTERFACE (ADDRESS)  <---     OPT CLIENT (NET)    =    (INBOUND TO OPT INTERFACE)
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)   --->    LAN CLIENT (NET)    =    (OUTBOUND FROM LAN INTERFACE) = PASS BECAUSE RULE APPLIES TO INBOUND PACKETS ONLY, THIS PACKET IS OUTBOUND
&
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)  <---     LAN CLIENT (NET)    =    (INBOUND TO LAN INTERFACE) = DROP BECAUSE RULE APPLIES TO INBOUND
« Last Edit: November 22, 2017, 06:49:08 pm by wussupi83 »

Offline Kryptos1

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +2/-0
    • View Profile
Re: Curious Floating Rules Behavior
« Reply #44 on: November 24, 2017, 05:49:08 am »
No, it controls traffic in the outbound direction on that interface. It has zero to do with whether the interface is considered to be "inside" or "outside" as is generally referred to in firewall/ASA terms.

The second example in that test sheet confirms pfsense does not behave that way. Anyone can prove it to themselves by simply 1) starting with a factory install of pfsense 2), place two machines on two different interfaces, 3) create a floating rule specifying the LAN only (this is key because you're testing how pfsense processes OUT vs IN  packets), all Ipv4, enabled quick match, and action of drop, 4) on the OPT interface, create a normal rule under the interface tab to pass all traffic ANY to ANY (which ensures pfSense's default policy of drop doesn't interfere with the test). Then simply test all three directions (all, in, out) by passing a packets from the OPT station to the LAN and vice versa.

When testing the OUT direction on the floating rule, packets originating from the OPT to the LAN station DROP - because they are OUT[side] relative the the LAN.

When testing the ANY direction on the floating rule, packets originating from the OPT to the LAN station DROP - because they include packets that are OUT[side] relative the the LAN.

When testing the IN direction on the floating rule, packets originating from the OPT to the LAN station PASS - because they are not OUT[side] relative the the LAN (i.e. the rule simply doesn't apply).

Remember, the floating rule didn't even specify the OPT at all - thus "OUT[bound]" couldn't possibly be "OUT[bound]". The second test proves this, that the floating rule does not process packets as being "OUT[bound]" but rather OUT[side] (i.e. the direction of the packet relative to the interface that's been selected in the floating rule's config.)

Quote
"When testing the OUT direction on the floating rule, packets originating from the OPT to the LAN station DROP -because they are OUT[side] relative the the LAN."
- because they are passed from the OPT client to (INBOUND) the OPT interface and then routed to the LAN interface which sends them OUTBOUND to their destination. Because they are heading OUTBOUND from the LAN interface, they meet the OUTBOUND "drop" LAN floating rule criteria and are dropped.

Code: [Select]
[PFSENSE BOX]     OPT INTERFACE (ADDRESS)  <---     OPT CLIENT (NET)    =    (INBOUND TO OPT INTERFACE)
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)   --->    LAN CLIENT (NET)    =    (OUTBOUND FROM LAN INTERFACE) = DROP BECAUSE RULE APPLIES TO OUTBOUND PACKETS
&
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)  <---     LAN CLIENT (NET)    =    (INBOUND TO LAN INTERFACE) = PASS PACKET OUT (OUTBOUND) THE LAN INTERFACE BECAUSE MY LOGIC TELLS ME TO "PASS OUT" PACKETS  MEETING THIS RULE.
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)   --->    LAN (NET)           =    (OUTBOUND FROM THE LAN INTERFACE) = YOU MUST EXCLUDE LAN NET FROM SOURCE IN THE RULE TO AVOID THIS STEP.



Quote
"When testing the ANY direction on the floating rule, packets originating from the OPT to the LAN station DROP - because they include packets that are OUT[side] relative the the LAN."
- same as above but will also drop packets originating from a LAN client heading to (INBOUND) the LAN interface.

Code: [Select]
[PFSENSE BOX]     OPT INTERFACE (ADDRESS)  <---     OPT CLIENT (NET)    =    (INBOUND TO OPT INTERFACE)
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)   --->    LAN CLIENT (NET)    =    (OUTBOUND FROM LAN INTERFACE) = DROP BECAUSE RULE APPLIES TO EITHER INBOUND OR OUTBOUND (ANY) PACKETS
&
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)  <---     LAN CLIENT (NET)    =    (INBOUND TO LAN INTERFACE) = DROP BECAUSE RULE APPLIES TO EITHER EITHER INBOUND OR OUTBOUND (ANY) PACKETS


Quote
"When testing the IN direction on the floating rule, packets originating from the OPT to the LAN station PASS - because they are not OUT[side] relative the the LAN (i.e. the rule simply doesn't apply)."
- because they are passed from the OPT client to (INBOUND) the OPT interface and then routed to the LAN interface which sends them OUTBOUND to their destination. Because they are heading OUTBOUND from the LAN interface, they do not meet the INBOUND "drop" LAN floating rule criteria and are passed.

Code: [Select]
[PFSENSE BOX]     OPT INTERFACE (ADDRESS)  <---     OPT CLIENT (NET)    =    (INBOUND TO OPT INTERFACE)
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)   --->    LAN CLIENT (NET)    =    (OUTBOUND FROM LAN INTERFACE) = PASS BECAUSE RULE APPLIES TO INBOUND PACKETS ONLY, THIS PACKET IS OUTBOUND
&
[PFSENSE BOX]     LAN INTERFACE (ADDRESS)  <---     LAN CLIENT (NET)    =    (INBOUND TO LAN INTERFACE) = DROP BECAUSE RULE APPLIES TO INBOUND

Hello wussupi83,

You nailed it. The green boxes show the area where everyone is trying to say the same thing using different terms. "Outside" to me is whatever is "plug[ed] into the nic is always 'outside" as cited by johnpoz; "Outside is always the wire.. Connected to the nic/port..". Derelict associates "outside/inside" to mean trusted vs untrusted. Whatever the case, In/Out under floating rules are directions relative to the interface.