ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I know, that this is an old question, but this is where google led me, so for future reference:
You can limit the range of ephemeral ports (i.e. ports that are assigned to sockets that do not request a certain port number) using
echo 4000-4200,5000-6000 | sudo tee /proc/sys/net/ipv4/ip_local_reserved_ports
here you forbid to use ports in the range 4000 to 4200 or 5000 to 6000. You can check all available ports using
echo /proc/sys/net/ipv4/ip_local_port_range
If you want this changes to take effect on startup, add a line similar to the following to /etc/rc.local
:
echo 4000-4200,5000-6000 > /proc/sys/net/ipv4/ip_local_reserved_ports