Simple problem with IPTABLES
Hello friends,
I'm having a big trouble because i'm new in linux and don't know almost nothing about IPTABLES. Well, i'd like to open some ports and looking through the net i found a post teaching step by step. I followed as it said, but i stop in an error that i think it's pretty simple, here we go: My steps: 1) Open flle /etc/sysconfig/iptables: Code:
# vi /etc/sysconfig/iptables 2) My archieve, is like this: Code:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8767 -j ACCEPT 3) Save and close the file. Restart iptables: Code:
# /etc/init.d/iptables restart Code:
Flushing firewall rules: [ OK ] Thanks Leandro Anesi |
Try this:
1.iptables -F (flush all the contents) 2.service iptables save. 3.service iptables restart. <the above 3 steps will flush off all the contents previously stored> 4.now start writing your rule.. for eg. to block ssh to your server.. iptables -A INPUT -s <source address> -p tcp --dport 22 -j REJECT iptables -A INPUT -s <source address> -p udp --dport 22 -j REJECT 5.Now list the written rule in the tables iptables -L 6.if correct, save it to /etc/sysconfig/iptables by the follg command: service iptables save. 7. Now, we need to restart the service service iptables restart chkconfig iptables on. 8.Hope this helps. |
Where put the rules?
Thanks for your answer.
I did the procedure, than, now i have this: Code:
# Generated by iptables-save v1.3.5 on Mon Apr 6 13:05:33 2009 Thank you so much. Leandro Anesi |
As saagar said aboive: Enter the rules interactively, when they show in iptables -L,
save them. Alternatively, you should be able to just stick them in here: Code:
:OUTPUT ACCEPT [2351:190030] Cheers, Tink |
Thanks
Thank you very much. You solved my problem.
Leandro Anesi |
All times are GMT -5. The time now is 12:33 AM. |