ebtables and iptables can be very complex. And I failed my 1st RHCE exam because of them. But once you learn, you will never unlearn, as they are quite beautifully crafted. You just need to get into the mindset of the people who wrote the tools…
Look into firewalld
It has a rather simplified cli interface: firewall-cmd
The manpages will tell you a lot.
firewall-cmd —add-service=ssh
Will open the ports for your ssh daemon until you reload your firewall or reboot your system
firewall-cmd —permanent —add-service=ssh
Will open the ssh ports until you remove them
firewall-cmd —list-all
Will show you the current firewall config
ebtables
andiptables
can be very complex. And I failed my 1st RHCE exam because of them. But once you learn, you will never unlearn, as they are quite beautifully crafted. You just need to get into the mindset of the people who wrote the tools…Look into
firewalld
It has a rather simplified cli interface:firewall-cmd
The manpages will tell you a lot.
firewall-cmd —add-service=ssh
Will open the ports for your ssh daemon until you reload your firewall or reboot your systemfirewall-cmd —permanent —add-service=ssh
Will open the ssh ports until you remove themfirewall-cmd —list-all
Will show you the current firewall configTry nftables directly, it's simple and straightforward, scripting syntax is easy.