mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-08-21 05:28:08 +00:00
portmapping: blow up nf_conntrack_max
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
This commit is contained in:
@@ -66,6 +66,9 @@ int hyper_setup_iptables_rule(struct ipt_rule rule)
|
||||
// initialize modules and iptables chains
|
||||
int hyper_setup_portmapping(struct hyper_pod *pod)
|
||||
{
|
||||
const char *connmax = "10485760";
|
||||
const char *timeout = "300";
|
||||
|
||||
if (pod->portmap_white_lists == NULL || (pod->portmap_white_lists->i_num == 0 &&
|
||||
pod->portmap_white_lists->e_num == 0)) {
|
||||
return 0;
|
||||
@@ -148,6 +151,16 @@ int hyper_setup_portmapping(struct hyper_pod *pod)
|
||||
}
|
||||
}
|
||||
|
||||
/* portmapping enables nf_conntrack by default, should blow up nf_conntack_max to make sure
|
||||
* nf_conntrack is available for connections. */
|
||||
if (hyper_write_file("/proc/sys/net/nf_conntrack_max", connmax, strlen(connmax)) < 0) {
|
||||
fprintf(stderr, "sysctl: setup default nf_conntrack_max(%s) failed\n", connmax);
|
||||
}
|
||||
|
||||
if (hyper_write_file("/proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established", timeout, strlen(timeout)) < 0) {
|
||||
fprintf(stderr, "sysctl: setup default nf_conntrack_tcp_timeout_established(%s) failed\n", timeout);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user