Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-07-2017, 07:00 PM   #1
LQ Newbie
Registered: Nov 2017
Posts: 2

Rep: Reputation: Disabled
source port randomization

Does Linux do source port randomization for instance like FreeBSD and OpenBSD by default? Thanks for any feedback.
Old 11-07-2017, 07:57 PM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,287
Blog Entries: 4

Rep: Reputation: 3307Reputation: 3307Reputation: 3307Reputation: 3307Reputation: 3307Reputation: 3307Reputation: 3307Reputation: 3307Reputation: 3307Reputation: 3307Reputation: 3307
"Source Network Address Translation (SNAT)" is in fact a standard feature of TCP/IP networking. Your present communications with, for instance, appear to LQ to be coming from "your home's IP-address," as defined by your Internet Service Provider, at "a random port-number."

Your router-box assigned that random-number, arbitrarily choosing it for the purposes of this particular communication. It sent the traffic to the Internet using that port-number, knowing that all replies will bear this same number. Therefore, it will use that number to correctly deliver the subsequent replies ... to your computer (or phone). (Versus your spouse's or your sister's, or your refrigerator.)

LQ has no idea what the topology of your home's internal subnet looks like, but it doesn't have to. It simply "accepts traffic from your home's IP (and port-number), and replies to the same," trusting that your router will sort it all out ... as, of course, it does.

Last edited by sundialsvcs; 11-07-2017 at 08:07 PM.
1 members found this post helpful.
Old 11-07-2017, 08:41 PM   #3
Registered: Mar 2008
Posts: 21,142

Rep: Reputation: 3434Reputation: 3434Reputation: 3434Reputation: 3434Reputation: 3434Reputation: 3434Reputation: 3434Reputation: 3434Reputation: 3434Reputation: 3434Reputation: 3434
Like this RFC?

A.1. FreeBSD

FreeBSD 8.0 implements Algorithm 1, and in response to this document
now uses a "min_port" of 10000 and a "max_port" of 65535 [FreeBSD].

A.2. Linux

Linux 2.6.15-53-386 implements Algorithm 3, with MD5 as the hash
algorithm. If the algorithm is faced with the corner-case scenario
described in Section 3.5, Algorithm 1 is used instead [Linux].

A.3. NetBSD

NetBSD 5.0.1 does not obfuscate its ephemeral port numbers. It
selects ephemeral port numbers from the range 49152-65535, starting
from port 65535, and decreasing the port number for each ephemeral
port number selected [NetBSD].

A.4. OpenBSD

OpenBSD 4.2 implements Algorithm 1, with a "min_port" of 1024 and a
"max_port" of 49151. [OpenBSD]

A.5. OpenSolaris

OpenSolaris 2009.06 implements Algorithm 1, with a "min_port" of
32768 and a "max_port" of 65535 [OpenSolaris].
1 members found this post helpful.


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
SRS Randomization CWood Linux - Software 2 07-08-2013 09:49 AM
what is outgoing/outbound connection source port & destination port ? linuxcenter Linux - Newbie 2 06-25-2013 05:00 AM
address space randomization ammalik Linux - Security 1 04-17-2011 07:57 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:27 PM.

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