| Securing and Optimizing Linux: RedHat Edition -A Hands on Guide | ||
|---|---|---|
| Prev | Chapter 6. Linux General Optimization | Next | 
The /proc/sys/net/ipv4/ip_local_port_range defines the local port range that is used by TCP and UDP traffic to choose the local port. You will see in the parameters of this file two numbers: The first number is the first local port allowed for TCP and UDP traffic on the server, the second is the last local port number. For high-usage systems you may change its default parameters to 32768-61000 -first-last.
The default setup for the ip_local_port_range parameters under Red Hat Linux is: "1024 4999"

| 
            [root@deep] /# echo "32768 61000" >/proc/sys/net/ipv4/ip_local_port_range
             | 

| 
            # Allowed local port range
            net.ipv4.ip_local_port_range = 32768 61000
             | 
| 
            [root@deep] /# /etc/rc.d/init.d/network restart
             | 
Setting network parameters [ OK ] Bringing up interface lo [ OK ] Bringing up interface eth0 [ OK ] Bringing up interface eth1 [ OK ]