From 27ae88d7a043f654fbd837fe249538bf11d36d48 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 30 Nov 2025 16:30:59 +0100 Subject: ... --- hosts/vidhar/network/pppoe.nix | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'hosts/vidhar/network/pppoe.nix') diff --git a/hosts/vidhar/network/pppoe.nix b/hosts/vidhar/network/pppoe.nix index 48f1237b..52151d87 100644 --- a/hosts/vidhar/network/pppoe.nix +++ b/hosts/vidhar/network/pppoe.nix @@ -32,6 +32,8 @@ in { mtu 1492 mru 1492 plugin pppoe.so + pppoe-padi-timeout 1 + pppoe-padi-attempts 10 user congstar password congstar nic-telekom @@ -65,32 +67,34 @@ in { } '' ethtool -K telekom tso off gso off gro off - ip link del "ifb4${pppInterface}" || true - ip link add name "ifb4${pppInterface}" type ifb - ip link set "ifb4${pppInterface}" up + ip link del "ifb4$1" || true + ip link add name "ifb4$1" type ifb + ip link set "ifb4$1" up - tc qdisc del dev "ifb4${pppInterface}" root || true - tc qdisc del dev "${pppInterface}" ingress || true - tc qdisc del dev "${pppInterface}" root || true + tc qdisc del dev "ifb4$1" root || true + tc qdisc del dev "$1" ingress || true + tc qdisc del dev "$1" root || true - tc qdisc add dev "${pppInterface}" handle ffff: ingress - tc filter add dev "${pppInterface}" parent ffff: basic action ctinfo dscp 0x0000003f 0x00000040 action mirred egress redirect dev "ifb4${pppInterface}" - tc qdisc replace dev "ifb4${pppInterface}" root cake memlimit 128Mb overhead 35 mpu 74 regional diffserv4 bandwidth ${toString (builtins.floor (177968 * 0.95))}kbit - tc qdisc replace dev "${pppInterface}" root cake memlimit 128Mb overhead 35 mpu 74 regional nat diffserv4 wash bandwidth ${toString (builtins.floor (41216 * 0.95))}kbit + tc qdisc add dev "$1" handle ffff: ingress + tc filter add dev "$1" parent ffff: basic action ctinfo dscp 0x0000003f 0x00000040 action mirred egress redirect dev "ifb4$1" + tc qdisc replace dev "ifb4$1" root cake memlimit 128Mb overhead 35 mpu 74 regional diffserv4 bandwidth ${toString (builtins.floor (177968 * 0.95))}kbit + tc qdisc replace dev "$1" root cake memlimit 128Mb overhead 35 mpu 74 regional nat diffserv4 wash bandwidth ${toString (builtins.floor (41216 * 0.95))}kbit ''; "ppp/ip-up".source = pkgs.resholve.writeScript "ip-up" { interpreter = pkgs.runtimeShell; inputs = [ pkgs.iproute2 ]; execer = [ "cannot:${lib.getExe' pkgs.iproute2 "ip"}" ]; } '' - ip route add default via "$5" dev "${pppInterface}" metric 512 + ip addr add "$4" peer "$5"/32 dev "$1" + ip route add "$5" dev "1" + ip route add default via "$5" dev "1" metric 512 ''; "ppp/ip-down".source = pkgs.resholve.writeScript "ip-down" { interpreter = pkgs.runtimeShell; inputs = [ pkgs.iproute2 ]; execer = [ "cannot:${lib.getExe' pkgs.iproute2 "ip"}" ]; } '' - ip link del "ifb4${pppInterface}" + ip link del "ifb4$1" ''; }; -- cgit v1.2.3