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

    CLI

    General pfSense Questions
    4
    6
    979
    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.
    • M
      mark81
      last edited by

      On many switches there's a proper CLI that is easy to read and to modify.
      I googled it, but I cannot find it on pfsense. The GUI is great but if you want to add a firewall rule or make a change via CLI.

      Is it possible? Or do you need to know how to program in PHP?

      1 Reply Last reply Reply Quote 0
      • ?
        Guest
        last edited by

        On many switches there's a proper CLI that is easy to read and to modify.

        Yep this is right and together with pfSense you may go this way too without any hassle! But why restrict yourself to one specific
        configuration commands when you can work directly with config files and common UNIX commands and utilities?

        I googled it, but I cannot find it on pfsense. The GUI is great but if you want to add a firewall rule or make a change via CLI.

        There are many more ways to realize this for you;

        • SSH into it, that means please install Putty on your PC or Laptop and use it to connect to the pfSense machine
        • Using the Serial console to set up things might be also a nice way to get access and connecting into pfSense
        • From the WebGUI please use Diagnostics >>> Command Prompt to get a proper CLI environment to set up your pfSense
        • Again, you can SSH into pfSense and use whatever shell you want like bash etc.

        Is it possible? Or do you need to know how to program in PHP?

        pfSense is based on FreeBSD and so it might be coming by default with his own CLI or command line interface!
        You can always write scripts or aliases for common commands. But yes you are right together with PHP it could be a
        really fast way to get success to realize what you ask for too! Using the PHP pfSense Shell

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

          Hi,

          Thanks for taking the time to respond to my post, and excuse me for my late reply.
          I just noticed somebody took the time to reply, so that's great.

          I'm aware PFSense is FreeBSD, however what I'm looking for is a quick way to add rules, or for instance duplicate all rules of a specific interface to another interface.

          Is there a way to acchieve something like that?

          Kind regards,

          Mark

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            @mark81:

            what I'm looking for is a quick way to add rules, or for instance duplicate all rules of a specific interface to another interface.
            Is there a way to acchieve something like that?

            Sure, just produce/recycle code that's able to pase XML and put an altered copy where it's needed…  :P

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

              Hi,

              I ofcourse don't want to sound stupid, but I don't think I get it.

              I have an interface A, with a lot of rules.
              I want to clone all those rules to interface B.

              Do you have a step-by-step how I can accomplish this, without manually clicking each and every one of them and duplicating them to the other interface, re-ordering etc.

              If this is possible that would reallllyyy be great, and save me a ton of work.

              Thanks !

              Mark

              1 Reply Last reply Reply Quote 0
              • P
                pfBasic Banned
                last edited by

                I don't know what directory rules reside in (or if it even works that way, but I expect it does). But you might be able to find it by creating a rule with a unique string in it, then grep for that string?

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