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

    WebDav From Router through Firewall

    NAT
    nat firewall pfsense 2.5
    3
    12
    3.7k
    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.
    • N
      Nasten
      last edited by Nasten

      Hi,
      iam currently trying to set up my WebDav-Access behind my firewall. I need to forward port 5006. The Server is found via DynDNS (handled by synology).
      I uploaded the NAT rules I made (erased the actuall IPs ofc).
      If you have any guidance for my newbe self, I am happy to learn.
      Router(AVM)--->PfSense---->WebDav
      alt text
      alt text

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @Nasten
        last edited by

        @nasten
        You have to forward the traffic on the router to pfSense WAN and on pfSense to the WebDAV server.

        Sou on pfSense you only need a single NAT rule:
        interface: WAN
        destination: WAN address, port: 5006
        redirect: WebDAV server, port: 5006

        The NAT rule on LAN is useless.

        On the router you have to set pfSense as "exposed host" or DMZ.

        N 1 Reply Last reply Reply Quote 0
        • N
          Nasten @viragomann
          last edited by

          @viragomann
          I changed my rule and set my FW as exposed host. but it does not seem to work:
          alt text

          V 1 Reply Last reply Reply Quote 0
          • V
            viragomann @Nasten
            last edited by

            @nasten
            Use Diagnostic > Packet Capture while you try to connect from outside to check whether the packets arrive on pfSense WAN interface at all.

            N johnpozJ 2 Replies Last reply Reply Quote 2
            • N
              Nasten @viragomann
              last edited by

              @viragomann I send you a capture.

              1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator @viragomann
                last edited by johnpoz

                ^ exactly... That really is step 1, if your port forward isn't working... Nothing you do in pfsense will make any difference if the traffic is never getting to pfsense to be able to forward it.

                So if its not working, 1st thing to validate is traffic actually gets to pfsense.

                You can use can you see me . org to test that it gets there.. And that is working even..

                your port 5006 for example Webdav normally would just run on 443... But whatever tcp port your wanting to test/use.. So using your 5006..

                Setup a packet capture on my wan for port 5006, then went to can you see me . org and tested to 5006.. While I knew it would fail, since I don't have anything forwarded on that port.. I can validate via my packet capture that traffic actually got to pfsense wan..

                test.jpg

                btw: How exactly are you testing that this is working or not.. You really need to be testing from outside.. Trying to hit your wan IP from a client on your network to test if your port forward is not valid, and would require nat reflection.. And if your double natted, that would even complicate it more, etc.

                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.7.2, 24.11

                N 1 Reply Last reply Reply Quote 1
                • N
                  Nasten @johnpoz
                  last edited by Nasten

                  @johnpoz @viragomann

                  my Capture:
                  12:42:16.553067 IP someip.33190 > IPWebDavServer: tcp 0
                  12:42:17.583569 IP someip.33190 > IPWebDavServer: tcp 0
                  12:42:19.599888 IP someip.33190 > IPWebDavServer: tcp 0
                  12:42:23.631526 IP someip.33190 > IPWebDavServer: tcp 0
                  12:42:31.822622 IP someip.25376 > IPWebDavServer: tcp 0

                  Testest with RaiDrive from externel network via internet (i use synology nas).

                  johnpozJ 1 Reply Last reply Reply Quote 0
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator @Nasten
                    last edited by johnpoz

                    Where did you do that sniff? Is that pfsense wan? While you show the source port from the someip? You don't show the destination port?

                    If that is your wan, now sniff on the lan side of pfsense - if its sending the traffic to your nas IP.. Then pfsense is doing what you told it to do.. If your nas doesn't answer - then that is on your nas.. Its firewall maybe? Wrong port? Maybe webdav not even running, etc.

                    here: I created the forward to my nas, not running webdav, and nothing else listening on 5006.. Then did the same test from can you see me..

                    Sniffing on the local side of pfsense interface that my nas (192.168.9.10) is connected to you can see pfsense sent the traffic on... But my nas said FU, and sent a RST - connection closed! Because nothing listening on that port.

                    sniff.jpg

                    Port forwarding is working, pfsense clearly sent the traffic on to my nas.. But still not going to work because not running it, but you can see my nas rejected the connection.

                    If your not getting an answer, firewall on the nas maybe just dropped it.. Maybe your not forwarding to the correct IP? etc.. But pfsense did what I told it too..

                    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.7.2, 24.11

                    1 Reply Last reply Reply Quote 1
                    • N
                      Nasten
                      last edited by

                      Indeed, sorry. It arrived at webdav 5006 and i sniffed on wan. I figured the Problem out. Synology need ports 5000 and 5001 aswell to be forwarded. So my NAT was fine just not complete. Thanks for your guidance, it helped me alot.

                      johnpozJ 1 Reply Last reply Reply Quote 0
                      • johnpozJ
                        johnpoz LAYER 8 Global Moderator @Nasten
                        last edited by johnpoz

                        @nasten said in WebDav From Router through Firewall:

                        Synology need ports 5000 and 5001 aswell to be forwarded

                        That is a freaking HORRIBLE idea - just horrible... Have you not been reading about all the synology issues of late?

                        https://www.synology.com/en-global/company/news/article/BruteForce/Synology%C2%AE%20Investigates%20Ongoing%20Brute-Force%20Attacks%20From%20Botnet

                        There should be no reason to expose those ports for webdav, doesn't make any sense.

                        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.7.2, 24.11

                        N 1 Reply Last reply Reply Quote 0
                        • N
                          Nasten @johnpoz
                          last edited by

                          @johnpoz
                          No I did not catch that. I think I'll remove that ports for synology for now. I Could set up my vpn on pf sense so no need for webdav anymore. But was a good task to learn some new stuff.

                          johnpozJ 1 Reply Last reply Reply Quote 0
                          • johnpozJ
                            johnpoz LAYER 8 Global Moderator @Nasten
                            last edited by

                            VPN is much better way to access your resources from remote for sure ;)

                            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.7.2, 24.11

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.