forked from DGNum/liminix
update pppoe and wlan tests
This commit is contained in:
parent
d3dc9752f8
commit
3b9c5635b8
2 changed files with 14 additions and 37 deletions
|
@ -1,20 +1,22 @@
|
||||||
{ config, pkgs, lib, ... } :
|
{ config, pkgs, lib, ... } :
|
||||||
let
|
let
|
||||||
inherit (pkgs.liminix.networking) interface address route;
|
|
||||||
inherit (pkgs.liminix.services) oneshot longrun bundle target output;
|
inherit (pkgs.liminix.services) oneshot longrun bundle target output;
|
||||||
|
svc = config.system.service;
|
||||||
in rec {
|
in rec {
|
||||||
services.lan4 =
|
services.lan4 = svc.network.address.build {
|
||||||
let iface = interface { type = "hardware"; device = "eth1";};
|
interface = config.hardware.networkInterfaces.lan;
|
||||||
in address iface { family = "inet4"; address ="192.168.19.1"; prefixLength = 24;};
|
family = "inet"; address ="192.168.19.1"; prefixLength = 24;
|
||||||
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/ppp
|
../../modules/ppp
|
||||||
../../modules/dnsmasq
|
../../modules/dnsmasq
|
||||||
|
../../modules/network
|
||||||
];
|
];
|
||||||
|
|
||||||
services.pppoe =
|
services.pppoe =
|
||||||
config.system.service.pppoe.build {
|
svc.pppoe.build {
|
||||||
interface = interface { type = "hardware"; device = "eth0"; };
|
interface = config.hardware.networkInterfaces.wan;
|
||||||
ppp-options = [
|
ppp-options = [
|
||||||
"debug" "+ipv6" "noauth"
|
"debug" "+ipv6" "noauth"
|
||||||
"name" "db123@a.1"
|
"name" "db123@a.1"
|
||||||
|
@ -22,39 +24,22 @@ in rec {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.defaultroute4 = route {
|
services.defaultroute4 = svc.network.route.build {
|
||||||
name = "defaultroute";
|
|
||||||
via = "$(output ${services.pppoe} address)";
|
via = "$(output ${services.pppoe} address)";
|
||||||
target = "default";
|
target = "default";
|
||||||
dependencies = [ services.pppoe ];
|
dependencies = [ services.pppoe ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.packet_forwarding =
|
services.packet_forwarding = svc.network.forward.build {
|
||||||
let
|
dependencies = [services.pppoe];
|
||||||
iface = services.pppoe;
|
};
|
||||||
filename = "/proc/sys/net/ipv4/conf/$(output ${iface} ifname)/forwarding";
|
|
||||||
in oneshot {
|
|
||||||
name = "let-the-ip-flow";
|
|
||||||
up = "echo 1 > ${filename}";
|
|
||||||
down = "echo 0 > ${filename}";
|
|
||||||
dependencies = [iface];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.dns =
|
services.dns =
|
||||||
config.system.service.dnsmasq.build {
|
svc.dnsmasq.build {
|
||||||
interface = services.lan4;
|
interface = services.lan4;
|
||||||
ranges = ["192.168.19.10,192.168.19.253"];
|
ranges = ["192.168.19.10,192.168.19.253"];
|
||||||
domain = "fake.liminix.org";
|
domain = "fake.liminix.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.default = target {
|
|
||||||
name = "default";
|
|
||||||
contents = with services; [
|
|
||||||
config.hardware.networkInterfaces.lo
|
|
||||||
defaultroute4
|
|
||||||
packet_forwarding
|
|
||||||
dns
|
|
||||||
];
|
|
||||||
};
|
|
||||||
defaultProfile.packages = [ pkgs.hello ] ;
|
defaultProfile.packages = [ pkgs.hello ] ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,10 @@ let
|
||||||
inherit (pkgs.liminix.networking) interface address hostapd route dnsmasq;
|
inherit (pkgs.liminix.networking) interface address hostapd route dnsmasq;
|
||||||
inherit (pkgs.liminix.services) oneshot longrun bundle target;
|
inherit (pkgs.liminix.services) oneshot longrun bundle target;
|
||||||
in rec {
|
in rec {
|
||||||
services.loopback = config.hardware.networkInterfaces.lo;
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/wlan.nix
|
../../modules/wlan.nix
|
||||||
../../modules/hostapd
|
../../modules/hostapd
|
||||||
|
../../modules/network
|
||||||
];
|
];
|
||||||
|
|
||||||
services.hostap = config.system.service.hostapd.build {
|
services.hostap = config.system.service.hostapd.build {
|
||||||
|
@ -28,12 +27,5 @@ in rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.default = target {
|
|
||||||
name = "default";
|
|
||||||
contents = with config.services; [
|
|
||||||
loopback
|
|
||||||
hostap
|
|
||||||
];
|
|
||||||
};
|
|
||||||
defaultProfile.packages = with pkgs; [ tcpdump ] ;
|
defaultProfile.packages = with pkgs; [ tcpdump ] ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue