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

    How to get pfSense WAN to accept VLAN 0

    Scheduled Pinned Locked Moved General pfSense Questions
    415 Posts 26 Posters 226.3k 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.
    • stephenw10S
      stephenw10 Netgate Administrator
      last edited by

      Yeah, nice work.
      Did you have to set the priority tag in the end?

      Steve

      J 1 Reply Last reply Reply Quote 0
      • J
        JustASK 0 @stephenw10
        last edited by

        @stephenw10 Yes. This is handled by ngctl within the provided script and applied to the virtual interface. The only thing I added to my setup was the Shellcmd package in order to run the script at startup.

        M 1 Reply Last reply Reply Quote 2
        • M
          mikela @JustASK 0
          last edited by

          @justask-0 This is amazing, would you mind giving me a few directions so I can get this to work on my pfsense box using Frontier fiber? Thanks

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Download that script above and put on the firewall, I would put it in /root. Make sure the file permissions allow it to be run as an executable. Create a shellcmd to run it at boot. Using the shellcmd package is the easiest way to do that.
            https://docs.netgate.com/pfsense/en/latest/development/boot-commands.html

            Steve

            M 1 Reply Last reply Reply Quote 1
            • M
              mikela @stephenw10
              last edited by

              Thank you sooo much! Do I need to edit the script at all for my environment? I'm just using a netgate device directly connected to my ONT. Nothing special.
              Mike

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                Yes, there are variables at the top of the script:

                ONT_IF='xx0'
                ONT_ETHER_ADDR='xx:xx:xx:xx:xx:xx'
                

                You need to set those to match you chosen NIC in pfSense and the MAC of your router.

                Steve

                M 1 Reply Last reply Reply Quote 0
                • M
                  mikela @stephenw10
                  last edited by

                  You da man!

                  I was reading the "Executing Commands at Boot" doc from the netgate link you sent me. It seems easier to stick the vlanzero script in /usr/local/etc/rc.d/ mark it as executable and call it a day.
                  Would that work? I cant wait to go home and try this script!!

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    Yes, that would work. I would still use a shellcmd though. You can easily change that from the GUI. It gets stored in the config (though not the script itself). You can set is as an earlyshellcmd to make it run earlier in the boot process.

                    Steve

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      mikela @stephenw10
                      last edited by

                      If you don't use the earlyshellcmd does it run before the WAN interface (since that's what I'll be using) tries to obtain an IP from DHCP upon bootup?

                      N 1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        I don't know since I don't use that script personally. There is no danger of it trying directly though since WAN will be assigned as ngeth0 and that doesn't exist until the script runs.
                        More likely it would fail to boot because it doesn't exist.

                        Steve

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          mikela @stephenw10
                          last edited by

                          I was able to run the script and get the WAN interface to obtain an IP address from Frontier. The only problem I have now is that it does not survive reboots. During boot up I get "Warning: Configuration references interfaces that do not exist: ngeth0".
                          I tried both shell and early shell commands and also to place the script in the /usr/local/etc/rc.d/ directory. Any suggestions?

                          Thanks again for all your help.
                          Mike

                          1 Reply Last reply Reply Quote 0
                          • stephenw10S
                            stephenw10 Netgate Administrator
                            last edited by

                            Hmm, I expect earlyshellcmd to work since that's what pfatt uses.
                            The only other alternatives are to add ngeth to the list on interfaces excluded from the check or to change the interface name the script uses to something that's already excluded.:
                            https://github.com/pfsense/pfsense/blob/master/src/etc/inc/util.inc#L2401

                            Steve

                            M 2 Replies Last reply Reply Quote 0
                            • M
                              mikela @stephenw10
                              last edited by

                              @stephenw10 I think your right, in the boot process I see this:
                              sh: Syntax error: end of file unexpected (expecting word)
                              Updating configuration...done.
                              Warning: Configuration references interfaces that do not exist: ngeth0

                              1 Reply Last reply Reply Quote 0
                              • M
                                mikela @stephenw10
                                last edited by

                                @stephenw10 I think i have the syntax wrong for the earlyshellcmd. The vlanzero file is on root:
                                <earlyshellcmd>/vlanzero2</earlyshellcmd>

                                1 Reply Last reply Reply Quote 0
                                • stephenw10S
                                  stephenw10 Netgate Administrator
                                  last edited by

                                  Ah, OK. Yeah that's not right, it's not running. You need to specify the complete path to the file.
                                  I would put it in the 'root' folder not the root of the filesystem, so:

                                  <earlyshellcmd>/root/vlanzero2.sh</earlyshellcmd>
                                  

                                  That's what I expect there.

                                  M 1 Reply Last reply Reply Quote 0
                                  • M
                                    mikela @stephenw10
                                    last edited by

                                    Thanks so much for your help!

                                    I had that from the start and it did not work. I checked the config.xml file and the shellcmd package was putting extra stuff in there. So I removed the package and edited the config file manually and viola! it worked. Only thing left id to test the internet connection when I get home.

                                    1 Reply Last reply Reply Quote 1
                                    • stephenw10S
                                      stephenw10 Netgate Administrator
                                      last edited by

                                      Interesting. The shellcmd package works fine AFAIK. I have it running scripts here on several boxes.

                                      M 1 Reply Last reply Reply Quote 0
                                      • M
                                        mikela @stephenw10
                                        last edited by

                                        @stephenw10
                                        It worked fine on my other pfsense box as well. Strange huh?
                                        Anyway I wanted to let you know i got it working minus a couple of issue:

                                        1. Unable to get DHCP6 addrss.
                                        2. Looks like a took a little bit of a speed hit as well.

                                        I'd love to hear any suggestions you have, you totally helped me out.
                                        Thanks

                                        1 Reply Last reply Reply Quote 0
                                        • stephenw10S
                                          stephenw10 Netgate Administrator
                                          last edited by

                                          There's some discussion of v6 on the pfatt pages. May or may not be related. If it's just dhcpv6 I would expect it to be pulled over vlan0 like v4. So there's probably something else going on there.

                                          Everything has to go through netgraph so I would expect a lot more CPU cycles to be required. There may be some tuning options it's not something I've ever looked into.
                                          Try running top -aSH and see how the loading is spread across the CPU cores. Something might be single threaded now.

                                          Steve

                                          1 Reply Last reply Reply Quote 0
                                          • R
                                            radwimp @natbart
                                            last edited by

                                            @natbart just want to say thanks for figuring this out, it’s working great for me so far. just recently upgraded Fibe and my HH3000 would literally just freeze when maxing the connection out. Ecstatic that I can finally drop kick that POS and just have my pfsense box. Glad you didn’t give up and managed to figure it out. Great work.

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