Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've been using centos 6 and iptables for ages but this new firewalld thing in centos 7 has got me completely flummoxed. I've been trawling google but can't find a converter, I need to ask if someone here can convert the following iptables rules to firewalld.
Quote:
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -i <interface> -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p udp -m udp --dport <port> -j ACCEPT
iptables -A OUTPUT -s xx.xx.xx.xx -j DROP
iptables --table nat --append POSTROUTING --out-interface <interface> -j MASQUERADE
iptables --append FORWARD --in-interface <interface> -j ACCEPT
iptables -A INPUT -i <interface> -j ACCEPT
iptables -A OUTPUT -o <interface> -j ACCEPT
iptables -t nat -A PREROUTING -i enp0s25 -p tcp --dport 80 -j DNAT --to xx.xx.xx.xx:<port>
iptables -t nat -A PREROUTING -i enp4s0 -p tcp --dport 80 -j REDIRECT --to-port <port>
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP
these rules are from a script I used on my centos 6 machine. In time I will have to get to grips with firewalld but for now I need to get a centos 7 machine running without first doings weeks of study. I know I could use iptables on centos 7 but that defeats the object of upgrading. Thanks for any help.
There are no advantages in firwalld. Both iptables and firwalld use the kernel iptables.
Firewalld is a thing added to "make things easier"... but it is really only useful to hide the details of what is actually happening. firewalld provides an interface to the GUI... Things that are preprogrammed for the GUI are easy (but you don't learn what it is doing), and makes it more difficult to use for anything else.
Maybe handy for a new user only familiar with GUI operations.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.