User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
firewalld [2018/08/08 09:23]
k2patel [Firewalld]
firewalld [2019/05/01 11:12] (current)
k2patel [Port redirection]
Line 4: Line 4:
 Anyway but server need to keep rolling !! Anyway but server need to keep rolling !!
 +==== Replace firewalld with iptables ====
 +This is tested with the RHEL7
 +<code bash>
 +yum install -y iptables-services
 +iptables-save > /​etc/​sysconfig/​iptables ​ # preserve existing rule
 +systemctl stop firewalld
 +systemctl mask firewalld
 +systemctl enable iptables
 +systemctl enable ip6tables
 +systemctl start iptables
 +systemctl start ip6tables
 ==== Adding rich rule ==== ==== Adding rich rule ====
Line 12: Line 25:
   source address="​​25"​   source address="​​25"​
   port protocol="​tcp"​ port="​9200"​ accept'​   port protocol="​tcp"​ port="​9200"​ accept'​
 +==== Port redirection ====
 +Using following command one can redirect port traffic to another.
 +<code bash>
 +# iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 8080 -j REDIRECT --to-port 8443
 +firewall-cmd --permanent --direct --add-rule ipv4 nat OUTPUT 0 -p tcp -o lo --dport 8080 -j REDIRECT --to-ports 8443
 </​code>​ </​code>​
firewalld.1533734597.txt.gz ยท Last modified: 2018/08/08 09:23 by k2patel