hotspot test
This commit is contained in:
32
modules/features/ethdhcp.nix
Normal file
32
modules/features/ethdhcp.nix
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{ ... }: {
|
||||||
|
|
||||||
|
flake.nixosModules.hotspot = { config, lib, ... }: {
|
||||||
|
|
||||||
|
networking.firewall.interfaces."eno1" = {
|
||||||
|
allowedUDPPorts = [ 53 67 68 ];
|
||||||
|
allowedTCPPorts = [ 53 67 68 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
interfaces."eno1" = {
|
||||||
|
ipv4.addresses = [{ address = "192.168.121.1"; prefixLength = 24; }];
|
||||||
|
};
|
||||||
|
|
||||||
|
nat = {
|
||||||
|
enable = true;
|
||||||
|
internalInterfaces = [ "eno1" ];
|
||||||
|
externalInterface = "wlo1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.dnsmasq = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
interface = "eno1";
|
||||||
|
dhcp-range = [ "192.168.121.2,192.168.121.10,1h" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.networkmanager.unmanaged = [ "eno1" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -7,8 +7,16 @@
|
|||||||
allowedTCPPorts = [ 53 67 68 ];
|
allowedTCPPorts = [ 53 67 68 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.interfaces."wlo1" = {
|
networking = {
|
||||||
ipv4.addresses = [{ address = "192.168.121.1"; prefixLength = 24; }];
|
interfaces."wlo1" = {
|
||||||
|
ipv4.addresses = [{ address = "192.168.121.1"; prefixLength = 24; }];
|
||||||
|
};
|
||||||
|
|
||||||
|
nat = {
|
||||||
|
enable = true;
|
||||||
|
internalInterfaces = [ "wlo1" ];
|
||||||
|
externalInterface = "eno1";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.dnsmasq = {
|
services.dnsmasq = {
|
||||||
|
|||||||
Reference in New Issue
Block a user