Quantcast
Channel: FedoraForum.org
Viewing all articles
Browse latest Browse all 36122

Error while saving iptables

$
0
0
I am using Fedora 18 for the first time. I had to disable firewalld because I can not find a way to specify a source address.

Anyway, I disabled and stopped firewalld, then enabled and started iptables. I added a few rules and tried to save.

Code:

[root@dog ~]# iptables -L -vn
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target    prot opt in    out    source              destination       
    0    0 ACCEPT    tcp  --  p33p1  *      10.0.0.0/24          0.0.0.0/0            tcp dpt:9000
    0    0 ACCEPT    tcp  --  p33p1  *      10.0.0.0/24          0.0.0.0/0            tcp dpt:22
    0    0 ACCEPT    all  --  lo    *      0.0.0.0/0            0.0.0.0/0         
 6594 4501K ACCEPT    all  --  *      *      0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  623  242K REJECT    all  --  *      *      0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target    prot opt in    out    source              destination       

Chain OUTPUT (policy ACCEPT 4 packets, 235 bytes)
 pkts bytes target    prot opt in    out    source              destination       
 6894 1202K ACCEPT    all  --  *      *      0.0.0.0/0            0.0.0.0/0            ctstate NEW,RELATED,ESTABLISHED

So it looks like it took the rules fine, until I save.

Code:

[root@dog ~]# service iptables save
/etc/sysconfig/iptables-config: line 2: *filter: command not found
/etc/sysconfig/iptables-config: line 3: :INPUT: command not found
/etc/sysconfig/iptables-config: line 4: :FORWARD: command not found
/etc/sysconfig/iptables-config: line 5: :OUTPUT: command not found
/etc/sysconfig/iptables-config: line 6: -A: command not found
/etc/sysconfig/iptables-config: line 7: -A: command not found
/etc/sysconfig/iptables-config: line 8: -A: command not found
/etc/sysconfig/iptables-config: line 9: COMMIT: command not found
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

But /etc/sysconfig/iptables looks right:

Code:

[root@dog ~]# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.4.16.2 on Fri Jun 14 22:53:40 2013
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [4:235]
-A INPUT -s 10.0.0.0/24 -i p33p1 -p tcp -m tcp --dport 9000 -j ACCEPT
-A INPUT -s 10.0.0.0/24 -i p33p1 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -m conntrack --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Fri Jun 14 22:53:40 2013

Any ideas why I am getting the -A command not found errors?

Viewing all articles
Browse latest Browse all 36122

Trending Articles