Skip to content

Instantly share code, notes, and snippets.

@mariotpc
Created January 26, 2023 18:10
Show Gist options
  • Save mariotpc/f4a20d6b7ad06d7cb4d107d436c5b79c to your computer and use it in GitHub Desktop.
Save mariotpc/f4a20d6b7ad06d7cb4d107d436c5b79c to your computer and use it in GitHub Desktop.
firewalld port forward and expose ports
Be sure that FirewallD is running if not... start it !
systemctl start firewalld
To expose ports to external access use
firewall-cmd --zone=public --add-port=22/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
To access outside to internal server, explicit port 2333 use
firewall-cmd
--zone=public
--add-forward-port=port=2333:proto=tcp:toport=2333:toaddr=10.20.10.20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment