Hello i have used iptables command but it does not save the command.
Every time i restart server i have to write command again.
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -d 192.168.1.0/24 -j ACCEPT
iptables -P OUTPUT DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -P INPUT DROP
I use iptable-save command
Help please !!
Can not save iptables
-
- Posts: 2019
- Joined: 2015/02/17 15:14:33
- Location: Bulgaria
- Contact:
Re: Can not save iptables
Either use the firewall-cmd or disable firewalld and install (and enable) iptables.service and ip6table.service.
Firewalld will remove any entry that is not inside it's configuration.
Firewalld will remove any entry that is not inside it's configuration.
Re: Can not save iptables
That doesn't save the rules, it only prints them. To save the rules you need to run service iptables saveI use iptable-save command
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: Can not save iptables
Or as the man page says:
Use I/O-redirection provided by your shell to write to a file.
Re: Can not save iptables
You can do that but service iptables save makes a backup copy of the old file for you first and probably does other stuff behind the scenes.
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