List of sysctl tunables
This list is not complete and many of these settings might not always be appropriate, however I will start going through these at a later time to explain what they do.
echo 'net.core.wmem_max=12582912' >> /etc/sysctl.conf echo 'net.core.rmem_max=12582912' >> /etc/sysctl.conf echo 'net.ipv4.tcp_rmem= 10240 87380 12582912' >> /etc/sysctl.conf echo 'net.ipv4.tcp_wmem= 10240 87380 12582912' >> /etc/sysctl.conf echo 'net.ipv4.tcp_sack = 1' >> /etc/sysctl.conf echo 'net.core.netdev_max_backlog = 5000' >> /etc/sysctl.conf echo 'net.ipv4.tcp_tw_reuse=1' >> /etc/sysctl.conf echo 'net.ipv4.tcp_tw_recycle=1' >> /etc/sysctl.conf echo 'net.ipv4.ip_local_port_range=1024 65535' >> /etc/sysctl.conf sysctl -p
Virtual IP Address
You can add several virtual IP addresses to a physical network interface. A good starting point is to copy the interface definition file of the device you want to add a virtual IP address to.
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
- You may have to modify ifcfg-eth0 to match your physical interface name.
- Now you can edit the new file ifcfg-eth0:0 and specify the network settings of the virtual interface.
- If you want the virtual IP address come up on boot, you need to remove
ONBOOT=YES and make it ONPARENT=YES
This makes the interface only come up when the parent interface comes up, while ONBOOT=YES would pull up the parent interface even if that is configured to not come up on boot.
- To make the changes take effect please restart the network services using:
service network restart
Find the current limit
Find the current amount of connections
Raise this limit
sysctl net.ipv4.netfilter.ip_conntrack_max net.ipv4.netfilter.ip_conntrack_max =
Get network statistics
New server missing some IPs it was supposed to come with?
service ipaliases restart
Show route table:
ifconfig ethX ip ifconfig ethx netmask (netmask) ifconfig ethx broadcast (broadcast)
Where all the nics are actually configured:
To enable IP packet forwarding please edit /etc/sysctl.conf with your editor of choice and set:
# Controls IP packet forwarding net.ipv4.ip_forward = 1
You can then verify your settings with: