Add wwan networking

This commit is contained in:
Fabian Hauser 2019-12-23 21:29:42 +00:00
parent a9e5fa79a5
commit bf015614b6
4 changed files with 88 additions and 111 deletions

View file

@ -1,7 +1,7 @@
{
# To get the MAC address of each card, use this command: cat /sys/class/net/*device_name*/address
# Make sure to use the lower-case hex values in your udev rules. It does not like upper-case.
wanCardAddress ? "00:0d:b9:48:55:be",
wanInterface,
wireless ? {
wleInterface = "wlp5s0";
wleSSID = "hauser";
@ -26,17 +26,11 @@ in
(import ./networking/wireless-access-point.nix wireless)
(import ./networking/dns-recursive.nix lanNetwork)
];
# To get the MAC address of each card, use this command: cat /sys/class/net/*device_name*/address
# Make sure to use the lower-case hex values in your udev rules. It does not like upper-case.
services.udev.extraRules = ''
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="${wanCardAddress}", NAME="wan"
'';
networking = {
nat = {
enable = true;
externalInterface = "wan";
externalInterface = wanInterface;
internalInterfaces = [ "lan" ];
};