From 62c7fe136542e0af4f7b5e0da77b559ea3d35377 Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Sat, 10 Oct 2026 19:24:22 +0200 Subject: networking: internet access via ppp --- config/networking/default.nix | 23 -------------------- config/networking/services/default.nix | 12 ++++++++-- config/networking/services/firewall/ruleset.nix | 6 ++--- config/networking/services/ppp.nix | 29 +++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 config/networking/services/ppp.nix (limited to 'config/networking') diff --git a/config/networking/default.nix b/config/networking/default.nix index 429218f..cce05f1 100644 --- a/config/networking/default.nix +++ b/config/networking/default.nix @@ -43,19 +43,6 @@ in }; }; }; - enp4s0 = { - subnet = { - prefix = "192.168.1"; - prefixLength = 24; - }; - machines = { - self = { - mac = "00:0d:b9:5f:58:f2"; - ip = "192.168.1.2"; - }; - livebox.ip = "192.168.1.1"; - }; - }; wlp1s0 = { bridges = [ "wan" ]; machines.self.mac = "04:f0:21:b6:11:fc"; @@ -145,17 +132,7 @@ in # quad9 "9.9.9.9" "149.112.112.112" - # isp - config.networking.defaultGateway.address ]; - defaultGateway = - let - interface = "enp4s0"; - in - { - inherit interface; - address = ifaces.all."${interface}".machines.livebox.ip; - }; hosts = let diff --git a/config/networking/services/default.nix b/config/networking/services/default.nix index 623a1c7..12c1a03 100644 --- a/config/networking/services/default.nix +++ b/config/networking/services/default.nix @@ -1,3 +1,11 @@ -{...}: { - imports = [./ap.nix ./dhcp.nix ./dns.nix ./firewall ./ifplugd.nix ./igmpproxy.nix]; +{ ... }: { + imports = [ + ./ap.nix + ./dhcp.nix + ./dns.nix + ./firewall + ./ifplugd.nix + ./igmpproxy.nix + ./ppp.nix + ]; } diff --git a/config/networking/services/firewall/ruleset.nix b/config/networking/services/firewall/ruleset.nix index ada3518..cbd7631 100644 --- a/config/networking/services/firewall/ruleset.nix +++ b/config/networking/services/firewall/ruleset.nix @@ -171,7 +171,7 @@ in '' + conntrack + '' - meta oifname enp4s0 goto extranet + meta oifname ppp0 goto extranet meta iifname . meta oifname vmap \ { wan . iot : goto wan_iot \ , iot . wan : goto iot_wan \ @@ -187,8 +187,8 @@ in priority = "srcnat"; policy = "accept"; rules = '' - meta oifname enp4s0 \ - snat to ${interfaces.all.enp4s0.machines.self.ip} + meta oifname ppp0 \ + masquerade ''; }; }; diff --git a/config/networking/services/ppp.nix b/config/networking/services/ppp.nix new file mode 100644 index 0000000..15134df --- /dev/null +++ b/config/networking/services/ppp.nix @@ -0,0 +1,29 @@ +{ ... }: +{ + networking = { + interfaces.enp4s0 = { + useDHCP = false; + ipv4.addresses = [ ]; + }; + + vlans."enp4s0.7" = { + id = 7; + interface = "enp4s0"; + }; + }; + + services.pppd = { + enable = true; + peers.deutschtelekom = { + enable = true; + config = '' + plugin pppoe.so enp4s0.7 + user "0022166749927300145510810001@t-online.de" + noauth + defaultroute + persist + ''; + # password in /etc/ppp/{pap,chap}-secrets + }; + }; +} -- cgit v1.3.1