LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-25-2013, 05:02 AM   #1
linuxcenter
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Rep: Reputation: Disabled
Lightbulb what is outgoing/outbound connection source port & destination port ?


i want to allow outgoing connection, mine is destination port or source port? who is destination here, my computer or the server/website im trying to connect & who is source.

eg :
iptables -A OUTPUT -o eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT

here dport 443 (is my port or the port of the computer im trying to connect)

inshort, INCOMING/INBOUND MEANS { FROM/SOURCE PORT /OTHERS PC - TO/DESTINATION PORT /MY PC }

OUTBOUND /OUTGOING MEANS ?
PLS REFER TO THE ABOVE EXAMPLE AND EXPLAIN
 
Old 06-25-2013, 05:15 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Maybe this will help clear things up a bit:

- iptables - source ? destination ? From where ? (here at LQ).
 
1 members found this post helpful.
Old 06-25-2013, 06:00 AM   #3
ali.abry
Member
 
Registered: Feb 2013
Posts: 74

Rep: Reputation: Disabled
Code:
iptables -A OUTPUT -o eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
when you want to connect to https , the data is going out of your computer (OUTPUT) have destination of port number 443 and its source can be any port number between 1024-65535 depending on what number your computer choosed . for example 2748 .

Code:
 iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT
when any data comes from that https server to your computer (INPUT) in respond to your request it sourced from 443 port number and its destination can be any number from 1024-65535 for example 2748 .

its like a two way road .
 
  


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
with iptables, how-to redirect outgoing mail from port 25 to port 587 thumbelina Linux - Networking 12 03-19-2012 09:26 AM
Cannot send outbound mails Connection timed out (port 25) pookemasterus Linux - Server 2 02-04-2011 09:17 PM
Firewall deny traffic inbound destination port 53372 & 53375 Brent Pasley Linux - Security 1 05-05-2010 03:28 PM
Setting the source port for outgoing SMTP connections in exim4 heby Debian 7 11-04-2008 02:08 PM
--destination-ports port[,port[,port...]] KevinGuy Linux - Networking 1 03-16-2004 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:54 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