Skip to content

Instantly share code, notes, and snippets.

@sljeff
Created August 6, 2020 07:37
Show Gist options
  • Save sljeff/802c68cabeadbbda1c5a4a413b65668c to your computer and use it in GitHub Desktop.
Save sljeff/802c68cabeadbbda1c5a4a413b65668c to your computer and use it in GitHub Desktop.
#!/bin/bash
install_ipset() {
yum install -y ipset ipvsadm
}
load_mod() {
echo "#!/bin/bash
modprobe -- ip_vs
modprobe -- ip_vs_rr
modprobe -- ip_vs_wrr
modprobe -- ip_vs_sh
modprobe -- nf_conntrack_ipv4
ipvsadm --set 7300 120 300" > /etc/sysconfig/modules/ipvs.modules
chmod 755 /etc/sysconfig/modules/ipvs.modules
}
update_hash_table_size() {
echo "options ip_vs conn_tab_bits=20" > /etc/modprobe.d/ip_vs.conf
shutdown -r now
}
install_ipset
load_mod
update_hash_table_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment