feat: improved config a tad
This commit is contained in:
parent
8f373ada01
commit
6ef12f03de
2 changed files with 27 additions and 2 deletions
|
@ -16,6 +16,22 @@
|
|||
A list of routes to forward
|
||||
'';
|
||||
};
|
||||
|
||||
own_ip = lib.mkOption {
|
||||
default = "127.0.0.1";
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
IP of the firewall
|
||||
'';
|
||||
};
|
||||
|
||||
own_ports = lib.mkOption {
|
||||
default = [ ];
|
||||
type = lib.types.listOf lib.types.int;
|
||||
description = ''
|
||||
A list of ports for the machiene running the firewall
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -57,8 +73,8 @@
|
|||
table ip filter {
|
||||
chain input {
|
||||
type filter hook input priority filter; policy accept;
|
||||
tcp dport 22 counter packets 0 bytes 0 jump fail2ban-ssh
|
||||
tcp dport 22 counter packets 0 bytes 0 accept
|
||||
# for the host machiene
|
||||
${lib.strings.concatMapStrings (x: x + "\n") (map (port: "tcp dport ${toString port} counter packets 0 bytes 0 accept") config.skynet_firewall.own_ports)}
|
||||
}
|
||||
|
||||
chain forward {
|
||||
|
|
|
@ -12,6 +12,15 @@
|
|||
|
||||
# this server is teh firewall
|
||||
skynet_firewall = {
|
||||
# always good to know oneself
|
||||
own_ip = "192.168.1.157";
|
||||
|
||||
# 443 is an ssh port now (heh)
|
||||
own_ports = [
|
||||
22
|
||||
443
|
||||
];
|
||||
|
||||
enable = true;
|
||||
|
||||
# gonna have to get all the
|
||||
|
|
Loading…
Reference in a new issue