# Replacing iptables (CentOS 7) with firewalld (Rocky 9)

**URL:** <https://forums.rockylinux.org/t/replacing-iptables-centos-7-with-firewalld-rocky-9/14790>\
**Category:** Rocky Linux Help & Support\
**Created:** [June 25, 2024, 12:04am UTC](https://forums.rockylinux.org/t/replacing-iptables-centos-7-with-firewalld-rocky-9/14790 "2024-06-25T00:04:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [June 25, 2024, 12:24am UTC](https://forums.rockylinux.org/t/replacing-iptables-centos-7-with-firewalld-rocky-9/14790/2 "2024-06-25T00:24:33Z")

</div>

If you don’t want to use firewalld, you can use straight nftables. You can convert your current ruleset to nftables equivalents as a starting point.

```auto
iptables-restore-translate

```

Otherwise if you want to do it in firewalld, you just need to use the right zones and right rules. For example, the gateway should be in external. The other LAN stuff can remain in say, internal.

Only other thing is you’ll need to setup ingress and egress rules. I would check out the page below.

> [@Firewalld/NetworkManager Internet Routing Not working in Rocky Linux 9.x](https://forums.rockylinux.org/t/firewalld-networkmanager-internet-routing-not-working-in-rocky-linux-9-x/7280/12):
>
> Just out of interest, are you willing to check/test it with Rocky 8? If not I’ll fire up a Rocky 9 install to make a firewall from it to try and replicate your issue. We could at least rule out if something in Rocky 9 changed that is stopping this from working.

---

_[View the full topic](https://forums.rockylinux.org/t/replacing-iptables-centos-7-with-firewalld-rocky-9/14790)._
