partly support getting IPv6 addresses

- gets interface id from ppp
- runs odhcpc to get RA and prefix delegation
- doesn't do anything useful with the data yet
This commit is contained in:
Daniel Barlow 2023-05-24 23:01:50 +01:00
parent 339c2d9873
commit 447f068569
6 changed files with 98 additions and 1 deletions

View file

@ -43,6 +43,7 @@
preinit = callPackage ./preinit {};
swconfig = callPackage ./swconfig {};
odhcp6c = callPackage ./odhcp6c {};
openwrt = callPackage ./openwrt {};

View file

@ -29,8 +29,17 @@ let
)
echo >/proc/self/fd/10
'';
ip6-up = writeAshScript "ip6-up" {} ''
. ${serviceFns}
(in_outputs ${name}
echo $4 > ipv6-address
echo $5 > ipv6-peer-address
)
echo >/proc/self/fd/10
'';
ppp-options' = ppp-options ++ [
"ip-up-script" ip-up
"ipv6-up-script" ip6-up
"ipparam" name
"nodetach"
"usepeerdns"

20
pkgs/odhcp6c/default.nix Normal file
View file

@ -0,0 +1,20 @@
{ stdenv
, buildPackages
, cmake
, fetchFromGitHub
, ...} :
# let switchDotH = buildPackages.fetchurl {
# url = "https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob_plain;f=target/linux/generic/files/include/uapi/linux/switch.h;hb=99a188828713d6ff9c541590b08d4e63ef52f6d7";
# sha256 = "15kmhhcpd84y4f45rf8zai98c61jyvkc37p90pcxirna01x33wi8";
# name="switch.h";
# };
stdenv.mkDerivation {
src = fetchFromGitHub {
owner = "openwrt";
repo = "odhcp6c";
rev = "bcd283632ac13391aac3ebdd074d1fd832d76fa3";
hash = "sha256-jqxr+N1PffWYmF0F6hJKxRLMN5Ht5WpehK1K2HjL+do=";
};
name = "odhcp6c";
nativeBuildInputs = [ cmake ];
}