Compare commits
3 commits
69e69c2b7f
...
55220177d2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55220177d2 | ||
|
|
9e3f2a5982 | ||
|
|
9fc3927c86 |
3 changed files with 53 additions and 52 deletions
|
|
@ -14,7 +14,7 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
self.nixosModules.default
|
self.nixosModules.default
|
||||||
# "${modulesPath}/virtualisation/lxc-container.nix"
|
"${modulesPath}/virtualisation/lxc-container.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
services.arma.enable = true;
|
services.arma.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,37 @@
|
||||||
{
|
{
|
||||||
lib,
|
# lib,
|
||||||
pkgs,
|
# pkgs,
|
||||||
config,
|
# config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
networking.nftables = {
|
networking.nftables = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ruleset = ''
|
tables = {
|
||||||
table inet filter {
|
yggSsh = {
|
||||||
chain input {
|
name = "yggSsh";
|
||||||
type filter hook input priority filter; policy accept;
|
family = "inet";
|
||||||
ct state related,established accept
|
content = ''
|
||||||
|
chain input {
|
||||||
|
type filter hook input priority filter; policy accept;
|
||||||
|
ct state related,established accept
|
||||||
|
|
||||||
# Restrict ygg0: only allow SSH in
|
# Restrict ygg0: only allow SSH in
|
||||||
iifname "ygg0" tcp dport 22 accept
|
iifname "ygg0" tcp dport 22 accept
|
||||||
iifname "ygg0" drop
|
iifname "ygg0" drop
|
||||||
}
|
}
|
||||||
|
|
||||||
chain forward {
|
chain forward {
|
||||||
type filter hook forward priority filter; policy accept;
|
type filter hook forward priority filter; policy accept;
|
||||||
# Optional: drop forwarding via ygg0
|
# Optional: drop forwarding via ygg0
|
||||||
iifname "ygg0" drop
|
iifname "ygg0" drop
|
||||||
}
|
}
|
||||||
|
|
||||||
chain output {
|
chain output {
|
||||||
type filter hook output priority filter; policy accept;
|
type filter hook output priority filter; policy accept;
|
||||||
}
|
}
|
||||||
}
|
'';
|
||||||
'';
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,31 @@
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
systemd.network = {
|
config,
|
||||||
enable = true;
|
pkgs,
|
||||||
networks."50-eth0" = {
|
...
|
||||||
|
}:
|
||||||
matchConfig.Name = "eth0";
|
{
|
||||||
networkConfig = {
|
options.iscontainer.enable = lib.mkEnableOption "iscontainer" // {
|
||||||
DHCP = "ipv4";
|
default = true;
|
||||||
IPv6AcceptRA = true;
|
};
|
||||||
|
config = lib.mkIf config.iscontainer.enable {
|
||||||
|
systemd.network = {
|
||||||
|
enable = true;
|
||||||
|
networks."50-eth0" = {
|
||||||
|
matchConfig.Name = "eth0";
|
||||||
|
networkConfig = {
|
||||||
|
DHCP = "ipv4";
|
||||||
|
IPv6AcceptRA = true;
|
||||||
|
};
|
||||||
|
linkConfig.RequiredForOnline = "routable";
|
||||||
};
|
};
|
||||||
linkConfig.RequiredForOnline = "routable";
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
firewall.enable = false;
|
||||||
|
dhcpcd.enable = false;
|
||||||
|
useDHCP = false;
|
||||||
|
useHostResolvConf = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
|
||||||
# firewall = {
|
|
||||||
firewall.enable = false;
|
|
||||||
# interfaces = {
|
|
||||||
# ygg0 = {
|
|
||||||
# allowedTCPPorts = [ 22 ];
|
|
||||||
# allowedUDPPorts = [ ];
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
|
|
||||||
# # Default deny policy for all interfaces (including ygg0)
|
|
||||||
# allowedTCPPorts = [ ];
|
|
||||||
# allowedUDPPorts = [ ];
|
|
||||||
# };
|
|
||||||
dhcpcd.enable = false;
|
|
||||||
useDHCP = false;
|
|
||||||
useHostResolvConf = false;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue