Compare commits

...

3 Commits

Author SHA1 Message Date
32e6d3b60a fix mangle rules for incoming traffic 2024-12-12 16:58:52 +01:00
2a23c234ac fix Sonarr build 2024-12-12 16:50:50 +01:00
9d15f4f4c8 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/cd3e8833d70618c4eea8df06f95b364b016d4950' (2024-10-26)
  → 'github:NixOS/nixpkgs/7109b680d161993918b0a126f38bc39763e5a709' (2024-12-09)
• Updated input 'nixpkgs-unstable':
    'github:NixOS/nixpkgs/18536bf04cd71abd345f9579158841376fdd0c5a' (2024-10-25)
  → 'github:NixOS/nixpkgs/a73246e2eef4c6ed172979932bc80e1404ba2d56' (2024-12-09)
2024-12-11 14:47:50 +01:00
3 changed files with 22 additions and 8 deletions

12
flake.lock generated
View File

@ -76,11 +76,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1729973466, "lastModified": 1733730953,
"narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", "narHash": "sha256-dlK7n82FEyZlHH7BFHQAM5tua+lQO1Iv7aAtglc1O5s=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", "rev": "7109b680d161993918b0a126f38bc39763e5a709",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -107,11 +107,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1729880355, "lastModified": 1733759999,
"narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "18536bf04cd71abd345f9579158841376fdd0c5a", "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -59,6 +59,12 @@
inputs = inputs; inputs = inputs;
pkgs-unstable = import nixpkgs-unstable { pkgs-unstable = import nixpkgs-unstable {
inherit system; inherit system;
config.permittedInsecurePackages = [
"aspnetcore-runtime-6.0.36"
"aspnetcore-runtime-wrapped-6.0.36"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
];
}; };
pkgs-4a3fc4cf7 = import nixpkgs-4a3fc4cf7 { pkgs-4a3fc4cf7 = import nixpkgs-4a3fc4cf7 {
inherit system; inherit system;

View File

@ -88,9 +88,14 @@
ip46tables -w -t mangle -X loutreos-mangle-pre 2>/dev/null || true ip46tables -w -t mangle -X loutreos-mangle-pre 2>/dev/null || true
ip46tables -w -t mangle -N loutreos-mangle-pre ip46tables -w -t mangle -N loutreos-mangle-pre
# Restore the packet's CONNMARK to the MARK for existing connections # Restore the packet's CONNMARK to the MARK for existing incoming connections
ip46tables -w -t mangle -A loutreos-mangle-pre -j CONNMARK --restore-mark ip46tables -w -t mangle -A loutreos-mangle-pre -j CONNMARK --restore-mark
# Restore CONNMARK to MARK for outgoing packets before final routing decision
ip46tables -w -t mangle -D OUTPUT -j CONNMARK --restore-mark 2>/dev/null || true
ip46tables -w -t mangle -A OUTPUT -j CONNMARK --restore-mark
# If packet MARK is set, then it means that there is already a connection mark # If packet MARK is set, then it means that there is already a connection mark
ip46tables -w -t mangle -A loutreos-mangle-pre -m mark ! --mark 0 -j ACCEPT ip46tables -w -t mangle -A loutreos-mangle-pre -m mark ! --mark 0 -j ACCEPT
@ -100,8 +105,11 @@
ip46tables -w -t mangle -A loutreos-mangle-pre -i enp0s21u1 -j MARK --set-mark 2 ip46tables -w -t mangle -A loutreos-mangle-pre -i enp0s21u1 -j MARK --set-mark 2
ip46tables -w -t mangle -A loutreos-mangle-pre -i wg0 -j MARK --set-mark 3 ip46tables -w -t mangle -A loutreos-mangle-pre -i wg0 -j MARK --set-mark 3
# Save new mark in CONNMARK
ip46tables -w -t mangle -A loutreos-mangle-pre -j CONNMARK --save-mark
# Jump to newly created target # Jump to newly created target
ip46tables -w -t mangle -A PREROUTING -j loutreos-mangle-pre ip46tables -w -t mangle -I PREROUTING 1 -j loutreos-mangle-pre
# Save MARK to CONNMARK. # Save MARK to CONNMARK.
ip46tables -w -t mangle -D POSTROUTING -j CONNMARK --save-mark 2>/dev/null || true ip46tables -w -t mangle -D POSTROUTING -j CONNMARK --save-mark 2>/dev/null || true