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

    How to configure NAT from Shell Command?

    Scheduled Pinned Locked Moved NAT
    1 Posts 1 Posters 307 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.
    • R
      ravmeister
      last edited by

      Hi, i have tried the following solution:

      1. Dump the current ruleset into a file
      pfctl -sn > /var/tmp/tempfile

      2. Edit the file and add my rule after the last nat rule)
      nat on vr0 inet from 192.168.2.0/24 to 192.168.1.0/24 -> (vr0) round-robin

      3. Import the whole ruleset again
      pfctl -Nf /var/tmp/tempfile

      But the rules that i created doesn't show on the web GUI, and i believe this method is not persistent.

      Does anyone have another method to do NAT by the shell command and please share here?

      Thank you.

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