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

    Gateway drops and never comes back

    Scheduled Pinned Locked Moved Routing and Multi WAN
    42 Posts 8 Posters 10.7k 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.
    • S
      SteveITS Galactic Empire @Ludo9176
      last edited by

      @ludo9176 If the patch in the above mentioned redmine didn't fix your issue you could post your solution in the redmine for devs to review.

      Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
      When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
      Upvote ๐Ÿ‘ helpful posts!

      L 1 Reply Last reply Reply Quote 0
      • L
        Ludo9176 @SteveITS
        last edited by

        @steveits Sorry, didn't know where to find this. Thanks.

        1 Reply Last reply Reply Quote 0
        • M
          MindTwist
          last edited by

          This is still an ongoing issue for me. Not a big deal, but I really would not feel confortable myself telneting on my pfSense boxes and manually editing some files (those changes I guess might be loss when pfSense updates itself?)

          Running 22.05-RELEASE, and the issue is a described above. When a WAN connection with fixed IP goes down, it will come back up, but still appear as offline on pfSense until I change the monitor IP to something else.

          My quick fix would be to just leave my ISP router IP as the monitor IP for that WAN connection, but of course then pfSense would not notice when the connection is really down (it rarely happens anyway).

          S L 2 Replies Last reply Reply Quote 0
          • S
            SteveITS Galactic Empire @MindTwist
            last edited by

            @mindtwist You can use the System Patches package and enter the ID for the patch (ec73bb89489d830ec21c4e04ffa3ec401791b55d) and it will update the files.

            I'm curious, does it work if you view the System\Routing\Gateways page or only if you change the IP? 2-3 years ago there was a similar issue but viewing the page fixed it so we set up a cron to run every so often...don't recall without looking but I think it called a function.

            Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
            When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
            Upvote ๐Ÿ‘ helpful posts!

            M 1 Reply Last reply Reply Quote 0
            • L
              Ludo9176 @MindTwist
              last edited by Ludo9176

              @mindtwist : I confirm this change is permanent (I tested it, it survives a reboot), until an OS upgrade of course.
              If you really don't feel comfortable, you may backup the original file, and work on a copy, so that you can restore it in case something goes wrong (WinSCP is perfect for this). But adding a single line is not a big deal, it's easy to revert. ;-)

              @SteveITS : I tried the patch you mentioned, it actually doesn't work. Fortunately, the files are very well commented (thanks to the devs !), which make them quite easy to understand. The issue comes from the fact that dpinger is reset only when the new WAN IP is different from the previous one, whereas it would need to be even if the IP is the same (because of firewall states). This is corrected by adding this only code line.

              M 1 Reply Last reply Reply Quote 0
              • M
                MindTwist @SteveITS
                last edited by

                @steveits said in Gateway drops and never comes back:

                I'm curious, does it work if you view the System\Routing\Gateways page or only if you change the IP? 2-3 years ago there was a similar issue but viewing the page fixed it so we set up a cron to run every so often...don't recall without looking but I think it called a function.

                The interface does come back online just by going to System/Routing/Gateways, hitting "Save", and then "Apply". I do not need to change the IP, but I do have to do a Save/Apply.

                1 Reply Last reply Reply Quote 0
                • M
                  MindTwist @Ludo9176
                  last edited by

                  @ludo9176 said in Gateway drops and never comes back:

                  @mindtwist : I confirm this change is permanent (I tested it, it survives a reboot), until an OS upgrade of course.
                  If you really don't feel comfortable, you may backup the original file, and work on a copy, so that you can restore it in case something goes wrong (WinSCP is perfect for this). But adding a single line is not a big deal, it's easy to revert. ;-)

                  I am not even sure what is the file I have to modify, or what change to apply.

                  I think I need to make the change scottmsilver posted on 16/Dic/21 on line 204 of rc.newwanip, but I am unable to find that rc.newwanip file.

                  L S 3 Replies Last reply Reply Quote 0
                  • L
                    Ludo9176 @MindTwist
                    last edited by Ludo9176

                    @mindtwist : I hadn't read @scottmsilver message, didn't go backwards enough in the thread... this is almost the same solution indeed, at least same cause identified.

                    1 Reply Last reply Reply Quote 0
                    • S
                      SteveITS Galactic Empire @MindTwist
                      last edited by

                      @mindtwist /etc/rc.newwanip as mentioned above, or apply the patch and not edit any files by hand.

                      Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                      When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                      Upvote ๐Ÿ‘ helpful posts!

                      1 Reply Last reply Reply Quote 0
                      • L
                        Ludo9176 @MindTwist
                        last edited by Ludo9176

                        @mindtwist : Install WinSCP (if you run Windows), log in pfSense (using LAN IP, port 22, admin credentials), and browse to /etc. The file will be here.
                        If you run PFS v2.6.0, the line to modify is not 204 any more, but 214.

                        1 Reply Last reply Reply Quote 0
                        • M
                          MindTwist
                          last edited by

                          I am running PFS v22.05-RELEASE.

                          Ok, I think I got it figurd it out now. I do not know why, but I was actually looking for /src/etc/rc.newwanip. So I first created a copy of /etc/rc.newwanip as /etc/rc.newwanip.backup, just in case.

                          And then used the integrated file editor on Diagnostics/Edit file, on /etc/rc.newwanip I have on line 214:
                          if (!is_ipaddr($oldip) || ($curwanip != $oldip) || file_exists("{$g['tmp_path']}/{$interface}_upstart4") ||

                          I changed it to:
                          if (/added/ 1 || !is_ipaddr($oldip) || ($curwanip != $oldip) || file_exists("{$g['tmp_path']}/{$interface}_upstart4") ||

                          I power cycled my WAN2 router, and checked that it still does not come back to life :(
                          So just in case, I also reboot my PFS, and make sure that the change on line 214 of /etc/rc.newwanip is still there. Check again, and WAN2 still stays down with "Offline, Packetloss" when it is already up.

                          Going to System/Routing/Gateways and hitting Save+Apply brings it back, so it seems nothing has changed.

                          So I go the other route; undo the change on line 214, I add the "setup_gateways_monitor();" at the end. Try again power cycling WAN2, and same results, it will stay on "Offline, Packetloss".

                          Captura.JPG

                          Oh boy, do I suck at this... :(

                          S L 2 Replies Last reply Reply Quote 0
                          • S
                            scottmsilver @MindTwist
                            last edited by

                            @mindtwist

                            First, I do want to try to redirect you to the post up-thread where you can apply a patch that probably makes this fix correctly. Though I have been safely using my changes for a long time, I don't use all the features of pfSense, so I'm sure my fix isn't without collateral damage

                            Second, if you want to use my changes, It looks like you are missing the asterisks around the comment "added."

                            To fix this you can:

                            1. delete the word and the slashes around added, as it is just a comment
                            2. make it a comment by adding the asterisks e.g. /* added */ vs /added/
                            M 1 Reply Last reply Reply Quote 0
                            • L
                              Ludo9176 @MindTwist
                              last edited by

                              @mindtwist :
                              I'm thinking of something : have you specified monitor IPs for your WAN connections ? Or did you let the default gateway IPs ?

                              1 Reply Last reply Reply Quote 0
                              • M
                                MindTwist @scottmsilver
                                last edited by

                                @scottmsilver said in Gateway drops and never comes back:

                                First, I do want to try to redirect you to the post up-thread where you can apply a patch that probably makes this fix correctly. Though I have been safely using my changes for a long time, I don't use all the features of pfSense, so I'm sure my fix isn't without collateral damage

                                I also looked at that, but I saw I had to install some package in "System/Package manager/Available" packages in order to aply that patch? It didn't seem so straight forward. I will look at it again.

                                @scottmsilver said in Gateway drops and never comes back:

                                Second, if you want to use my changes, It looks like you are missing the asterisks around the comment "added."
                                To fix this you can:

                                delete the word and the slashes around added, as it is just a comment
                                make it a comment by adding the asterisks e.g. /* added */ vs /added/

                                Oops, that got messed up I guess when pasting here on the forum, but I did the change just fine. I just tried again, with no comments this time, with the same results (WAN2 will stay at "Offline, Packetloss").

                                1.JPG

                                2.JPG

                                @ludo9176 said in Gateway drops and never comes back:

                                I'm thinking of something : have you specified monitor IPs for your WAN connections ? Or did you let the default gateway IPs ?

                                Yes, I do have two different monitor IPs, one for each WAN. Using my default gateway (each ISP router IP address) would do no good for me, since the connection might go down, but the router will still reply to pings.

                                Thanks a lot to both of you!

                                L 1 Reply Last reply Reply Quote 0
                                • L
                                  Ludo9176 @MindTwist
                                  last edited by

                                  @mindtwist :
                                  It does work on pfSense CE v2.6.0. Maybe give a chance to pfSense CE ?

                                  M 1 Reply Last reply Reply Quote 0
                                  • M
                                    MindTwist
                                    last edited by

                                    Re: Gateway drops and never comes back

                                    So, I am looking at the patch:
                                    https://redmine.pfsense.org/projects/pfsense/repository/1/revisions/ec73bb89489d830ec21c4e04ffa3ec401791b55d/diff

                                    And all of this changes already seem to be applied on my PFS version?
                                    Captura1.JPG
                                    No, I have not installed any patch manually.

                                    Some of the line numbers differ, but everything is there.
                                    Captura2.JPG
                                    Captura3.JPG

                                    Even with a comment about issue 11570.
                                    Captura4.JPG
                                    Captura5.JPG

                                    rc.newwanip
                                    Captura6.JPG
                                    Captura7.JPG
                                    Captura8.JPG

                                    rc.newwanipv6
                                    Captura9.JPG
                                    Captura10.JPG
                                    Captura11.JPG

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      MindTwist @Ludo9176
                                      last edited by

                                      @ludo9176 said in Gateway drops and never comes back:

                                      @mindtwist :
                                      It does work on pfSense CE v2.6.0. Maybe give a chance to pfSense CE ?

                                      I guess it sucks to be me.

                                      I know there are two branches for PFSense, PFSense CE (community edition?) and PFSense Plus that Netgate installs on their hardware? I really do not know the differences besides version numbers, 22.01 seems to be 2.6.0 I think.
                                      https://docs.netgate.com/pfsense/en/latest/releases/22-01_2-6-0.html

                                      But I do have 4pc of Netgate hardware equipment, I do not think it would be a good idea to reinstall everything on them from Plus 22.05 to CE 2.6.0 just to see if this actually works.

                                      S 1 Reply Last reply Reply Quote 0
                                      • S
                                        SteveITS Galactic Empire @MindTwist
                                        last edited by

                                        @mindtwist There are some differences but not major yet. Before being called Plus it was Factory Edition. Plus/FE works on Arm devices for example.
                                        22.05 is a bit ahead as there was no spring release of CE. I donโ€™t see a fix for this in the release notes, in a very quick look: https://docs.netgate.com/pfsense/en/latest/releases/22-05.html#gateway-monitoring

                                        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                                        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                                        Upvote ๐Ÿ‘ helpful posts!

                                        M 1 Reply Last reply Reply Quote 0
                                        • M
                                          MindTwist @SteveITS
                                          last edited by

                                          @steveits said in Gateway drops and never comes back:

                                          There are some differences but not major yet. Before being called Plus it was Factory Edition. Plus/FE works on Arm devices for example.
                                          22.05 is a bit ahead as there was no spring release of CE. I donโ€™t see a fix for this in the release notes, in a very quick look: https://docs.netgate.com/pfsense/en/latest/releases/22-05.html#gateway-monitoring

                                          I did also check out the release notes on both 22.01/2.6.0 and 22.05, and there is nothing in there about the 11570 patch. But I am unable to find release notes on 22.02, 22.03 and 22.04, so maybe it was applied there.

                                          I surely do have those changes applied on my Netgate boxes, but the problem seems to still be there.

                                          S 1 Reply Last reply Reply Quote 0
                                          • S
                                            SteveITS Galactic Empire @MindTwist
                                            last edited by

                                            @mindtwist itโ€™s a YY/MM date based version. They are targeting 3 Plus versions per year.

                                            Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                                            When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                                            Upvote ๐Ÿ‘ helpful posts!

                                            1 Reply Last reply Reply Quote 0
                                            • S SteveITS referenced this topic on
                                            • V varbird referenced this topic on
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.