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.
    • JaredBuschJ
      JaredBusch @bnrstnr
      last edited by

      @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?

      Nope

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

        @JaredBusch Do I need to set my Registration to Send in the Trunk settings? Right now I have it at None.

        JaredBuschJ 1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch @bnrstnr
          last edited by

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

          @JaredBusch Do I need to set my Registration to Send in the Trunk settings? Right now I have it at None.

          That is not normal for a Twilio trunk.. If oyu have it at none, then yes, you need to have the port forwarded. Because you are using IP auth.

          But that is not Twilio's recommended method.
          Sec, I'll dig up their instructions.

          1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch
            last edited by JaredBusch

            Here is the page with the guides: https://www.twilio.com/docs/sip-trunking/sample-configuration

            Here is the guide: https://www.twilio.com/docs/documents/53/TwilioElasticSIPTrunking-FreePBX-Configuration-Guide-Version1-0-FINAL-06122018.pdf

            Starting at the bottom of Page 4:
            ee1ba969-4d31-4d28-98a5-ecbbe4dc7ba9-image.png
            af9e785f-aa30-4bb8-9552-d080496736a9-image.png

            You can see here that they say to use Outbound authentication.

            Because of that recommendation, you do not need to open/forward a single port in the firewall.

            1 Reply Last reply Reply Quote 0
            • JaredBuschJ
              JaredBusch
              last edited by JaredBusch

              I'm not sure why it doesn't need registration. But it doesn't.

              b01aa3b6-e5cb-4ad5-9bd5-4572909e64ab-image.png
              fea736bc-23b9-4007-b645-e5dfb5ec885d-image.png

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

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

                I'm not sure why it doesn't need registration. But it doesn't.

                Wait, yes I am. Because these two are not behind NAT anymore.

                So with you using NAT, you probably will need to send registration.

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

                  @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.

                  JaredBuschJ B 2 Replies Last reply Reply Quote 0
                  • JaredBuschJ
                    JaredBusch @scottalanmiller
                    last edited by JaredBusch

                    @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

                    DashrenderD 1 Reply Last reply Reply Quote 0
                    • 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
                                        • 1 / 2
                                        • First post
                                          Last post