Merge pull request #204254 from raphaelr/initrd-openvpn

nixos/tests/initrd-network-openvpn: fix
This commit is contained in:
Jörg Thalheim 2022-12-28 12:36:27 +00:00 committed by GitHub
commit d165c5dcad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -68,11 +68,8 @@ in
$out/bin/openvpn --show-gateway
'';
# Add `iproute /bin/ip` to the config, to ensure that openvpn
# is able to set the routes
boot.initrd.network.postCommands = ''
(cat /etc/initrd.ovpn; echo -e '\niproute /bin/ip') | \
openvpn /dev/stdin &
openvpn /etc/initrd.ovpn &
'';
};

View File

@ -91,6 +91,7 @@ import ../make-test-python.nix ({ lib, ...}:
config = ''
dev tun0
ifconfig 10.8.0.1 10.8.0.2
cipher AES-256-CBC
${secretblock}
'';
};

View File

@ -3,6 +3,7 @@ dev tun
ifconfig 10.8.0.2 10.8.0.1
# Only force VLAN 2 through the VPN
route 192.168.2.0 255.255.255.0 10.8.0.1
cipher AES-256-CBC
secret [inline]
<secret>
#
@ -26,4 +27,4 @@ be5a69522a8e60ccb217f8521681b45d
e7811584363597599cce2040a68ac00e
f2125540e0f7f4adc37cb3f0d922eeb7
-----END OpenVPN Static key V1-----
</secret>
</secret>