• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

PfSense Rule ignored on TCP when communication happens between two directly connected networks

Scheduled Pinned Locked Moved Firewalling
pfsenseroutingblock
7 Posts 3 Posters 634 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    Blebitu
    last edited by Blebitu Apr 29, 2024, 2:32 PM Apr 29, 2024, 2:23 PM

    Hello.
    I'm using proxmox as HV. My pfSense is virtuallized in VM, on version 2.7.2-RELEASE.

    I have two networks:
    LAN (infra): 192.168.10.0/24
    OPT1 (end-users hosts): 192.168.20.0/24

    My PfSense has 3 interfaces WAN,LAN,OPT1, all with IP in <network>.102
    I have a squid proxy with 2 interfaces (one on LAN and another one on OPT1), both in <network>.105.

    I have a Linux infra server on LAN in 192.168.10.107, with it's gateway to my PfSense so 192.168.10.102.
    I have an Windows end-user on OPT1 in 192.168.20.9, with it's gateway to my squid so 192.168.20.105.

    I'm trying to ssh my infra server on 192.168.10.107 from my host on 192.168.20.9 without being able to.
    I can see that my server 192.168.10.107 receives packets and answers to them:

    14:16:26.434519 IP 192.168.20.9.57691 > myserver.ssh: Flags [S], seq 3154545065, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
    14:16:26.434537 IP myserver.ssh > 192.168.20.9.57691: Flags [S.], seq 3458918325, ack 3154545066, win 32120, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
    

    Here it's routes:

    root@myserver:~# ip r
    default via 192.168.10.102 dev eth0 proto static
    192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.107
    

    Somehow, even then I allowed all on my LAN interface in pfSense,
    979463e2-4e0e-4dc5-a80e-058b4cec7c49-image.png
    My traffic is blocked and then dropped:
    66fb4e46-b57b-471a-9c0d-7732118a6df0-image.png

    Do you have any ideas why this behavior ?

    EDIT:
    Even when I add rule via EasyRule (+ button next to my blocked traffic), allow all destination port then apply, rule is not matched. Traffic is still dropped.

    V 1 Reply Last reply Apr 29, 2024, 2:50 PM Reply Quote 0
    • V
      viragomann @Blebitu
      last edited by Apr 29, 2024, 2:50 PM

      @Blebitu said in PfSense Rule ignored on TCP when communication happens between two directly connected networks:

      I have an Windows end-user on OPT1 in 192.168.20.9, with it's gateway to my squid so 192.168.20.105.

      If the proxy is within the same subnet and works in transparent mode, you will run into asymmetric routing issues for sure.

      J 1 Reply Last reply Apr 29, 2024, 2:53 PM Reply Quote 1
      • J
        johnpoz LAYER 8 Global Moderator @viragomann
        last edited by Apr 29, 2024, 2:53 PM

        Yeah as @viragomann points out - seeing blocks for SA screams asymmetrical traffic.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • B
          Blebitu
          last edited by Apr 29, 2024, 3:23 PM

          Okay thanks for the answers !
          My proxy is indeed within the same subnet and works in transparent mode.
          I have to add static routes on my squid proxy then ? When trying to reach my 192.168.10.0/24 network ?
          Or should I add static routes on my pfSense straight away ?

          Anyway I'm gonna look in this asymmetric routing issue :)

          J V 2 Replies Last reply Apr 29, 2024, 3:32 PM Reply Quote 0
          • J
            johnpoz LAYER 8 Global Moderator @Blebitu
            last edited by Apr 29, 2024, 3:32 PM

            @Blebitu routes are most likely not going to help..

            Running anything internally that routes/proxies or vpn sort of connection vs at the edge is going to be problematic with how the data flows, especially with a stateful firewall. And the new change to interface bound states with 24.03, your more likely to see such issues with asymmetrical flow not working how the user expects it too.

            If you send traffic to X, but the answer comes back via Y your going to have problems with a stateful firewall. So in the blocks you show.. Pfsense never saw the syn from 20.9 to 10.107 on port 22.. But it does see the syn,ack from 10.107 to 20.9.. And says hey wait a minute I don't have state for this.. Not going to allow this traffic.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • V
              viragomann @Blebitu
              last edited by Apr 29, 2024, 4:38 PM

              @Blebitu
              Disable the transparent mode in the proxy or redesign your network and put the proxy into a separate network segment and redirect all traffic from the clients to it for filtering.

              J 1 Reply Last reply Apr 29, 2024, 4:42 PM Reply Quote 1
              • J
                johnpoz LAYER 8 Global Moderator @viragomann
                last edited by johnpoz Apr 29, 2024, 4:43 PM Apr 29, 2024, 4:42 PM

                I would concur using it as explicit proxy where your devices actual gateway points to pfsense vs the proxy should remove such issues what what your seeing with that 22 traffic you listed.

                Other option with putting such devices that are really internal to your network on their own transit network can eliminate asymmetrical flow issues.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                1 Reply Last reply Reply Quote 0
                7 out of 7
                • First post
                  7/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received