Article 5DCB4 Bash script firewalld

Bash script firewalld

by
routers
from LinuxQuestions.org on (#5DCB4)
hello if anyone there can correct my bash script to run firewalld

Code:#!/bin/bash
echo "Open TCP Port And Forward to Other IP address , Now Enter Public Port Number ?"
read varpubport
echo "Enter Internalport number"
read varintport
echo "Enter IP number?"
read varip
firewall-cmd --zone=public --add-port=$varpubport/tcp
firewall-cmd --zone=public --add-forward-port=port=$vapubport:proto=tcp:toport=$varinport:toaddr=$varipbelow is working command

Code:firewall-cmd --zone=public --add-port=8024/tcp
firewall-cmd --zone=public --add-forward-port=port=8024:proto=tcp:toport=22:toaddr=192.168.122.204info

varpubport - 8024
varintport - 22
varip - 192.168.122.204
----------
script error: -

Error: INVALID_FORWARD: missing port

I detected error at first fw-cmd , inserted space after port number before /tcp, no idea how to correct it please help
--------

to MOD , move accordingly if it not in right place

thankslatest?d=yIl2AUoC8zA latest?i=UqWejVyik6I:_cpFdExsrTc:F7zBnMy latest?i=UqWejVyik6I:_cpFdExsrTc:V_sGLiP latest?d=qj6IDK7rITs latest?i=UqWejVyik6I:_cpFdExsrTc:gIN9vFwUqWejVyik6I
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments