diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-11-30 16:30:59 +0100 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-11-30 16:30:59 +0100 |
| commit | 27ae88d7a043f654fbd837fe249538bf11d36d48 (patch) | |
| tree | eb438464751c38737642b69940ce466ca946ded0 /hosts/vidhar/network/pppoe.nix | |
| parent | 03c515fa55657dafa41a6a0fe7bf806bd7521e87 (diff) | |
| download | nixos-27ae88d7a043f654fbd837fe249538bf11d36d48.tar nixos-27ae88d7a043f654fbd837fe249538bf11d36d48.tar.gz nixos-27ae88d7a043f654fbd837fe249538bf11d36d48.tar.bz2 nixos-27ae88d7a043f654fbd837fe249538bf11d36d48.tar.xz nixos-27ae88d7a043f654fbd837fe249538bf11d36d48.zip | |
...
Diffstat (limited to 'hosts/vidhar/network/pppoe.nix')
| -rw-r--r-- | hosts/vidhar/network/pppoe.nix | 28 |
1 files changed, 16 insertions, 12 deletions
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 { | |||
| 32 | mtu 1492 | 32 | mtu 1492 |
| 33 | mru 1492 | 33 | mru 1492 |
| 34 | plugin pppoe.so | 34 | plugin pppoe.so |
| 35 | pppoe-padi-timeout 1 | ||
| 36 | pppoe-padi-attempts 10 | ||
| 35 | user congstar | 37 | user congstar |
| 36 | password congstar | 38 | password congstar |
| 37 | nic-telekom | 39 | nic-telekom |
| @@ -65,32 +67,34 @@ in { | |||
| 65 | } '' | 67 | } '' |
| 66 | ethtool -K telekom tso off gso off gro off | 68 | ethtool -K telekom tso off gso off gro off |
| 67 | 69 | ||
| 68 | ip link del "ifb4${pppInterface}" || true | 70 | ip link del "ifb4$1" || true |
| 69 | ip link add name "ifb4${pppInterface}" type ifb | 71 | ip link add name "ifb4$1" type ifb |
| 70 | ip link set "ifb4${pppInterface}" up | 72 | ip link set "ifb4$1" up |
| 71 | 73 | ||
| 72 | tc qdisc del dev "ifb4${pppInterface}" root || true | 74 | tc qdisc del dev "ifb4$1" root || true |
| 73 | tc qdisc del dev "${pppInterface}" ingress || true | 75 | tc qdisc del dev "$1" ingress || true |
| 74 | tc qdisc del dev "${pppInterface}" root || true | 76 | tc qdisc del dev "$1" root || true |
| 75 | 77 | ||
| 76 | tc qdisc add dev "${pppInterface}" handle ffff: ingress | 78 | tc qdisc add dev "$1" handle ffff: ingress |
| 77 | tc filter add dev "${pppInterface}" parent ffff: basic action ctinfo dscp 0x0000003f 0x00000040 action mirred egress redirect dev "ifb4${pppInterface}" | 79 | tc filter add dev "$1" parent ffff: basic action ctinfo dscp 0x0000003f 0x00000040 action mirred egress redirect dev "ifb4$1" |
| 78 | tc qdisc replace dev "ifb4${pppInterface}" root cake memlimit 128Mb overhead 35 mpu 74 regional diffserv4 bandwidth ${toString (builtins.floor (177968 * 0.95))}kbit | 80 | tc qdisc replace dev "ifb4$1" root cake memlimit 128Mb overhead 35 mpu 74 regional diffserv4 bandwidth ${toString (builtins.floor (177968 * 0.95))}kbit |
| 79 | 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 | 81 | 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 |
| 80 | ''; | 82 | ''; |
| 81 | "ppp/ip-up".source = pkgs.resholve.writeScript "ip-up" { | 83 | "ppp/ip-up".source = pkgs.resholve.writeScript "ip-up" { |
| 82 | interpreter = pkgs.runtimeShell; | 84 | interpreter = pkgs.runtimeShell; |
| 83 | inputs = [ pkgs.iproute2 ]; | 85 | inputs = [ pkgs.iproute2 ]; |
| 84 | execer = [ "cannot:${lib.getExe' pkgs.iproute2 "ip"}" ]; | 86 | execer = [ "cannot:${lib.getExe' pkgs.iproute2 "ip"}" ]; |
| 85 | } '' | 87 | } '' |
| 86 | ip route add default via "$5" dev "${pppInterface}" metric 512 | 88 | ip addr add "$4" peer "$5"/32 dev "$1" |
| 89 | ip route add "$5" dev "1" | ||
| 90 | ip route add default via "$5" dev "1" metric 512 | ||
| 87 | ''; | 91 | ''; |
| 88 | "ppp/ip-down".source = pkgs.resholve.writeScript "ip-down" { | 92 | "ppp/ip-down".source = pkgs.resholve.writeScript "ip-down" { |
| 89 | interpreter = pkgs.runtimeShell; | 93 | interpreter = pkgs.runtimeShell; |
| 90 | inputs = [ pkgs.iproute2 ]; | 94 | inputs = [ pkgs.iproute2 ]; |
| 91 | execer = [ "cannot:${lib.getExe' pkgs.iproute2 "ip"}" ]; | 95 | execer = [ "cannot:${lib.getExe' pkgs.iproute2 "ip"}" ]; |
| 92 | } '' | 96 | } '' |
| 93 | ip link del "ifb4${pppInterface}" | 97 | ip link del "ifb4$1" |
| 94 | ''; | 98 | ''; |
| 95 | }; | 99 | }; |
| 96 | 100 | ||
