Simple to use firewall-cmd use of port forwarding

Today had wanted to use ssh port forwarding but the command life and death do not remember ..

No way to switch to firewall-cmd for processing

method:

1. First turn off the firewall can not

systemctl enable firewalld
systemctl restart firewalld

2. permanently open port access

firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=80/tcp

3. Add port forwarding

--permanent --add-cmd-Firewall-Forward = Port Port = 80 : proto = TCP: toport = 3000 

to the local server 3000 the content through the port 80 exposed service port

4. Re-reload

firewall-cmd --reload

 

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/11280780.html