Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ifstate: configure sysctl on all hosts #90

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 4 additions & 32 deletions hosts/ixp-as11201/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{ config, ... }:

{
dd-ix = {
useFpx = true;
Expand All @@ -19,38 +21,8 @@
}];

networking.ifstate.settings.namespaces.ixp-peering = {
options.sysctl =
let
options = {
ipv6 = {
# this machine should not participate in SLAAC
accept_ra = 0;
autoconf = 0;
# no redirects nor evil RH0
accept_redirects = 0;
accept_source_route = 0;
# no forwarding
forwarding = 0;
};
ipv4 = {
# no redirects nor source route
accept_redirects = 0;
send_redirects = 0;
accept_source_route = 0;
# handle arp requests strict
arp_ignore = 1;
arp_notify = 1;
# do strict rp filtering
rp_filter = 1;
# no forwarding
forwarding = 0;
};
};
in
{
all = options;
default = options;
};
# copy sysctl from default netns
options.sysctl = config.networking.ifstate.settings.options.sysctl;
interfaces = [
{
name = "any112";
Expand Down
1 change: 1 addition & 0 deletions modules/dd-ix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
./mariadb.nix
./monitoring.nix
./redis.nix
./sysctl.nix
];
}
46 changes: 46 additions & 0 deletions modules/dd-ix/sysctl.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
networking.ifstate.settings.options.sysctl =
let
options = {
ipv6 = {
# this machine should not participate in SLAAC
autoconf = 0;
# nor accept router advertisements
accept_ra = 0;
# no redirects nor evil RH0
accept_redirects = 0;
accept_source_route = 0;
# no forwarding
forwarding = 0;
# unsolicited neighbour advertisements
ndisc_notify = 1;
};
ipv4 = {
# no redirects
accept_redirects = 0;
send_redirects = 0;
accept_source_route = 0;
# handle arp requests strict
arp_ignore = 1;
arp_notify = 1;
# do strict rp filtering
rp_filter = 1;
# no forwarding
forwarding = 0;
};
};
in
{
all = options;
default = options;
net.core = {
# Bufferbloat: fair queuing controlled delay
default_qdisc = "cake";
# tune SoftIRQ packet handling (5x)
netdev_budget_usecs = 10000;
netdev_budget = 1500;
dev_weight = 320;
netdev_max_backlog = 5000;
};
};
}
Loading