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

    [2.3.x] No default route on WAN PPPoE after link failure (with FIX, please test)

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    42 Posts 7 Posters 13.6k 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
      sammcj
      last edited by

      Could be related: I noticed after upgrading Pfsense to todays minor updated, after the reboot the PPPoE interface said it was up, but no traffic was flowing, I had  to click 'disconnect' and 'reconnect' again under the interfaces, then all internet traffic started working again.

      From memory this has been a problem for quite some time, I'll see if I can find the original bug report.

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

        @cmb:

        Sounds like that gateway isn't marked as default under System>Routing, what does that screen look like?

        Gateway is marked as default: i tried to edit config and then save too, but with no luck. The only way i find to solve issue (without adding manually a static route every PPPoE restart) was modifying /etc/inc/interfaces.inc like this:

        /* Omit this, we maintain the default route by other means, and it causes problems with * default gateway switching. See redmine #1837 */
        if (($interface "wan" && $founddefaultgw false) || $setdefaultgw == true) {
        $setdefaultgw = true;
        $mpdconf .= <<<eod<br>set iface route default
        
        EOD;</eod<br> 
        

        I remove the REM in this piece of code, so it looks like same file in pfSense 2.2.6. In this way if i reboot pfSense, disconnect WAN cable, reset (bridget) modem, disconnect/reconnect WAN interface, default route is created and all PC in my LAN have internet access.

        default_gw.png
        default_gw.png_thumb
        default_gw_1.png
        default_gw_1.png_thumb

        Marlenio

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

          @sammcj:

          […]
          From memory this has been a problem for quite some time, I'll see if I can find the original bug report.

          Yes, there is redmine #1837 ticket about a similar issue, but the proposed solution by editing the file (/etc/inc/interfaces.inc) stop the creation of the default gateway if the PPPoE session is disconnected. For this reason i modified the code and now it look like that in version 2.2.6 (which worked perfectly).

          Today i made some other test with my pfSense box (Atom 1037U CPU), an Alix, an HP DL380 end a portable DELL. My ISP is a 100/20 FTTC (Telecom Fibra). Same config: clean install, then restore from 2.2.6 config backup. Everybody have the same problems on PPPoE.

          Marlenio

          1 Reply Last reply Reply Quote 0
          • S
            sammcj
            last edited by

            fyi - mine also has the default gateway set.

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

              @cmb: do you think it would be possible to modify code so as to keep both version (2.2.6 and 2.3.x) in file /etc/inc/interfaces.inc? Code was modifyied in 2.3 for a issue (#1837) about multiwan gateway switching, but it seems to have problems with a single wan gateway config. In "single gateway mode" code would run set iface route default command, in "multi gateway mode" no.

              Marlenio

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

                I came back to pfsense having used another router while having this problem. Having started it up, I found that the PPP interface wouldn't come up. Looking under advanced config on the PPPoE link, no underlying interface was selected. Having set that the interface came up and routed correctly. I'll continue to monitor and see want happens when the underlaying DSL link fail cycles.

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

                  @jumpymonkey:

                  I came back to pfsense having used another router while having this problem. Having started it up, I found that the PPP interface wouldn't come up. Looking under advanced config on the PPPoE link, no underlying interface was selected. Having set that the interface came up and routed correctly. I'll continue to monitor and see want happens when the underlaying DSL link fail cycles.

                  Can you try the mod in /etc/inc/interfaces.inc i post?

                  Marlenio

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

                    It's working without the mod. I was about to try your mod, but now the interface is up and working as expected. I'll see what happens when I pull the modem link out later, and if that stops the routing working I'll apply the mod.

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

                      @jumpymonkey:

                      It's working without the mod. I was about to try your mod, but now the interface is up and working as expected. I'll see what happens when I pull the modem link out later, and if that stops the routing working I'll apply the mod.

                      What happened if you disconnect and riconnect WAN or PPPoE cable from modem?

                      Marlenio

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

                        I cycled the modem. When the link came back up, the I couldn't connect out to the Internet. Adding your fix and cycling the PPPoE link fixes the problem. Thanks!

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

                          @jumpymonkey:

                          I cycled the modem. When the link came back up, the I couldn't connect out to the Internet. Adding your fix and cycling the PPPoE link fixes the problem. Thanks!

                          Well, my fix is actually the same code present in 2.2.6, that works without problem. Thank you for test.  :)

                          Marlenio

                          1 Reply Last reply Reply Quote 0
                          • R
                            robi
                            last edited by

                            Is there a redmine on this?

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

                              @robi:

                              Is there a redmine on this?

                              Yes: https://forum.pfsense.org/index.php?topic=113750.msg632702#msg632702

                              Marlenio

                              1 Reply Last reply Reply Quote 0
                              • R
                                robi
                                last edited by

                                OK, for pfSense people to take this seriously you'll have to create it as a patch here:
                                https://github.com/pfsense/pfsense

                                Just register, choose your file, click the pencil icon to edit it, and it will create a fork for you. Then, submit a pull request for your fork. In the description, link to this topic and the redmine issue.

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

                                  @robi:

                                  OK, for pfSense people to take this seriously you'll have to create it as a patch here:
                                  https://github.com/pfsense/pfsense

                                  Just register, choose your file, click the pencil icon to edit it, and it will create a fork for you. Then, submit a pull request for your fork. In the description, link to this topic and the redmine issue.

                                  Hi Roby, i'm not a PHP developer, so i don't think it's a good idea modify code on my own. Anyway, in redmine #6495 i suggested a possibile change about code:

                                  if ONE GW then
                                      <the code="" i="" modify="">else (TWO or MORE GW)
                                      endif</the>
                                  `In this way it could work both configuration, one WAN gateway or two (or more).

                                  P.S. What do you mean for "…for pfSense people to take this seriously"?`

                                  Marlenio

                                  1 Reply Last reply Reply Quote 0
                                  • R
                                    robi
                                    last edited by

                                    You said "my fix is actually the same code…" - I thougt you have a real fix for the problem...

                                    As far as I noticed over the years, code snippets posted on the forum almost never reach to be in the actual product.

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

                                      @robi:

                                      You said "my fix is actually the same code…" - I thougt you have a real fix for the problem...

                                      As far as I noticed over the years, code snippets posted on the forum almost never reach to be in the actual product.

                                      As you can read in my reply to jumpymonkey, my fix is simply the recovery of the code of 2.2.6, that not rem the line set iface route default. But as said in Redmine #1837, 2.2.6 code works well with one WAN gateway, but create problems with multi WAN gateway configuration. So i thought multi choice <if…else...endif>would be a good solution.</if…else...endif>

                                      Marlenio

                                      1 Reply Last reply Reply Quote 0
                                      • R
                                        robi
                                        last edited by

                                        OK, the problem that this is all so confusing with your fix. Sorry.

                                        I don't mean to to offend you with this, just trying to help. Which file, which line number should be replaced with what.
                                        PHP is so easy…

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

                                          @robi:

                                          OK, the problem that this is all so confusing with your fix. Sorry.

                                          I don't mean to to hurt you with this, just trying to help. Which file, which line number should be replaced with what.
                                          PHP is so easy…

                                          Hi robi, really, there's absolutely no problem, why should be hurt?  :)  I'm not a PHP developer (i'm a network admin) and at office i managed 14 (16) pfSense box with WAN static IP. But i have pfSense at home too with PPPoE connection, and from 2.3 release i have several problem with auth. I have a little bit of knowledge of programming, so i try to investigate and finally i found redmine #1837 and so on.

                                          I start to learn PHP, but I think it is still early and I'm not at an advanced level as the official team, so I think it's better to just report the bug.  ;) ;)

                                          File is /etc/inc/interfaces.inc from line 1806 to line 1815.

                                          Thanks in advance.  :)

                                          Marlenio

                                          1 Reply Last reply Reply Quote 0
                                          • C
                                            cmb
                                            last edited by

                                            @robi:

                                            OK, for pfSense people to take this seriously you'll have to create it as a patch here:
                                            https://github.com/pfsense/pfsense

                                            Not true, there is a bug open and we'll get a proper fix. Going back to the change discussed in this thread will regress other things and isn't right. We need to track down the real source of the issue and fix that. I can't replicate it at all though, so going to need some help from those who can.

                                            mpd calls ppp-linkup after connecting, which triggers rc.newwanip. rc.newwanip sets the default gateway.

                                            When you're left with no default gateway after a reconnect, check the system log. What is there from rc.newwanip? Should see something like:

                                            rc.newwanip: ROUTING: setting default route to x.x.x.x
                                            

                                            is that there? What else is logged at the time?

                                            If you cause the WAN NIC to lose its link, in addition to rc.newwanip, rc.linkup will also set the default gateway and have a similar log. So you'll see it twice in that case, which is fine.

                                            Note I'm talking about using strictly stock source code, not the change in this thread. Revert that change first if you made it.

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