LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 03-18-2004, 10:38 AM   #1
parikrama
LQ Newbie
 
Registered: Mar 2004
Posts: 5

Rep: Reputation: 0
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
 
Old 03-18-2004, 12:32 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
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.
 
Old 03-18-2004, 01:56 PM   #3
parikrama
LQ Newbie
 
Registered: Mar 2004
Posts: 5

Original Poster
Rep: Reputation: 0
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...

Last edited by parikrama; 03-18-2004 at 02:18 PM.
 
Old 03-18-2004, 06:48 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
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
 
Old 03-19-2004, 11:56 AM   #5
parikrama
LQ Newbie
 
Registered: Mar 2004
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 03-19-2004, 01:01 PM   #6
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
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
 
Old 03-19-2004, 01:12 PM   #7
parikrama
LQ Newbie
 
Registered: Mar 2004
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 03-19-2004, 01:25 PM   #8
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
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
 
Old 03-19-2004, 04:11 PM   #9
parikrama
LQ Newbie
 
Registered: Mar 2004
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 03-19-2004, 09:23 PM   #10
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ipchains forwarding rules scheidel21 Linux - Networking 0 01-20-2004 07:37 AM
my rules arong Linux - Newbie 2 11-03-2003 03:55 PM
my rules arong Linux - Networking 1 11-03-2003 02:18 PM
clearing up ipchains rules antken Linux - Networking 6 11-04-2002 03:26 PM
Viruses, ipchains, dynamic rules, rules with regular expressions marktaff Linux - Security 2 09-25-2001 04:01 AM


All times are GMT -5. The time now is 03:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration