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

    FreePBX & state table any progress?

    Scheduled Pinned Locked Moved NAT
    22 Posts 7 Posters 8.2k 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.
    • J
      JohnnyBeGood
      last edited by

      @chpalmer:

      Comcast commercial connection?   Then you have to use that modem but-

      Nope, just gold ol' residential  ;D

      I like to fill my tub up with water, then turn the shower on and act like I'm in a submarine that's been hit!

      1 Reply Last reply Reply Quote 0
      • xanaroX
        xanaro
        last edited by

        JohnnyBeGood, That post you mentioned has a script available: http://forum.pfsense.org/index.php/topic,18053.msg106801.html#msg106801

        Will that script not work under 2.0.1?

        I am currently having the same issue. My ISP has a new system that changes my IP address at about 6 hour intervals, the modem itself never even shuts down or restart, I lost internet for a few seconds and when it comes back up my IP address is different, I believe he said its part of their new "Failover" system and that I should not be getting disconnected. It has been a week now and they still have not resolved the problem.

        Every time I lose connectivity and end up with a NEW IP address the asterisk PC doe not re-register, unless I look at the states table on pfsense and delete the two entries for the asterisk PC, also restarting the asterisk PC will make it work again too.

        I was about to try that script perry posted, but I would like to be sure that is going to work for my pfsense version

        2.0.1-RELEASE (i386)
        built on Mon Dec 12 17:53:52 EST 2011
        FreeBSD 8.1-RELEASE-p6

        Any help is appreciated.

        **EDIT! Just found another post: http://forum.pfsense.org/index.php/topic,43112.msg289336.html#msg289336

        Going to try 2.1 snapshot: http://snapshots.pfsense.org/**

        1 Reply Last reply Reply Quote 0
        • xanaroX
          xanaro
          last edited by

          The 2.1 snapshot did not resolve the problem with my asterisk Freepbx PC.

          but if I log into: 192.168.1.1/diag_dump_states.php

          I can delete the two states for the asterisk PC, and within 20 seconds my SIP trunk re registers and everything works again.

          To clarify the link for the Wan/Gateway never goes down, the cable modem never disconnects, it stays online, all lights green, but something happens at my ISP's office/servers, where they change my IP while Im still connected to the internet, whenever they do this any game I am connected to disconnects me as well. When I called tech support about it they said it has to do with thier new failover system that they are testing, but its been a week now, and every time it happens I get a new IP address.

          So does the 2.1 snapshot: system > advanced > miscellaneous  > "flush states for a gateway that goes down"

          Does it only flush the states when the link goes down? If so that may not work for my particular situation as I think its out of the norm. I need something that monitors for a change in the WAN IP address I am thinking.

          Is there a quick and dirty script that could accomplish this? I am just really tired of manually clearing the states to keep my VOIP phone online, its the only phone we use.

          1 Reply Last reply Reply Quote 0
          • J
            JohnnyBeGood
            last edited by

            Thanks for the reply but i haven't found anything that solves this issues. Is your ISP Comcast?

            I like to fill my tub up with water, then turn the shower on and act like I'm in a submarine that's been hit!

            1 Reply Last reply Reply Quote 0
            • xanaroX
              xanaro
              last edited by

              My ISP is Hood Canal communications, they lease their connection through comcast though.

              I gave this a try from the last post, but it did not get the SIP to re register either:
              http://forum.pfsense.org/index.php/topic,18053.msg198634.html#msg198634

              here is some discussion I had before coming here from over at FreePBX forums:
              http://www.freepbx.org/forum/freepbx/general-help/restart-computer-script-after-internet-outage

              The 2.1 snapshot did not resolve this issue for me either, I am really at a loss.

              1 Reply Last reply Reply Quote 0
              • xanaroX
                xanaro
                last edited by

                Also, on that thread: http://forum.pfsense.org/index.php/topic,18053.msg198634.html#msg198634

                I tried issueing that command from the PFsense Shell,

                pfctl -b 204.155.28.10

                and that command does actually fix my SIP registration on my FREEPBX machine, in the post he has you add the line that fires it to: '/usr/local/sbin/ppp-linkup' which im assuming that file gets ran every time the link is up? but if with my issue the link never really goes down and its just my ISP doing shifty things that change my IP address and cause me to drop connection to whatever server im connected to(I always lose connection to WOW/Diablo 3 when they do it and I have to reconnect) then that file may never get called.

                Is there any file/script that gets ran when the WAN/GATEWAY  IP changes? If so then I could have the script that runs 'pfctl -b 204.155.28.10' triggered from there

                1 Reply Last reply Reply Quote 0
                • J
                  jobsoft
                  last edited by

                  I have the same issue, BUT i do not believe this mine is state table related.  I have cable internet and even though my IP address is "dynamic", I've had the same WAN IP address for over a year now. However, I do run siproxd as I have numerous internal SIP devices that connect to more than one external SIP provider. And on Outbound NAT, i have "static ports = no" as I found setting it to yes seemed to hose up siproxd's functions. I haven't run packet captures yet on the LAN and WAN ports, so still need to do that.  When i purge the state table of any SIP related entries, it does NOT work. When I flush the entire state table, it still does not work. I can then restart siproxd, and still no go. HOWEVER, if I reboot the pfSense server, it starts working again.  It may go a fews hours to as long as 72+ hours before "request sent" shows back up in the asterisk sip registry for my provider. Odd thing is that NONE of the internal SIP devices setup to go through siproxd ever lock up. Only the sip registration from the asterisk server (FreePBX Distro now, but it did it with the other asterisk setups I tried - and I do have nat=yes, qualify=yes and the extern_ip all setup). My pfSense is:

                  2.0.1-RELEASE (i386)
                  built on Mon Dec 12 18:24:17 EST 2011
                  FreeBSD 8.1-RELEASE-p6

                  I haven't tried the latest yet. Though my asterisk server bypasses siproxd (I'm pretty sure, at least it does not show up in its registration table), I suspect that the issue may have something to do with siproxd and/or "static ports = no". At my office site, I have same version of pfsense and asterisk, and I do NOT use siproxd and "static ports = yes" for outbound NAT. I also have a 1:1 NAT mapping from an external IP to my asterisk server there too. My Asterisk can connect to the SAME SIP provider (that times out at my house ) all day long and long periods of time (in fact, it rarely fails to register). So, most things being equal, these basic differences must have something to do with this thread's issue as it applies to me (and maybe some of the others reading this). I need to do the packet captures, but wanted to chime in as this has been a pain the rear for some time now. I usually just reboot my home pfsense, but now would like to finally knuckle down and resolve it.

                  Side note edit: Another client of mine's office has the exact same setup of asterisk and pfsense as mine except he has no 1:1 NAT mappings, and like at my office, his SIP registrations to this same SIP provider never have problems either, so I don't think 1:1 NAT mapping is factor here.

                  Edit #2: I forgot to add that I can also restart Asterisk as a whole ("amportal restart" under FreePBX) and still no go.  The only solution I have found that works consistently is to reboot pfsense.

                  Thanks!

                  1 Reply Last reply Reply Quote 0
                  • D
                    dhatz
                    last edited by

                    Have you tried using DynDNS to monitor your WAN ?

                    1 Reply Last reply Reply Quote 0
                    • J
                      jobsoft
                      last edited by

                      Can you elaborate please?  Thanks!

                      1 Reply Last reply Reply Quote 0
                      • D
                        dhatz
                        last edited by

                        I haven't tested it personally, but I had jimp's recent comment in mind about the improved dyndns on 2.1:

                        This is already done on 2.1 during a dyndns update. If it detects the IP has changed, it will send a notification that it changed. If you have smtp notifications enabled, that means it will send you an e-mail when it happens.
                        http://forum.pfsense.org/index.php/topic,51413.msg275400.html#msg275400

                        I assumed that this also meant that if pfsense's dyndns detects the IP has changed, it'll also flush any states associated with the old gateway.

                        1 Reply Last reply Reply Quote 0
                        • jimpJ
                          jimp Rebel Alliance Developer Netgate
                          last edited by

                          DynDNS wouldn't be the one flushing states.

                          rc.newwanip will flush states when an IP changes
                          rc.newwanip will update dyndns when an IP changes

                          Both are separate independent actions taken by rc.newwanip.

                          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                          Need help fast? Netgate Global Support!

                          Do not Chat/PM for help!

                          1 Reply Last reply Reply Quote 0
                          • D
                            dhatz
                            last edited by

                            I guess that works fine if WAN is PPPoE, but what if the external IP changes without a link-down/up event ? (as apparently is the case for the people posting here).

                            1 Reply Last reply Reply Quote 0
                            • jimpJ
                              jimp Rebel Alliance Developer Netgate
                              last edited by

                              rc.newwanip runs in any case where the IP can change: pppoe, dhcp, manual, etc.

                              There isn't a case where the IP can change that the script doesn't already run that I'm aware of.

                              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                              Need help fast? Netgate Global Support!

                              Do not Chat/PM for help!

                              1 Reply Last reply Reply Quote 0
                              • J
                                jobsoft
                                last edited by

                                But my IP address is the same as it has been for well over a year now.  So, I'm not sure I am having any IP address changing. However, I did see here or somewhere that come cable ISPs (like, mine, Comcast) are doing some "failover" node testing in the overnight hours. If I understood it correctly, the IP address change is momentary. It also might explain why my Putty session from my house to my office tends to get reset (dropped) sometime between 1am and 4am most nights. I did run some tcpdumps on the LAN and WAN interfaces on my home pfsense this morning when it was timing out and the again after I rebooted pfsense and it started working. I will look at those tonight and post what I see here.  I should also be able to look at the asterisk log and see when it starts failing again and see if the timing coincides with the putty drop. I will look at these scripts too. Clearly, I'm not the only one having this problem. But, like I said, it has to involve siproxd and/or static ports = no, because on my office (which has same comcast service) pfsense, I NEVER have this problem (san siproxd and static ports = yes).

                                1 Reply Last reply Reply Quote 0
                                • luckman212L
                                  luckman212 LAYER 8
                                  last edited by

                                  Can I call 'pfctl -b' from the shell?  I'm running 2.1 snapshot and when I try to run it I get an "illegal option – b" error. ??

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    dhatz
                                    last edited by

                                    @luckman212:

                                    Can I call 'pfctl -b' from the shell?  I'm running 2.1 snapshot and when I try to run it I get an "illegal option – b" error. ??

                                    The new syntax (note: pfsense-specific) has become
                                    pfctl -i em0 -Fs -G gwip

                                    Check http://redmine.pfsense.org/issues/1629

                                    1 Reply Last reply Reply Quote 0
                                    • luckman212L
                                      luckman212 LAYER 8
                                      last edited by

                                      Thanks, it isn't quite clear to me the difference between

                                      pfctl -i em4 -Fs

                                      and

                                      pfctl -i em0 -Fs -G gwip

                                      can you just elaborate a tiny bit more?

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