16 lines
638 B
Nix
16 lines
638 B
Nix
{ pkgs, lib, config, ... }:
|
|
{
|
|
environment.systemPackages = [ pkgs.openvpn_24 ];
|
|
services.openvpn = {
|
|
servers = {
|
|
DRI = {
|
|
config = "config /home/alexandre/VPN/Serveur_VPN_pour_le_SI_DRI_alexandre_admin.ovpn";
|
|
updateResolvConf = true;
|
|
up = "ip route add default gw 192.168.248.73\nroute add -host 185.86.178.201 dev wlp2s0 gw 192.168.1.1\necho nameserver $nameserver | ${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev";
|
|
down = "ip route del default gw 192.168.248.73\nroute del -host 185.86.178.201 dev wlp2s0 gw 192.168.1.1\n${pkgs.openresolv}/sbin/resolvconf -d $dev";
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|