dn42: fix tun interfaces
This commit is contained in:
parent
c251ad57c0
commit
e967ee77cb
|
@ -39,6 +39,12 @@ in {
|
||||||
# No Firewalling!
|
# No Firewalling!
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
boot.postBootCommands = ''
|
||||||
|
if [ ! -c /dev/net/tun ]; then
|
||||||
|
mkdir -p /dev/net
|
||||||
|
mknod -m 666 /dev/net/tun c 10 200
|
||||||
|
fi
|
||||||
|
'';
|
||||||
services.openvpn =
|
services.openvpn =
|
||||||
let
|
let
|
||||||
openvpnNeighbors = lib.filterAttrs (_: conf: conf ? openvpn) neighbors;
|
openvpnNeighbors = lib.filterAttrs (_: conf: conf ? openvpn) neighbors;
|
||||||
|
@ -61,7 +67,9 @@ in {
|
||||||
secret ${keyfile name}
|
secret ${keyfile name}
|
||||||
'';
|
'';
|
||||||
up = ''
|
up = ''
|
||||||
${pkgs.iproute}/bin/ip a a ${address6}/64 dev $1
|
${pkgs.iproute}/bin/ip addr flush dev $1
|
||||||
|
${pkgs.iproute}/bin/ip addr add ${address4} dev ${name} peer ${conf.address4}/32
|
||||||
|
${pkgs.iproute}/bin/ip addr add ${address6}/64 dev $1
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user