What is the best way to turn off the iptables

July 05th, 2012 - 10:30 am ET by lina | Report spam
Hi,

What is the best way to turn off the iptables?

or come back to its default settings. Flush my current one.

Since I tried to configure the iptables, I have encountered the
following problems:

1] I can't access the cups and some other ports I opened in localhost.

I comment the line 5 still not work.

# Allow all loopback (lo0) traffic and drop all traffic to 127/8 that
doesn't use lo0
4 -A INPUT -i lo -j ACCEPT
5 #-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

2] The shutdown process in decades long. I mean it used to be fast to
shutdown, now need wait ~3 mins

BTW, how to check the time of booting and shutting down?

3] My syslog is flooding with similar information (kernel: [
436.954509] --log-prefixIN=eth0 OUTMAC=ff:ff:ff:ff:ff:ff:00:30:67:08:28:b3:08:00 SRC2.21.50.212
DST2.21.51.255 LENx TOS=0x00 PREC=0x00 TTL8 IDX729 PROTO=UDP
SPT7 DPT7 LENX ).

google showed me it's possible to put the log not in syslog.

4] Are there someone willing to sharing some iptables template, a bit
mature one with explaination.

Thanks with best regards,

P.S. The current one I used ( mainly adopted from
http://wiki.debian.org/iptables ), Here it is:

1 *filter
2
3 # Allow all loopback (lo0) traffic and drop all traffic to 127/8
that doesn't use lo0
4 -A INPUT -i lo -j ACCEPT
5 #-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
6
7 # Accept all established inbound connections
8 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
9
10 # Allows all outbound traffic
11 # You could modify this to only allow certain traffic
12 -A OUTPUT -j ACCEPT
13
14 # Allow HTTP and HTTPS connections from anywhere (the normal ports
for websites)
15 -A INPUT -p tcp --dport 80 -j ACCEPT
16 -A INPUT -p tcp --dport 443 -j ACCEPT
17
18 # Allow SSH connections
19 #-A INPUT -p tcp --dport 22 -j ACCEPT
20 -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
21
22 # Allow ping
23 -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
24
25 # log iptables denied calls (access via 'dmesg' command)
26 -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables
denied: " --log-level warning
27
28 # Reject all other inbound - default deny unless explicitly allowed policy:
29 -A INPUT -j REJECT
30 -A FORWARD -j REJECT
31
32 COMMIT


To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAG9cJmmxpJmj7PxNi|p1A-3qFKbQZVKUjO5AmWwugTpLRmvA@mail.gmail.com
email Follow the discussionReplies 16 repliesReplies Make a reply

Similar topics

Replies

#16 lina
July 06th, 2012 - 11:00 am ET | Report spam
On Fri, Jul 6, 2012 at 10:15 PM, Panayiotis Karabassis wrote:
Sorry for replying directly but I think you may want to read this.



No need sorry, very nice to have replies.


You have:
Chain INPUT (policy DROP)

This should be ACCEPT instead of DROP. Try:

iptables -P INPUT ACCEPT

Then do the same for the FORWARD chain (if you want to get a "vanilla"
configuration)



Regarding "failed to open the port like cups" problem, one main reason
was that,

The iface lo inet loopback was commented out before in my
/etc/network/interfaces.

My poor knowledge really messed up lots of things.

Thanks again for all the suggestions, it opened many windows for me.

With all the best regards,


To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Archive: http://lists.debian.org/CAG9cJmm1HB...a3JK3Z8oP+
email Follow the discussion Replies Reply to this message
Help Create a new topic Previous pageReplies Make a reply
Search Make your own search