feat(hosts,lib): adjust kernel sysctl for k8s/dae

This commit is contained in:
Ryan Yin
2024-03-29 23:45:30 +08:00
parent 6ae98566ed
commit e85712ca53
3 changed files with 33 additions and 20 deletions

View File

@@ -5,14 +5,10 @@
ipv4WithMask = "${ipv4}/24";
in {
boot = {
kernel = {
sysctl = {
# forward network packets that are not destined for the interface on which they were received
"net.ipv4.conf.all.forwarding" = true;
"net.ipv6.conf.all.forwarding" = true;
};
};
boot.kernel.sysctl = {
# forward network packets that are not destined for the interface on which they were received
"net.ipv4.conf.all.forwarding" = true;
"net.ipv6.conf.all.forwarding" = true;
};
networking.useNetworkd = true;

View File

@@ -13,18 +13,14 @@
end = "192.168.5.99";
};
in {
# https://github.com/ghostbuster91/blogposts/blob/main/router2023-part2/main.md
boot = {
kernel = {
# https://github.com/daeuniverse/dae/blob/main/docs/en/user-guide/kernel-parameters.md
sysctl = {
# forward network packets that are not destined for the interface on which they were received
"net.ipv4.conf.all.forwarding" = true;
"net.ipv6.conf.all.forwarding" = true;
"net.ipv4.conf.br-lan.rp_filter" = 1;
"net.ipv4.conf.br-lan.send_redirects" = 0;
};
};
boot.kernel.sysctl = {
# https://github.com/ghostbuster91/blogposts/blob/main/router2023-part2/main.md
# https://github.com/daeuniverse/dae/blob/main/docs/en/user-guide/kernel-parameters.md
# forward network packets that are not destined for the interface on which they were received
"net.ipv4.conf.all.forwarding" = true;
"net.ipv6.conf.all.forwarding" = true;
"net.ipv4.conf.br-lan.rp_filter" = 1;
"net.ipv4.conf.br-lan.send_redirects" = 0;
};
# Docker uses iptables internally to setup NAT for containers.