incoming ACCEPT all iptables rule still appearing












8















I'm following this guide here: http://isalazyadmin.net/2009/07/02/configuring-a-basic-firewall-for-debian-linux/



And I have the iptables listed shown, but my server still appears to be accepting all incoming connections (ie: bittorrent peers are still connecting, even though I didn't allow those ports).



/etc/iptables.rules



*filter

# This will allow all loopback (lo0) traffic and drop all traffic to 127/8
# that does not use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

# This accepts all already established connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# This allows all outbound traffic
-A OUTPUT -j ACCEPT

# This will allow HTTP and HTTPS connections from anywhere, this are the normal
# ports used for a web server
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

# Allow SSH connections
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow bittorrent/rtorrent ports, from ~/.rtorrent.rc
## -A INPUT -p tcp --dport 8071:8079 -j ACCEPT


# Allow ICMP ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# Reject all other inbound traffic
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT


When I run iptables -L after a reboot, I still get this as my first rule:



iptables -L



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


Not sure where this is coming from.



Here is the full list:



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere loopback/8 reject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT icmp -- anywhere anywhere icmp echo-request
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


Here is the output of iptables-save:



# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*raw
:PREROUTING ACCEPT [6701:942626]
:OUTPUT ACCEPT [8927:989420]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*nat
:PREROUTING ACCEPT [3281:284415]
:INPUT ACCEPT [9:720]
:OUTPUT ACCEPT [1758:148908]
:POSTROUTING ACCEPT [1758:148908]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*mangle
:PREROUTING ACCEPT [6701:942626]
:INPUT ACCEPT [6701:942626]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [8928:989684]
:POSTROUTING ACCEPT [8928:989684]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -j ACCEPT
COMMIT
# Completed on Fri Jan 11 09:54:19 2013


Here is the iptables -vL output:



$ sudo iptables -vL
[sudo] password for ettinger:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
8303 1206K ACCEPT all -- lo any anywhere anywhere
0 0 REJECT all -- !lo any anywhere loopback/8 reject-with icmp-port-unreachable
12M 7191M ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
18 980 ACCEPT tcp -- any any anywhere anywhere tcp dpt:www
7 344 ACCEPT tcp -- any any anywhere anywhere tcp dpt:https
379 22728 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh
18316 1110K ACCEPT tcp -- any any anywhere anywhere tcp dpts:8071:8079
120K 15M ACCEPT udp -- any any anywhere anywhere udp dpt:6881
24809 1489K ACCEPT tcp -- any any anywhere anywhere tcp dpt:9001
688 35244 ACCEPT tcp -- any any anywhere anywhere tcp dpt:9030
874 73072 ACCEPT icmp -- any any anywhere anywhere icmp echo-request
12705 871K REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
14M 12G ACCEPT all -- any any anywhere anywhere









share|improve this question

























  • Haven't you noticed your first INPUT rule ACCEPT all -- anywhere anywhere?

    – ott--
    Jan 11 '13 at 9:48






  • 1





    It seems that rules aren't loaded at boot time. Make sure that you added "pre-up iptables-restore < /etc/iptables.rules" line to your /etc/network/interfaces file (as author of tutorial suggests)

    – mzet
    Jan 11 '13 at 9:53






  • 1





    @ott : it concerns lo inteface only, so it's ok

    – mzet
    Jan 11 '13 at 9:54






  • 2





    Can you redo your listing with iptables -vL?

    – ott--
    Jan 11 '13 at 9:58











  • Your rules and your post boot state actually do match up, that is not the problem -- see my answer ;)

    – goldilocks
    Jan 11 '13 at 12:37
















8















I'm following this guide here: http://isalazyadmin.net/2009/07/02/configuring-a-basic-firewall-for-debian-linux/



And I have the iptables listed shown, but my server still appears to be accepting all incoming connections (ie: bittorrent peers are still connecting, even though I didn't allow those ports).



/etc/iptables.rules



*filter

# This will allow all loopback (lo0) traffic and drop all traffic to 127/8
# that does not use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

# This accepts all already established connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# This allows all outbound traffic
-A OUTPUT -j ACCEPT

# This will allow HTTP and HTTPS connections from anywhere, this are the normal
# ports used for a web server
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

# Allow SSH connections
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow bittorrent/rtorrent ports, from ~/.rtorrent.rc
## -A INPUT -p tcp --dport 8071:8079 -j ACCEPT


# Allow ICMP ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# Reject all other inbound traffic
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT


When I run iptables -L after a reboot, I still get this as my first rule:



iptables -L



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


Not sure where this is coming from.



Here is the full list:



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere loopback/8 reject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT icmp -- anywhere anywhere icmp echo-request
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


Here is the output of iptables-save:



# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*raw
:PREROUTING ACCEPT [6701:942626]
:OUTPUT ACCEPT [8927:989420]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*nat
:PREROUTING ACCEPT [3281:284415]
:INPUT ACCEPT [9:720]
:OUTPUT ACCEPT [1758:148908]
:POSTROUTING ACCEPT [1758:148908]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*mangle
:PREROUTING ACCEPT [6701:942626]
:INPUT ACCEPT [6701:942626]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [8928:989684]
:POSTROUTING ACCEPT [8928:989684]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -j ACCEPT
COMMIT
# Completed on Fri Jan 11 09:54:19 2013


Here is the iptables -vL output:



$ sudo iptables -vL
[sudo] password for ettinger:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
8303 1206K ACCEPT all -- lo any anywhere anywhere
0 0 REJECT all -- !lo any anywhere loopback/8 reject-with icmp-port-unreachable
12M 7191M ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
18 980 ACCEPT tcp -- any any anywhere anywhere tcp dpt:www
7 344 ACCEPT tcp -- any any anywhere anywhere tcp dpt:https
379 22728 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh
18316 1110K ACCEPT tcp -- any any anywhere anywhere tcp dpts:8071:8079
120K 15M ACCEPT udp -- any any anywhere anywhere udp dpt:6881
24809 1489K ACCEPT tcp -- any any anywhere anywhere tcp dpt:9001
688 35244 ACCEPT tcp -- any any anywhere anywhere tcp dpt:9030
874 73072 ACCEPT icmp -- any any anywhere anywhere icmp echo-request
12705 871K REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
14M 12G ACCEPT all -- any any anywhere anywhere









share|improve this question

























  • Haven't you noticed your first INPUT rule ACCEPT all -- anywhere anywhere?

    – ott--
    Jan 11 '13 at 9:48






  • 1





    It seems that rules aren't loaded at boot time. Make sure that you added "pre-up iptables-restore < /etc/iptables.rules" line to your /etc/network/interfaces file (as author of tutorial suggests)

    – mzet
    Jan 11 '13 at 9:53






  • 1





    @ott : it concerns lo inteface only, so it's ok

    – mzet
    Jan 11 '13 at 9:54






  • 2





    Can you redo your listing with iptables -vL?

    – ott--
    Jan 11 '13 at 9:58











  • Your rules and your post boot state actually do match up, that is not the problem -- see my answer ;)

    – goldilocks
    Jan 11 '13 at 12:37














8












8








8


2






I'm following this guide here: http://isalazyadmin.net/2009/07/02/configuring-a-basic-firewall-for-debian-linux/



And I have the iptables listed shown, but my server still appears to be accepting all incoming connections (ie: bittorrent peers are still connecting, even though I didn't allow those ports).



/etc/iptables.rules



*filter

# This will allow all loopback (lo0) traffic and drop all traffic to 127/8
# that does not use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

# This accepts all already established connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# This allows all outbound traffic
-A OUTPUT -j ACCEPT

# This will allow HTTP and HTTPS connections from anywhere, this are the normal
# ports used for a web server
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

# Allow SSH connections
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow bittorrent/rtorrent ports, from ~/.rtorrent.rc
## -A INPUT -p tcp --dport 8071:8079 -j ACCEPT


# Allow ICMP ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# Reject all other inbound traffic
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT


When I run iptables -L after a reboot, I still get this as my first rule:



iptables -L



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


Not sure where this is coming from.



Here is the full list:



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere loopback/8 reject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT icmp -- anywhere anywhere icmp echo-request
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


Here is the output of iptables-save:



# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*raw
:PREROUTING ACCEPT [6701:942626]
:OUTPUT ACCEPT [8927:989420]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*nat
:PREROUTING ACCEPT [3281:284415]
:INPUT ACCEPT [9:720]
:OUTPUT ACCEPT [1758:148908]
:POSTROUTING ACCEPT [1758:148908]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*mangle
:PREROUTING ACCEPT [6701:942626]
:INPUT ACCEPT [6701:942626]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [8928:989684]
:POSTROUTING ACCEPT [8928:989684]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -j ACCEPT
COMMIT
# Completed on Fri Jan 11 09:54:19 2013


Here is the iptables -vL output:



$ sudo iptables -vL
[sudo] password for ettinger:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
8303 1206K ACCEPT all -- lo any anywhere anywhere
0 0 REJECT all -- !lo any anywhere loopback/8 reject-with icmp-port-unreachable
12M 7191M ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
18 980 ACCEPT tcp -- any any anywhere anywhere tcp dpt:www
7 344 ACCEPT tcp -- any any anywhere anywhere tcp dpt:https
379 22728 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh
18316 1110K ACCEPT tcp -- any any anywhere anywhere tcp dpts:8071:8079
120K 15M ACCEPT udp -- any any anywhere anywhere udp dpt:6881
24809 1489K ACCEPT tcp -- any any anywhere anywhere tcp dpt:9001
688 35244 ACCEPT tcp -- any any anywhere anywhere tcp dpt:9030
874 73072 ACCEPT icmp -- any any anywhere anywhere icmp echo-request
12705 871K REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
14M 12G ACCEPT all -- any any anywhere anywhere









share|improve this question
















I'm following this guide here: http://isalazyadmin.net/2009/07/02/configuring-a-basic-firewall-for-debian-linux/



And I have the iptables listed shown, but my server still appears to be accepting all incoming connections (ie: bittorrent peers are still connecting, even though I didn't allow those ports).



/etc/iptables.rules



*filter

# This will allow all loopback (lo0) traffic and drop all traffic to 127/8
# that does not use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

# This accepts all already established connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# This allows all outbound traffic
-A OUTPUT -j ACCEPT

# This will allow HTTP and HTTPS connections from anywhere, this are the normal
# ports used for a web server
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

# Allow SSH connections
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow bittorrent/rtorrent ports, from ~/.rtorrent.rc
## -A INPUT -p tcp --dport 8071:8079 -j ACCEPT


# Allow ICMP ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# Reject all other inbound traffic
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT


When I run iptables -L after a reboot, I still get this as my first rule:



iptables -L



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


Not sure where this is coming from.



Here is the full list:



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere loopback/8 reject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT icmp -- anywhere anywhere icmp echo-request
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


Here is the output of iptables-save:



# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*raw
:PREROUTING ACCEPT [6701:942626]
:OUTPUT ACCEPT [8927:989420]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*nat
:PREROUTING ACCEPT [3281:284415]
:INPUT ACCEPT [9:720]
:OUTPUT ACCEPT [1758:148908]
:POSTROUTING ACCEPT [1758:148908]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*mangle
:PREROUTING ACCEPT [6701:942626]
:INPUT ACCEPT [6701:942626]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [8928:989684]
:POSTROUTING ACCEPT [8928:989684]
COMMIT
# Completed on Fri Jan 11 09:54:19 2013
# Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -j ACCEPT
COMMIT
# Completed on Fri Jan 11 09:54:19 2013


Here is the iptables -vL output:



$ sudo iptables -vL
[sudo] password for ettinger:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
8303 1206K ACCEPT all -- lo any anywhere anywhere
0 0 REJECT all -- !lo any anywhere loopback/8 reject-with icmp-port-unreachable
12M 7191M ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
18 980 ACCEPT tcp -- any any anywhere anywhere tcp dpt:www
7 344 ACCEPT tcp -- any any anywhere anywhere tcp dpt:https
379 22728 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh
18316 1110K ACCEPT tcp -- any any anywhere anywhere tcp dpts:8071:8079
120K 15M ACCEPT udp -- any any anywhere anywhere udp dpt:6881
24809 1489K ACCEPT tcp -- any any anywhere anywhere tcp dpt:9001
688 35244 ACCEPT tcp -- any any anywhere anywhere tcp dpt:9030
874 73072 ACCEPT icmp -- any any anywhere anywhere icmp echo-request
12705 871K REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
14M 12G ACCEPT all -- any any anywhere anywhere






debian iptables






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 12 '13 at 0:25







chovy

















asked Jan 11 '13 at 8:47









chovychovy

5493616




5493616













  • Haven't you noticed your first INPUT rule ACCEPT all -- anywhere anywhere?

    – ott--
    Jan 11 '13 at 9:48






  • 1





    It seems that rules aren't loaded at boot time. Make sure that you added "pre-up iptables-restore < /etc/iptables.rules" line to your /etc/network/interfaces file (as author of tutorial suggests)

    – mzet
    Jan 11 '13 at 9:53






  • 1





    @ott : it concerns lo inteface only, so it's ok

    – mzet
    Jan 11 '13 at 9:54






  • 2





    Can you redo your listing with iptables -vL?

    – ott--
    Jan 11 '13 at 9:58











  • Your rules and your post boot state actually do match up, that is not the problem -- see my answer ;)

    – goldilocks
    Jan 11 '13 at 12:37



















  • Haven't you noticed your first INPUT rule ACCEPT all -- anywhere anywhere?

    – ott--
    Jan 11 '13 at 9:48






  • 1





    It seems that rules aren't loaded at boot time. Make sure that you added "pre-up iptables-restore < /etc/iptables.rules" line to your /etc/network/interfaces file (as author of tutorial suggests)

    – mzet
    Jan 11 '13 at 9:53






  • 1





    @ott : it concerns lo inteface only, so it's ok

    – mzet
    Jan 11 '13 at 9:54






  • 2





    Can you redo your listing with iptables -vL?

    – ott--
    Jan 11 '13 at 9:58











  • Your rules and your post boot state actually do match up, that is not the problem -- see my answer ;)

    – goldilocks
    Jan 11 '13 at 12:37

















Haven't you noticed your first INPUT rule ACCEPT all -- anywhere anywhere?

– ott--
Jan 11 '13 at 9:48





Haven't you noticed your first INPUT rule ACCEPT all -- anywhere anywhere?

– ott--
Jan 11 '13 at 9:48




1




1





It seems that rules aren't loaded at boot time. Make sure that you added "pre-up iptables-restore < /etc/iptables.rules" line to your /etc/network/interfaces file (as author of tutorial suggests)

– mzet
Jan 11 '13 at 9:53





It seems that rules aren't loaded at boot time. Make sure that you added "pre-up iptables-restore < /etc/iptables.rules" line to your /etc/network/interfaces file (as author of tutorial suggests)

– mzet
Jan 11 '13 at 9:53




1




1





@ott : it concerns lo inteface only, so it's ok

– mzet
Jan 11 '13 at 9:54





@ott : it concerns lo inteface only, so it's ok

– mzet
Jan 11 '13 at 9:54




2




2





Can you redo your listing with iptables -vL?

– ott--
Jan 11 '13 at 9:58





Can you redo your listing with iptables -vL?

– ott--
Jan 11 '13 at 9:58













Your rules and your post boot state actually do match up, that is not the problem -- see my answer ;)

– goldilocks
Jan 11 '13 at 12:37





Your rules and your post boot state actually do match up, that is not the problem -- see my answer ;)

– goldilocks
Jan 11 '13 at 12:37










3 Answers
3






active

oldest

votes


















15














The line you are worried about:



Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere


is actually because of this in your rules:



-A INPUT -i lo -j ACCEPT


Notice the interface is explicit in the rule, but not in the -L output. Move that rule to the middle of the list, use iptables-restore and notice the "ACCEPT all -- anywhere" has moved down too. Now try changing the rule a bit:



-A INPUT -i lo -s 127.0.0.1 -j ACCEPT


and the -L output will become:



target     prot opt source                 destination  
ACCEPT all -- localhost.localdomain anywhere


"localhost.localdomain" will be your 127.0.0.1 hostname from /etc/hosts. This at least makes it clearer where that rule came from.



You can also see more detailed information including the interfaces with iptables -vL.



BTW, you may want to start your rules:



*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]


Drop everything by default as a fall through for safety. This is considered bad manners, however (see the link in Gilles comment below), so you may want to create a final catch all for each table which uses -j REJECT --reject-with icmp-net-prohibited.






share|improve this answer





















  • 4





    FYI, iptables -vL will show the full rule, including the interface. So it'll eliminate confusion like this.

    – derobert
    Jan 11 '13 at 16:21











  • Thanks @derobert -- I had forgotten about that display. Will edit this into the answer!

    – goldilocks
    Jan 11 '13 at 16:28






  • 2





    Regarding dropping everything by default: Reject IP packets with an ICMP error, or just drop them?

    – Gilles
    Jan 11 '13 at 22:50











  • @derobert +1 on -v switch. My firewall rules don't look as bad as I thought :)

    – rdev5
    Nov 17 '16 at 16:21



















0














Just as a matter of completeness, in order to avoid this problem in future use the -v verbose command line option when displaying the table. As thus:



iptables -Lv


The output should now include the interface it affects in the "in" and "out" columns:



Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
151 13073 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
126 33414 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited





share|improve this answer































    -1














    Problem is in this part of INPUT chain:



    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere


    especially in the last line. Everything after this line is unnecesary, because this line accept everythink.



    You have to delete this line from the rules by this command:



    iptables -D INPUT 1


    You have to inspect your firewall rules, where is rule, which adding this line.






    share|improve this answer



















    • 6





      "ACCEPT all -- anywhere anywhere" comes from this rule: "-A INPUT -i lo -j ACCEPT" so it's concerns only lo interface, so it's not the issue.

      – mzet
      Jan 11 '13 at 10:01











    • I deleted everything, but it still shows up with iptables -L

      – chovy
      Jan 11 '13 at 10:07











    • ok, that's what someone else mentioned. thanks. I can safely ignore it.

      – chovy
      Jan 11 '13 at 10:08






    • 1





      @chovy: your rules are ok. Issue lies in restoring it after reboot. Try follow this steps: debian-administration.org/articles/445

      – mzet
      Jan 11 '13 at 10:26











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f60953%2fincoming-accept-all-iptables-rule-still-appearing%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    15














    The line you are worried about:



    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere


    is actually because of this in your rules:



    -A INPUT -i lo -j ACCEPT


    Notice the interface is explicit in the rule, but not in the -L output. Move that rule to the middle of the list, use iptables-restore and notice the "ACCEPT all -- anywhere" has moved down too. Now try changing the rule a bit:



    -A INPUT -i lo -s 127.0.0.1 -j ACCEPT


    and the -L output will become:



    target     prot opt source                 destination  
    ACCEPT all -- localhost.localdomain anywhere


    "localhost.localdomain" will be your 127.0.0.1 hostname from /etc/hosts. This at least makes it clearer where that rule came from.



    You can also see more detailed information including the interfaces with iptables -vL.



    BTW, you may want to start your rules:



    *filter
    :INPUT DROP [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT DROP [0:0]


    Drop everything by default as a fall through for safety. This is considered bad manners, however (see the link in Gilles comment below), so you may want to create a final catch all for each table which uses -j REJECT --reject-with icmp-net-prohibited.






    share|improve this answer





















    • 4





      FYI, iptables -vL will show the full rule, including the interface. So it'll eliminate confusion like this.

      – derobert
      Jan 11 '13 at 16:21











    • Thanks @derobert -- I had forgotten about that display. Will edit this into the answer!

      – goldilocks
      Jan 11 '13 at 16:28






    • 2





      Regarding dropping everything by default: Reject IP packets with an ICMP error, or just drop them?

      – Gilles
      Jan 11 '13 at 22:50











    • @derobert +1 on -v switch. My firewall rules don't look as bad as I thought :)

      – rdev5
      Nov 17 '16 at 16:21
















    15














    The line you are worried about:



    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere


    is actually because of this in your rules:



    -A INPUT -i lo -j ACCEPT


    Notice the interface is explicit in the rule, but not in the -L output. Move that rule to the middle of the list, use iptables-restore and notice the "ACCEPT all -- anywhere" has moved down too. Now try changing the rule a bit:



    -A INPUT -i lo -s 127.0.0.1 -j ACCEPT


    and the -L output will become:



    target     prot opt source                 destination  
    ACCEPT all -- localhost.localdomain anywhere


    "localhost.localdomain" will be your 127.0.0.1 hostname from /etc/hosts. This at least makes it clearer where that rule came from.



    You can also see more detailed information including the interfaces with iptables -vL.



    BTW, you may want to start your rules:



    *filter
    :INPUT DROP [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT DROP [0:0]


    Drop everything by default as a fall through for safety. This is considered bad manners, however (see the link in Gilles comment below), so you may want to create a final catch all for each table which uses -j REJECT --reject-with icmp-net-prohibited.






    share|improve this answer





















    • 4





      FYI, iptables -vL will show the full rule, including the interface. So it'll eliminate confusion like this.

      – derobert
      Jan 11 '13 at 16:21











    • Thanks @derobert -- I had forgotten about that display. Will edit this into the answer!

      – goldilocks
      Jan 11 '13 at 16:28






    • 2





      Regarding dropping everything by default: Reject IP packets with an ICMP error, or just drop them?

      – Gilles
      Jan 11 '13 at 22:50











    • @derobert +1 on -v switch. My firewall rules don't look as bad as I thought :)

      – rdev5
      Nov 17 '16 at 16:21














    15












    15








    15







    The line you are worried about:



    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere


    is actually because of this in your rules:



    -A INPUT -i lo -j ACCEPT


    Notice the interface is explicit in the rule, but not in the -L output. Move that rule to the middle of the list, use iptables-restore and notice the "ACCEPT all -- anywhere" has moved down too. Now try changing the rule a bit:



    -A INPUT -i lo -s 127.0.0.1 -j ACCEPT


    and the -L output will become:



    target     prot opt source                 destination  
    ACCEPT all -- localhost.localdomain anywhere


    "localhost.localdomain" will be your 127.0.0.1 hostname from /etc/hosts. This at least makes it clearer where that rule came from.



    You can also see more detailed information including the interfaces with iptables -vL.



    BTW, you may want to start your rules:



    *filter
    :INPUT DROP [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT DROP [0:0]


    Drop everything by default as a fall through for safety. This is considered bad manners, however (see the link in Gilles comment below), so you may want to create a final catch all for each table which uses -j REJECT --reject-with icmp-net-prohibited.






    share|improve this answer















    The line you are worried about:



    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere


    is actually because of this in your rules:



    -A INPUT -i lo -j ACCEPT


    Notice the interface is explicit in the rule, but not in the -L output. Move that rule to the middle of the list, use iptables-restore and notice the "ACCEPT all -- anywhere" has moved down too. Now try changing the rule a bit:



    -A INPUT -i lo -s 127.0.0.1 -j ACCEPT


    and the -L output will become:



    target     prot opt source                 destination  
    ACCEPT all -- localhost.localdomain anywhere


    "localhost.localdomain" will be your 127.0.0.1 hostname from /etc/hosts. This at least makes it clearer where that rule came from.



    You can also see more detailed information including the interfaces with iptables -vL.



    BTW, you may want to start your rules:



    *filter
    :INPUT DROP [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT DROP [0:0]


    Drop everything by default as a fall through for safety. This is considered bad manners, however (see the link in Gilles comment below), so you may want to create a final catch all for each table which uses -j REJECT --reject-with icmp-net-prohibited.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Oct 15 '13 at 17:55

























    answered Jan 11 '13 at 12:31









    goldilocksgoldilocks

    62.2k14152210




    62.2k14152210








    • 4





      FYI, iptables -vL will show the full rule, including the interface. So it'll eliminate confusion like this.

      – derobert
      Jan 11 '13 at 16:21











    • Thanks @derobert -- I had forgotten about that display. Will edit this into the answer!

      – goldilocks
      Jan 11 '13 at 16:28






    • 2





      Regarding dropping everything by default: Reject IP packets with an ICMP error, or just drop them?

      – Gilles
      Jan 11 '13 at 22:50











    • @derobert +1 on -v switch. My firewall rules don't look as bad as I thought :)

      – rdev5
      Nov 17 '16 at 16:21














    • 4





      FYI, iptables -vL will show the full rule, including the interface. So it'll eliminate confusion like this.

      – derobert
      Jan 11 '13 at 16:21











    • Thanks @derobert -- I had forgotten about that display. Will edit this into the answer!

      – goldilocks
      Jan 11 '13 at 16:28






    • 2





      Regarding dropping everything by default: Reject IP packets with an ICMP error, or just drop them?

      – Gilles
      Jan 11 '13 at 22:50











    • @derobert +1 on -v switch. My firewall rules don't look as bad as I thought :)

      – rdev5
      Nov 17 '16 at 16:21








    4




    4





    FYI, iptables -vL will show the full rule, including the interface. So it'll eliminate confusion like this.

    – derobert
    Jan 11 '13 at 16:21





    FYI, iptables -vL will show the full rule, including the interface. So it'll eliminate confusion like this.

    – derobert
    Jan 11 '13 at 16:21













    Thanks @derobert -- I had forgotten about that display. Will edit this into the answer!

    – goldilocks
    Jan 11 '13 at 16:28





    Thanks @derobert -- I had forgotten about that display. Will edit this into the answer!

    – goldilocks
    Jan 11 '13 at 16:28




    2




    2





    Regarding dropping everything by default: Reject IP packets with an ICMP error, or just drop them?

    – Gilles
    Jan 11 '13 at 22:50





    Regarding dropping everything by default: Reject IP packets with an ICMP error, or just drop them?

    – Gilles
    Jan 11 '13 at 22:50













    @derobert +1 on -v switch. My firewall rules don't look as bad as I thought :)

    – rdev5
    Nov 17 '16 at 16:21





    @derobert +1 on -v switch. My firewall rules don't look as bad as I thought :)

    – rdev5
    Nov 17 '16 at 16:21













    0














    Just as a matter of completeness, in order to avoid this problem in future use the -v verbose command line option when displaying the table. As thus:



    iptables -Lv


    The output should now include the interface it affects in the "in" and "out" columns:



    Chain INPUT (policy DROP 0 packets, 0 bytes)
    pkts bytes target prot opt in out source destination
    151 13073 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
    0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
    0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
    0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
    126 33414 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited





    share|improve this answer




























      0














      Just as a matter of completeness, in order to avoid this problem in future use the -v verbose command line option when displaying the table. As thus:



      iptables -Lv


      The output should now include the interface it affects in the "in" and "out" columns:



      Chain INPUT (policy DROP 0 packets, 0 bytes)
      pkts bytes target prot opt in out source destination
      151 13073 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
      0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
      0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
      0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
      126 33414 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited





      share|improve this answer


























        0












        0








        0







        Just as a matter of completeness, in order to avoid this problem in future use the -v verbose command line option when displaying the table. As thus:



        iptables -Lv


        The output should now include the interface it affects in the "in" and "out" columns:



        Chain INPUT (policy DROP 0 packets, 0 bytes)
        pkts bytes target prot opt in out source destination
        151 13073 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
        0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
        0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
        0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
        126 33414 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited





        share|improve this answer













        Just as a matter of completeness, in order to avoid this problem in future use the -v verbose command line option when displaying the table. As thus:



        iptables -Lv


        The output should now include the interface it affects in the "in" and "out" columns:



        Chain INPUT (policy DROP 0 packets, 0 bytes)
        pkts bytes target prot opt in out source destination
        151 13073 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
        0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
        0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
        0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
        126 33414 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 30 at 19:26









        db_db_

        7112




        7112























            -1














            Problem is in this part of INPUT chain:



            Chain INPUT (policy ACCEPT)
            target prot opt source destination
            ACCEPT all -- anywhere anywhere


            especially in the last line. Everything after this line is unnecesary, because this line accept everythink.



            You have to delete this line from the rules by this command:



            iptables -D INPUT 1


            You have to inspect your firewall rules, where is rule, which adding this line.






            share|improve this answer



















            • 6





              "ACCEPT all -- anywhere anywhere" comes from this rule: "-A INPUT -i lo -j ACCEPT" so it's concerns only lo interface, so it's not the issue.

              – mzet
              Jan 11 '13 at 10:01











            • I deleted everything, but it still shows up with iptables -L

              – chovy
              Jan 11 '13 at 10:07











            • ok, that's what someone else mentioned. thanks. I can safely ignore it.

              – chovy
              Jan 11 '13 at 10:08






            • 1





              @chovy: your rules are ok. Issue lies in restoring it after reboot. Try follow this steps: debian-administration.org/articles/445

              – mzet
              Jan 11 '13 at 10:26
















            -1














            Problem is in this part of INPUT chain:



            Chain INPUT (policy ACCEPT)
            target prot opt source destination
            ACCEPT all -- anywhere anywhere


            especially in the last line. Everything after this line is unnecesary, because this line accept everythink.



            You have to delete this line from the rules by this command:



            iptables -D INPUT 1


            You have to inspect your firewall rules, where is rule, which adding this line.






            share|improve this answer



















            • 6





              "ACCEPT all -- anywhere anywhere" comes from this rule: "-A INPUT -i lo -j ACCEPT" so it's concerns only lo interface, so it's not the issue.

              – mzet
              Jan 11 '13 at 10:01











            • I deleted everything, but it still shows up with iptables -L

              – chovy
              Jan 11 '13 at 10:07











            • ok, that's what someone else mentioned. thanks. I can safely ignore it.

              – chovy
              Jan 11 '13 at 10:08






            • 1





              @chovy: your rules are ok. Issue lies in restoring it after reboot. Try follow this steps: debian-administration.org/articles/445

              – mzet
              Jan 11 '13 at 10:26














            -1












            -1








            -1







            Problem is in this part of INPUT chain:



            Chain INPUT (policy ACCEPT)
            target prot opt source destination
            ACCEPT all -- anywhere anywhere


            especially in the last line. Everything after this line is unnecesary, because this line accept everythink.



            You have to delete this line from the rules by this command:



            iptables -D INPUT 1


            You have to inspect your firewall rules, where is rule, which adding this line.






            share|improve this answer













            Problem is in this part of INPUT chain:



            Chain INPUT (policy ACCEPT)
            target prot opt source destination
            ACCEPT all -- anywhere anywhere


            especially in the last line. Everything after this line is unnecesary, because this line accept everythink.



            You have to delete this line from the rules by this command:



            iptables -D INPUT 1


            You have to inspect your firewall rules, where is rule, which adding this line.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 11 '13 at 9:50









            Jan MarekJan Marek

            2,392910




            2,392910








            • 6





              "ACCEPT all -- anywhere anywhere" comes from this rule: "-A INPUT -i lo -j ACCEPT" so it's concerns only lo interface, so it's not the issue.

              – mzet
              Jan 11 '13 at 10:01











            • I deleted everything, but it still shows up with iptables -L

              – chovy
              Jan 11 '13 at 10:07











            • ok, that's what someone else mentioned. thanks. I can safely ignore it.

              – chovy
              Jan 11 '13 at 10:08






            • 1





              @chovy: your rules are ok. Issue lies in restoring it after reboot. Try follow this steps: debian-administration.org/articles/445

              – mzet
              Jan 11 '13 at 10:26














            • 6





              "ACCEPT all -- anywhere anywhere" comes from this rule: "-A INPUT -i lo -j ACCEPT" so it's concerns only lo interface, so it's not the issue.

              – mzet
              Jan 11 '13 at 10:01











            • I deleted everything, but it still shows up with iptables -L

              – chovy
              Jan 11 '13 at 10:07











            • ok, that's what someone else mentioned. thanks. I can safely ignore it.

              – chovy
              Jan 11 '13 at 10:08






            • 1





              @chovy: your rules are ok. Issue lies in restoring it after reboot. Try follow this steps: debian-administration.org/articles/445

              – mzet
              Jan 11 '13 at 10:26








            6




            6





            "ACCEPT all -- anywhere anywhere" comes from this rule: "-A INPUT -i lo -j ACCEPT" so it's concerns only lo interface, so it's not the issue.

            – mzet
            Jan 11 '13 at 10:01





            "ACCEPT all -- anywhere anywhere" comes from this rule: "-A INPUT -i lo -j ACCEPT" so it's concerns only lo interface, so it's not the issue.

            – mzet
            Jan 11 '13 at 10:01













            I deleted everything, but it still shows up with iptables -L

            – chovy
            Jan 11 '13 at 10:07





            I deleted everything, but it still shows up with iptables -L

            – chovy
            Jan 11 '13 at 10:07













            ok, that's what someone else mentioned. thanks. I can safely ignore it.

            – chovy
            Jan 11 '13 at 10:08





            ok, that's what someone else mentioned. thanks. I can safely ignore it.

            – chovy
            Jan 11 '13 at 10:08




            1




            1





            @chovy: your rules are ok. Issue lies in restoring it after reboot. Try follow this steps: debian-administration.org/articles/445

            – mzet
            Jan 11 '13 at 10:26





            @chovy: your rules are ok. Issue lies in restoring it after reboot. Try follow this steps: debian-administration.org/articles/445

            – mzet
            Jan 11 '13 at 10:26


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f60953%2fincoming-accept-all-iptables-rule-still-appearing%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to make a Squid Proxy server?

            第一次世界大戦

            Touch on Surface Book