Enable/Disable rules Port Forward in command line

Hi!
How do I enable or disable shorewall rules in command mode?
For example: in the /var/lib/nethserver/portforward file
1=pf|Allow||Description|WMS TS|Dst|8080|DstHost|host;ip-1.168|Log|none|OriDst||Proto|tcp,udp|Src|4080|status|enabled

How to disable this rule? Is it with signal-firewall adjust?

Thanks!

Need: Access Release Scheduling
NethServer Version: 7.9
Module: nethserver-firewall

Show the port forwards to get the id:

# db portforward show
1=pf
    Allow=
    Description=
    Dst=
    DstHost=192.168.0.1
    Log=none
    OriDst=
    Proto=tcp,udp
    Src=1234
    status=enabled
2=pf
...

Disable port forward rule 1:

db portforward setprop 1 status disabled

Enable port forward rule 2:

db portforward setprop 2 status enabled

Apply the configuration:

signal-event firewall-adjust

Check out the documentation for more details.

4 Likes

Big man! Thanks for the information!
Yes, I looked in the documentation and only saw these commands regarding multiwan, now with this detail I needed I only found thanks to your help.
Gratitude! :pray:

1 Like