V
V
Vitaly2019-07-17 16:23:27
linux
Vitaly, 2019-07-17 16:23:27

Why does iptables-restore error occur?

Created a file with rules for iptables:

*filter
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp --dport 49122 -j ACCEPT

-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A OUTPUT -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

COMMIT

Why does iptables-restore < /etc/iptables.rules give
this error?
iptables-restore v1.6.0: no command specified
Error occurred at line: 12

Debian 9

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2019-07-17
@vitalysokolov

Check that there is a newline after COMMIT.

C
CityCat4, 2019-07-17
@CityCat4

And line 12 is what line?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question