how to set temporarily and permanently iptables?
how to set temporarily and permanently iptables?
any example?
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: how to set temporarily and permanently iptables?
Most people are using firewalld instead of iptables on C7.
man firewall-cmd has some examples.
Example 2 shows both the temporary and permanent commands.
man firewall-cmd has some examples.
Example 2 shows both the temporary and permanent commands.
Re: how to set temporarily and permanently iptables?
have any website intro...because i can't find it
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: how to set temporarily and permanently iptables?
Just run "man firewall-cmd".
If you are running X, firewall-config.
If you are running X, firewall-config.
Re: how to set temporarily and permanently iptables?
The one thing that confused me is that to allow something new, you have to run firewall-cmd twice: once with --permanent to make the change stick and once without to make it take effect immediately. I expected --permanent to do both at the same time.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: how to set temporarily and permanently iptables?
I agree I found that confusing as well. I found it easier to just remember to runThe one thing that confused me is that to allow something new, you have to run firewall-cmd twice
Code: Select all
fireall-cmd --reload
The rhel security guide was a great resource to get going quickly with firewalld though. It's a short read too:
https://access.redhat.com/documentation ... walls.html
Re: how to set temporarily and permanently iptables?
When you want to use iptables instead of firewalld, you can do the following:
to add a rule temporarly:
sudo iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
to then save the rule permanently:
sudo service iptables save
to add the rulle immediatelly as permantent, edit /etc/sysconfig/iptables and add a line like this before your reject rule(s):
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
To go back to iptables instead of firewalld on CentOS 7, see this tutorial: http://jensd.be/?p=121
to add a rule temporarly:
sudo iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
to then save the rule permanently:
sudo service iptables save
to add the rulle immediatelly as permantent, edit /etc/sysconfig/iptables and add a line like this before your reject rule(s):
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
To go back to iptables instead of firewalld on CentOS 7, see this tutorial: http://jensd.be/?p=121