Hi all,<br><br>That issue is over now. I found why my ESTABLISHED,RELATED rule at the top of INPUT chain did not work for udp and icmp. <br><br>The reason was I have included the protocol as tcp as below<br>iptables -A INPUT -i eth0
<span style="font-weight: bold;">-p tcp</span> -m state --state ESTABLISHED,RELATED -j ACCEPT<br><br>I removed <span style="font-weight: bold;">-p tcp </span>from above rule. Now it works for all protocols. <br><br>Thanks for your support.
<br><br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Robert Spangler</b> <<a href="mailto:lazydog@zoominternet.net">lazydog@zoominternet.net</a>><br>Date: Feb 20, 2007 2:45 AM
<br>Subject: Re: Fwd: [CentOS] HOW to enable traceroute with IPTABLES<br>To: Indunil Jayasooriya <<a href="mailto:indunil75@gmail.com">indunil75@gmail.com</a>><br><br></span>On Mon February 19 2007 00:00, you wrote:
<br><br>> I have included ESTABLISHED,RELATED at the top of your INPUT chain as<br>> below<br>><br>> #Allow established,related trafffic to come back<br>> #(for OUTPUT traffic to come back)<br>> iptables -A INPUT -i eth0 -d
<a href="http://192.168.101.60">192.168.101.60</a> -p tcp -m state --state<br>> ESTABLISHED,RELATED -j ACCEPT<br>><br>> But without an INPUT statament it does not work. BUT for TCP OUTPUT<br>> traffice , that will be appilicalbe. But other than tcp (
i.e UPD and ICMP )<br>> I will have to include a INPUT staement.<br><br>I have no INPUT statements for any traffic that is started from my box. You<br>will only need INPUT statements for traffic that originates from the internet
<br>that you want to connect to your box.<br><br>> A few OUTPUT rules that I need INPUT statemet are give below. (not TCP)<br>><br>> #UDP<br>> iptables -A OUTPUT -p udp -o eth0 --dport 53 -j ACCEPT<br>> iptables -A INPUT -p udp -i eth0 --sport 53 -j ACCEPT
<br><br>You don't need INPUT statesments for DNS unless you are expecting someone to<br>connect to your box from the outside. ESTABLISHED,RELATED should take care<br>of this for you.<br><br>> #ICMP (for ping <a href="http://www.google.com">
www.google.com</a>)<br>><br>> iptables -A OUTPUT -p icmp -d <a href="http://64.233.189.104">64.233.189.104</a> -j ACCEPT<br>> iptables -A INPUT -p icmp -s <a href="http://64.233.189.104">64.233.189.104</a> -j ACCEPT
<br><br>OK, here there are many diffierent kind of ICMP traffic To view what is<br>avaliable try this:<br><br>iptables -p icmp -h<br><br>With the above INPUT statement you are allowing all types of ICMP packets into<br>your system.
<br><br>> And this is for TCP ( it does not nedd a INPUT satatment .it works fine)<br>><br>> iptables -A OUTPUT -p tcp -o eth0 --dport 22 -j ACCEPT<br><br>That is because the reply for the system you are SSH'ing to is already
<br>concidered an ESATBLISHED,RELATED connection which is handled by you<br>ESTABLISHED,RELATED rule.<br><br>> PLs expalin, why?<br><br>I hope that might have cleared up some confusion you were/are having.<br><br><br>
--<br><br>Regards<br>Robert<br><br>Smile... it increases your face value!<br><br clear="all"><br>-- <br>Thank you<br>Indunil Jayasooriya<br>