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

    Adding NAT rule via shell/console

    Off-Topic & Non-Support Discussion
    3
    5
    1.7k
    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.
    • boukeB
      bouke
      last edited by

      Hello,

      I did read about adding firewall rule via console [https://docs.netgate.com/pfsense/en/latest/firewall/adding-rules-with-easyrule.html].

      I could not find any information about adding a NAT rule via console. However, I did read that "pfctl -sn" will list all the NAT rules [https://docs.netgate.com/pfsense/en/latest/firewall/viewing-the-full-pf-ruleset.html].

      I am unable to use the web interface at the moment and need to add a NAT rule for this. Thanks.

      1 Reply Last reply Reply Quote 0
      • JeGrJ
        JeGr LAYER 8 Moderator
        last edited by

        @bouke said in Adding NAT rule via shell/console:

        I am unable to use the web interface at the moment and need to add a NAT rule for this. Thanks.

        That's only possible via pfSSH.php and direct XML editing. The easyrule Skript is only a small mechanism for quickly adding simple blocks on an interface (mostly WAN) but has nothing for NAT editing in any way.

        Don't forget to upvote 👍 those who kindly offered their time and brainpower to help you!

        If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

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

          Hard to really recommend it but if you really have no other option it is (just about) possible to add a NAT rule using Links.

          Selection_628.png

          Be prepared for frustration though! 😉

          Steve

          1 Reply Last reply Reply Quote 0
          • JeGrJ
            JeGr LAYER 8 Moderator
            last edited by

            But that only works if the webUI is still responding ;) Not sure if the OP meant that. And creating NATs via pfSSH isn't really nice either :D

            Don't forget to upvote 👍 those who kindly offered their time and brainpower to help you!

            If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

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

              @JeGr said in Adding NAT rule via shell/console:

              But that only works if the webUI is still responding ;)

              Good point!

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