Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've been trying to start the iptables firewall service, but it keeps failing. What's going wrong?

# systemctl status iptables.service
iptables.service - IPv4 firewall with iptables
  Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)
  Active: failed (Result: exit-code) since Sat 2013-10-26 11:01:54 CDT; 41s ago
 Process: 2114 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=1/FAILURE)

Oct 26 11:01:54 localhost.localdomain iptables.init[2114]: iptables: Applying firewall rules: iptables-restore: line 1 failed
Oct 26 11:01:54 localhost.localdomain systemd[1]: iptables.service: main process exited, code=exited, status=1/FAILURE
Oct 26 11:01:54 localhost.localdomain systemd[1]: Failed to start IPv4 firewall with iptables.
Oct 26 11:01:54 localhost.localdomain systemd[1]: Unit iptables.service entered failed state.
share|improve this question

1 Answer 1

Try (as root):

iptables-restore < /etc/sysconfig/iptables

If it fails, that should give you a more informative error. If it works, something's perhaps wrong with the systemd service files.

share|improve this answer
    
It says: iptables v1.4.18: no command specified What can be wrong with systemd? it's a new Fedora installation.. –  user50045 Oct 27 '13 at 16:19
    
Sorry, that should have been iptables-restore (corrected). –  goldilocks Oct 27 '13 at 16:21
    
In my case, there was apparently syntax error in the automatically generated (!) config file. While fixing that, I found out that systemctl start iptables will automatically attempt to load /etc/sysconfig/iptables, so creating a copy of that files and fixing that copy won't help; rather create a backup of that file and then modify the original file. –  O. R. Mapper Mar 11 at 10:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.