pppoe: set lcp echo failure timeout
This commit is contained in:
parent
8d228f2bef
commit
143137cbc6
@ -9,6 +9,8 @@
|
|||||||
{ interface, ppp-options }:
|
{ interface, ppp-options }:
|
||||||
let
|
let
|
||||||
inherit (liminix.services) longrun;
|
inherit (liminix.services) longrun;
|
||||||
|
lcp-echo-interval = 4;
|
||||||
|
lcp-echo-failure = 3;
|
||||||
name = "${interface.name}.pppoe";
|
name = "${interface.name}.pppoe";
|
||||||
ip-up = writeAshScript "ip-up" {} ''
|
ip-up = writeAshScript "ip-up" {} ''
|
||||||
. ${serviceFns}
|
. ${serviceFns}
|
||||||
@ -37,6 +39,8 @@ let
|
|||||||
"ipparam" name
|
"ipparam" name
|
||||||
"nodetach"
|
"nodetach"
|
||||||
"usepeerdns"
|
"usepeerdns"
|
||||||
|
"lcp-echo-interval" (builtins.toString lcp-echo-interval)
|
||||||
|
"lcp-echo-failure" (builtins.toString lcp-echo-failure)
|
||||||
"logfd" "2"
|
"logfd" "2"
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
@ -44,8 +48,10 @@ longrun {
|
|||||||
inherit name;
|
inherit name;
|
||||||
run = ''
|
run = ''
|
||||||
. ${serviceFns}
|
. ${serviceFns}
|
||||||
${ppp}/bin/pppd pty "${pppoe}/bin/pppoe -I $(output ${interface} ifname)" ${lib.concatStringsSep " " ppp-options'}
|
echo Starting pppoe, pppd pid is $$
|
||||||
|
exec ${ppp}/bin/pppd pty "${pppoe}/bin/pppoe -T ${builtins.toString (4 * lcp-echo-interval)} -I $(output ${interface} ifname)" ${lib.concatStringsSep " " ppp-options'}
|
||||||
'';
|
'';
|
||||||
notification-fd = 10;
|
notification-fd = 10;
|
||||||
|
timeout-up = (10 + lcp-echo-failure * lcp-echo-interval) * 1000;
|
||||||
dependencies = [ interface ];
|
dependencies = [ interface ];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user