Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove important ports from ephemeral range #293

Merged
merged 3 commits into from
Oct 19, 2022

Conversation

ameowlia
Copy link
Member

@ameowlia ameowlia commented Oct 19, 2022

<% if p('router.set_kernel_parameters') %>
# Ephemeral port range
echo "<%= p("router.ip_local_port_range") %>" > /proc/sys/net/ipv4/ip_local_port_range

# Reserved Ports, not ephemeral
echo <%= ports.join(",") %> > /proc/sys/net/ipv4/ip_local_reserved_ports
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really how that works? All the things i'm reading make it seem like a two integer range, not a comma-separated value.

Copy link
Member Author

@ameowlia ameowlia Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ip_local_reserved_ports - list of comma separated ranges
Specify the ports which are reserved for known third-party
applications. These ports will not be used by automatic port
assignments (e.g. when calling connect() or bind() with port
number 0). Explicit port allocation behavior is unchanged.

The format used for both input and output is a comma separated
list of ranges (e.g. "1,2-4,10-10" for ports 1, 2, 3, 4 and
10). Writing to the file will clear all previously reserved
ports and update the current list with the one given in the
input.

Per the kernel docs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i see - different proc setting than the range. 👍 neat!

jrussett and others added 2 commits October 19, 2022 17:50
Signed-off-by: Amelia Downs <adowns@vmware.com>
Signed-off-by: Josh Russett <jrussett@vmware.com>
Signed-off-by: Amelia Downs <adowns@vmware.com>
@jrussett jrussett merged commit a7c0ddb into develop Oct 19, 2022
@jrussett jrussett deleted the ip-local-reserved-ports branch October 19, 2022 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ip_local_reserved_ports should be set to deconflict with ip_local_port_range
3 participants