ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Solved FreePBX fail2ban or SIP provider whitelist on router?

    IT Discussion
    freepbx freepbx adaptive firewall
    5
    21
    1.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.
    • DashrenderD
      Dashrender @JaredBusch
      last edited by

      @JaredBusch said in FreePBX fail2ban or SIP provider whitelist on router?:

      @scottalanmiller said in FreePBX fail2ban or SIP provider whitelist on router?:

      @bnrstnr said in FreePBX fail2ban or SIP provider whitelist on router?:

      @JaredBusch said in FreePBX fail2ban or SIP provider whitelist on router?:

      Twilio uses SIP registration, so you need to open nothing inbound.

      So forwarding port 5060 to my PBX isn't necessary?

      That's pretty normal. Your PBX sets up the channel, not Twilio. It doesn't connect out to you to set up the channel. So there is no need for inbound. Like VLANs for VoIP, loads of people repeat the myth of port forwarding. But it's relatively rare that you need that for the PBX, and "never" for phones themselves.

      Port forwarding is absolutely required if you have external phones. Unless you go VPN.

      Be clear on what you are stating @scottalanmiller

      yeah - I was getting stumped on what exactly Scott was saying there.

      1 Reply Last reply Reply Quote 0
      • B
        bnrstnr @scottalanmiller
        last edited by

        @scottalanmiller said in FreePBX fail2ban or SIP provider whitelist on router?:

        Your PBX sets up the channel, not Twilio. It doesn't connect out to you to set up the channel.

        Twilio doesn't connect to me to setup the channel when there's an incoming/originating call?

        I don't see how they could ever connect to my PBX if it's behind NAT without either a VPN or the port being forwarded.

        JaredBuschJ DashrenderD scottalanmillerS 3 Replies Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch @bnrstnr
          last edited by

          @bnrstnr said in FreePBX fail2ban or SIP provider whitelist on router?:

          @scottalanmiller said in FreePBX fail2ban or SIP provider whitelist on router?:

          Your PBX sets up the channel, not Twilio. It doesn't connect out to you to set up the channel.

          Twilio doesn't connect to me to setup the channel when there's an incoming/originating call?

          I don't see how they could ever connect to my PBX if it's behind NAT without either a VPN or the port being forwarded.

          That is the point of registration. The PBX sends out a registration and then maintains that port reference. Calls are sent inbound to that IP and port. Magic using standard NAT.

          SkyetelS 1 Reply Last reply Reply Quote 0
          • DashrenderD
            Dashrender @bnrstnr
            last edited by Dashrender

            @bnrstnr said in FreePBX fail2ban or SIP provider whitelist on router?:

            @scottalanmiller said in FreePBX fail2ban or SIP provider whitelist on router?:

            Your PBX sets up the channel, not Twilio. It doesn't connect out to you to set up the channel.

            Twilio doesn't connect to me to setup the channel when there's an incoming/originating call?

            I don't see how they could ever connect to my PBX if it's behind NAT without either a VPN or the port being forwarded.

            No it doesn't. Your PBX already had an open line of communication, and that is used.

            1 Reply Last reply Reply Quote 1
            • scottalanmillerS
              scottalanmiller @bnrstnr
              last edited by

              @bnrstnr said in FreePBX fail2ban or SIP provider whitelist on router?:

              @scottalanmiller said in FreePBX fail2ban or SIP provider whitelist on router?:

              Your PBX sets up the channel, not Twilio. It doesn't connect out to you to set up the channel.

              Twilio doesn't connect to me to setup the channel when there's an incoming/originating call?

              I don't see how they could ever connect to my PBX if it's behind NAT without either a VPN or the port being forwarded.

              No, you connect to them. The connection is always there, it doesn't get set up at the time of a call. It is a trunk. You are thinking of HTTP which sets up a new connection for every interaction. Very different.

              1 Reply Last reply Reply Quote 0
              • SkyetelS
                Skyetel @JaredBusch
                last edited by

                SIP Registration keeps the UDP ports open only for so long (I believe the ERL defaults to 90 seconds). So long as your registrations occurs on regular intervals that are lower than the UDP timeout, your port is effectively being forwarded automatically. Some routers do this much better than others - ERLs are pretty great and we recommend them. SonicWalls are the devices that we have the biggest headache with. If you can, enable NAT timeout on the PBX and keep that frequency low - that will keep the UDP port open forever and does take care of most problems with Port Forwarding. (Though I still prefer Fort Forwarding!)

                When the PBX registers to the server/carrier, it gets the public IP information from the registration request and add its it to the call routing. You have to be careful though - just because you can receive calls doesn't mean you will have audio available - those can come on different ports and from different Public IPs. Smarter routers (like the ERL) understand the context of the transmission because they understand the dual-method involved in VoIP (RTP and SIP) and can fix mistakes other routers cant.

                1 Reply Last reply Reply Quote 2
                • B
                  bnrstnr
                  last edited by bnrstnr

                  Getting rid of my silly double NAT setup fixed my SIP registration with Twilio. Apparently there was a SIP ALG setting in my ISP provided modem/router, too. :man_facepalming: Not sure exactly which of the two was the culprit, but either way, both were bad.

                  Everything is working great again without the port forwarding.

                  scottalanmillerS 1 Reply Last reply Reply Quote 4
                  • scottalanmillerS
                    scottalanmiller @bnrstnr
                    last edited by

                    @bnrstnr SIP-ALG in ISP provided gear is nearly universal.

                    B 1 Reply Last reply Reply Quote 1
                    • B
                      bnrstnr @scottalanmiller
                      last edited by

                      @scottalanmiller said in FreePBX fail2ban or SIP provider whitelist on router?:

                      @bnrstnr SIP-ALG in ISP provided gear is nearly universal.

                      Guh, who would have thought... Is SIP-ALG purely sabotage or is it useful in certain scenarios?

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @bnrstnr
                        last edited by

                        @bnrstnr said in FreePBX fail2ban or SIP provider whitelist on router?:

                        @scottalanmiller said in FreePBX fail2ban or SIP provider whitelist on router?:

                        @bnrstnr SIP-ALG in ISP provided gear is nearly universal.

                        Guh, who would have thought... Is SIP-ALG purely sabotage or is it useful in certain scenarios?

                        Actually sabotage. Ubiquiti is the only vendor that I know where it works most of the time.

                        Most firewall vendors are also either phone companies or in bed with phone companies and have a huge interest in convincing people that other phone products don't work reliably.

                        1 Reply Last reply Reply Quote 1
                        • 1
                        • 2
                        • 2 / 2
                        • First post
                          Last post