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

Adding NAT rule via shell/console

Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
5 Posts 3 Posters 1.7k 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.
  • B
    bouke
    last edited by May 26, 2019, 6:39 PM

    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
    • J
      JeGr LAYER 8 Moderator
      last edited by May 27, 2019, 12:39 PM

      @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
      • S
        stephenw10 Netgate Administrator
        last edited by May 27, 2019, 1:11 PM

        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
        • J
          JeGr LAYER 8 Moderator
          last edited by May 27, 2019, 2:22 PM

          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
          • S
            stephenw10 Netgate Administrator
            last edited by May 27, 2019, 2:27 PM

            @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
            3 out of 5
            • First post
              3/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received