You are not logged in.

#1 2017-07-01 04:18:35

andrekorol
Member
From: São José dos Campos-SP, Brazil
Registered: 2017-06-30
Posts: 11
Website

[SOLVED]Error on setting firewall with iptables

So, I'm following this guide(https://wiki.archlinux.org/index.php/Si … l_firewall) to set up a firewall with iptables.
I'm following every recommended step except for the ones where it's expĺicitly said "not necessary".
I'm stuck at this step:

Next, the rule for rejecting TCP packets need to be modified to add hosts with rejected packets to the TCP-PORTSCAN list.
# iptables -D INPUT -p tcp -j REJECT --reject-with tcp-reset

When i run the command on the step above I get the following message:

# iptables -D INPUT -p tcp -j REJECT --reject-with tcp-reset
iptables: No chain/target/match by that name.

This is the output I get when I enter iptables-save :

# Generated by iptables-save v1.6.1 on Sat Jul  1 01:16:33 2017
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [1025:120179]
:TCP - [0:0]
:UDP - [0:0]
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate INVALID -j DROP
-A INPUT -p icmp -m icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT
-A INPUT -p udp -m conntrack --ctstate NEW -j UDP
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j TCP
-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
-A INPUT -p tcp -j REJECT --reject-with tcp-reset
-A INPUT -j REJECT --reject-with icmp-proto-unreachable
-A TCP -p tcp -m recent --update --seconds 60 --name TCP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with tcp-reset
-A TCP -p tcp -m tcp --dport 80 -j ACCEPT
-A TCP -p tcp -m tcp --dport 443 -j ACCEPT
-A TCP -p tcp -m tcp --dport 22 -j ACCEPT
-A UDP -p udp -m udp --dport 53 -j ACCEPT
COMMIT
# Completed on Sat Jul  1 01:16:33 2017

Last edited by andrekorol (2017-07-01 18:07:26)

Offline

#2 2017-07-01 08:08:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,880

Re: [SOLVED]Error on setting firewall with iptables

Do you understand what the command does? Look up thew iptables manpage for the -D switch.

Offline

#3 2017-07-01 18:06:25

andrekorol
Member
From: São José dos Campos-SP, Brazil
Registered: 2017-06-30
Posts: 11
Website

Re: [SOLVED]Error on setting firewall with iptables

seth wrote:

Do you understand what the command does? Look up thew iptables manpage for the -D switch.

Thanks Seth. I looked up the iptables manpage and now I understand that this command simply delete a rule. The problem is there were already no rule like that one to be deleted. So, the problem is now solved.

Offline

Board footer

Powered by FluxBB