Iptables to firewalld rules

Support for security such as Firewalls and securing linux
Post Reply
dhJaffa
Posts: 1
Joined: 2018/10/03 06:21:51

Iptables to firewalld rules

Post by dhJaffa » 2018/10/03 06:27:01

I have the following iptables rules and are working fine:

Code: Select all

iptables -I FORWARD -s 0.0.0.0/0 -d xxx.xxx.xxx.184/29 -j ACCEPT    
iptables -I FORWARD -s xxx.xxx.xxx.184/29 -d 0.0.0.0/0 -j ACCEPT    
iptables -t nat -I PREROUTING -s 0.0.0.0/0 -d xxx.xxx.xxx.186 -j DNAT --to-destination xxx.xxx.xxx.186    
iptables -t nat -I POSTROUTING -s xxx.xxx.xxx.186 -d 0.0.0.0/0 -j SNAT --to-source xxx.xxx.xxx.186
Trying to switch to firewalld but somewhere I fail:

Code: Select all

firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -s 0.0.0.0/0 -d xxx.xxx.xxx.184/29 -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 1 -s xxx.xxx.xxx.184/29 -d 0.0.0.0/0 -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 nat PREROUTING 0 -s 0.0.0.0/0 -d xxx.xxx.xxx.186 -j DNAT --to-destination xxx.xxx.xxx.186
firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 1 -s xxx.xxx.xxx.186 -d 0.0.0.0/0 -j SNAT --to-source xxx.xxx.xxx.186
Any help is appreciated.

Post Reply

Return to “CentOS 7 - Security Support”