Конфигурация файла sysctl.conf, если ваш linux сервер будет выполнять функцию маршрутизации трафика с использованием NAT.

sysctl.conf
kernel.sysrq = 1
fs.file-max = 2097152
vm.dirty_ratio = 10
vm.dirty_background_ratio = 5
vm.swappiness = 10
vm.min_free_kbytes = 98302
net.ipv4.neigh.default.gc_thresh3 = 393216
net.ipv4.neigh.default.gc_thresh2 = 196605
net.ipv4.neigh.default.gc_thresh1 = 98302
net.ipv4.neigh.default.gc_stale_time = 10
net.core.wmem_default = 12582912
net.core.wmem_max = 12582912
net.core.rmem_default = 12582912
net.core.rmem_max = 12582912
net.core.netdev_max_backlog = 3000
net.core.somaxconn = 32768
net.core.optmem_max = 50331648
net.ipv4.route.max_size = 196605
net.ipv4.tcp_congestion_control = htcp
net.ipv4.tcp_rmem = 12288 196605 50331648
net.ipv4.tcp_wmem = 12288 196605 50331648
net.ipv4.tcp_mem = 12288 196605 50331648
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_keepalive_intvl = 10
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_fack = 0
net.ipv4.tcp_sack = 0
net.ipv4.tcp_syncookies = 1
 
# I'm a router with netfilter!
net.ipv4.ip_forward=1
net.nf_conntrack_max = 1410065400
net.ipv4.netfilter.ip_conntrack_generic_timeout = 300
net.ipv4.netfilter.ip_conntrack_checksum = 1
net.ipv4.netfilter.ip_conntrack_icmp_timeout = 30
net.ipv4.netfilter.ip_conntrack_udp_timeout = 30
net.ipv4.netfilter.ip_conntrack_udp_timeout_stream = 180
net.ipv4.netfilter.ip_conntrack_tcp_timeout_close = 10
net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait = 60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 86400
net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait = 90
net.ipv4.netfilter.ip_conntrack_tcp_timeout_last_ack = 30
net.ipv4.netfilter.ip_conntrack_tcp_timeout_max_retrans = 300
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_recv = 30
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_sent = 60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_sent2 = 60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 60
net.ipv4.netfilter.ip_conntrack_tcp_max_retrans = 3
net.ipv4.netfilter.ip_conntrack_tcp_be_liberal = 0
net.ipv4.netfilter.ip_conntrack_tcp_loose = 3
net.ipv4.netfilter.ip_conntrack_tcp_timeout_max_retrans = 180
net.ipv4.netfilter.ip_conntrack_log_invalid = 0