How to configure NAT from Shell Command?

  • 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 to -> (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.

Log in to reply