CLI



  • 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?



  • 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



  • 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


  • Banned

    @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



  • 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


  • Banned

    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?


Log in to reply