LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   IPChains Rules (http://www.linuxquestions.org/questions/linux-security-4/ipchains-rules-159422/)

parikrama 03-18-2004 10:38 AM

IPChains Rules
 
I have a system running RedHat and would like to know if any rules can be set in IPChains, so that it can expicitly allow tcp 110.
The reason is that, I have enabled Pop3 services to run on the machine, but users are not able to receive email when they are popping the mail..They can however send the mail...

Thanks

Capt_Caveman 03-18-2004 12:32 PM

Welcome to LinuxQuestions.

What version of Redhat are you using? Ipchains is fairly old and has been deprecated in favor of Iptables. The rule should be very similar, but the syntax is slighly differnet depending on whether you are using ipchains or iptables.

parikrama 03-18-2004 01:56 PM

IPChains Rules
 
The RedHat release version is Red Hat Enterprise Linux ES release 2.1 (Panama).

This is what I get when I do an ipchains -L input.
________________________________________________
[[root@**** sbin]# ipchains -L input

ACCEPT udp ------ dhcp1.*.* anywhere domain -> 1025:65535
ACCEPT udp ------ dnstwo.*.* anywhere domain -> 1025:65535
ACCEPT udp ------ ccts.*.* anywhere domain -> 1025:65535
ACCEPT tcp -y---- anywhere anywhere any -> smtp
ACCEPT tcp -y---- anywhere anywhere any -> http
ACCEPT tcp -y---- anywhere anywhere any -> ssh
ACCEPT all ------ anywhere anywhere n/a
REJECT tcp -y---- anywhere anywhere any -> 0:1023
REJECT tcp -y---- anywhere anywhere any -> nfs
REJECT udp ------ anywhere anywhere any -> 0:1023
REJECT udp ------ anywhere anywhere any -> nfs
REJECT tcp -y---- anywhere anywhere any -> x11:6009
REJECT tcp -y---- anywhere anywhere any -> xfs
________________________________________________

So, if there is anyway to expicitly allow tcp 110...

Capt_Caveman 03-18-2004 06:48 PM

Redhat Linux Enerprise Edition ES 2.1 should be using the 2.4.x series kernel and should therefore have support for iptables. You might want to think about using the iptables facility which allows for statefull packet filtering. If you don't care to switch, this rule should work for ipchains:

ipchains -I input -p tcp ---dport 110 -j ACCEPT

parikrama 03-19-2004 11:56 AM

IP CHains rules
 
One more dumb question...Where and how would I be applying these rules..Where would I have to modify them..Just started dealing with IPchains and am not familiar with RedHat either...

Thanks

Capt_Caveman 03-19-2004 01:01 PM

Just enter them in from the command line just like you would with any other command, though you will have to be root. If the command has been entered properly, you should just get a new bash prompt, otherwise you should see an error message. Then to save the rules (otherwise they would be lost on reboot), do:

/etc/init.d/ipchains save
/etc/init.d/ipchains restart

parikrama 03-19-2004 01:12 PM

IPChains
 
Thanks a lot for the help..Now, if this rule did not work, how would I remove them, or make the ipchains rules go back to its earlier configuration..


Thx

Capt_Caveman 03-19-2004 01:25 PM

Just use the -D option (delete) with the exact same syntax as the rule you want to remove (the syntax must be identical):

ipchains -D input -p tcp ---dport 110 -j ACCEPT

Again, you will have to save any changes to make them permanent. Here is a good HOWTO on ipchains if you want to read up on the commands and functions of ipchains:

http://www.tldp.org/HOWTO/IPCHAINS-HOWTO.html

parikrama 03-19-2004 04:11 PM

ipchains
 
I tried adding the rule, and this is what I got..

ipchains: unrecognized option `---dport'

Do I have to be in single user mode to do this..Or, is it the wrong version..The version that is running on the RedHat Box is
ipchains --version
ipchains 1.3.10, 1-Sep-2000..

Just in case, how do I stop ipchains..Stop the processs from running..


Thx

Capt_Caveman 03-19-2004 09:23 PM

My ipchains is a bit rusty, but the --dport should work. Try:

ipchains -A input -p tcp -s 0/0 -d 0/0 110 -j ACCEPT

That should definitely work. Also keep in mind that if you enter the syntax improperly, then nothing is loaded to the ruleset (you can confirm that with ipchains -L) If you need to stop, start, or restart the ipchains facility. just do:

/etc/init.d/ipchains stop
/etc/init.d/ipchains start
/etc/init.d/ipchains restart


All times are GMT -5. The time now is 04:43 PM.