LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-19-2002, 10:41 AM   #1
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Rep: Reputation: 30
Question Fundamental ipchains concept questionn...


Ok...

I am having trouble with a certain concept inherent in ipchains...

Now If I want to allow anyone in the world to access a certain service via a certain port, which one of these rules do I implement?


1)

ipchains -A input -d myipaddress --dport myport -p tcp -j ACCEPT

which comes out as

ACCEPT tcp ------ anywhere myipaddress any -> myport

2)

ipchains -A input -d myipaddress --sport myport -p tcp -j ACCEPT

which comes out as

ACCEPT tcp ------ anywhere myipaddress myport -> any

3)

ipchains -A input -d myipaddress --dport myport --sport myport -p tcp -j ACCEPT

which comes out as

ACCEPT tcp ------ anywhere myipaddress myport -> myport



My best guess is to use the first example...

am I wrong?

the ports in question are generic such as smtp, http, domain, auth, https, etc....

do certain services initiate connections on certain ports (source or destination) and then later change them after a connection has been established?

basically, will said service that is supposed to operate on port X always use port X as it's source and destination port portion of it's transmitted packets?

am I making since? am I thinking about this too hard to the point where I have convoluted the fundamental concept?

any help you can offer is appreciated!
 
Old 12-19-2002, 11:21 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Rule no 1 is the correct one. When someone is connecting to your service, the person is connecting to a certain port, but you don't know which port will this person use (source side). For example, when somone connects to your www server it may be that the person connects from port 1245 (to your port 80) and then, a second try, from the port 1267.
 
Old 12-19-2002, 11:38 AM   #3
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Original Poster
Rep: Reputation: 30
awesome... this was my assumption...
 
  


Reply



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
Arch has fundamental personality issues otchie1 Arch 13 11-23-2005 08:16 PM
The Fundamental Differences Between Linux and Windows Charred Linux - News 23 10-30-2005 01:50 AM
Fundamental Question in C and C++ linux_ub Programming 5 07-28-2004 11:26 AM
Partition fundamental questions jfchui Linux - Newbie 7 04-23-2004 06:47 AM
Fundamental automated tasks dominant Linux - Newbie 6 02-20-2004 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:40 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration