summaryrefslogtreecommitdiff
path: root/os/lia/modules/network
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-06-10 15:55:54 +0530
committersinanmohd <sinan@sinanmohd.com>2025-06-10 22:55:04 +0530
commita41037ef644dbacb3d577933fb3d93c210439b38 (patch)
treea262750bcb1357785ad8cb68b232a5ca242ee671 /os/lia/modules/network
parentcfccbd1e4026d568e23a47c060ae3ae042cceb4c (diff)
chore(repo): reformat with nixfmt-rfc-style
Diffstat (limited to 'os/lia/modules/network')
-rw-r--r--os/lia/modules/network/default.nix13
-rw-r--r--os/lia/modules/network/router.nix31
2 files changed, 29 insertions, 15 deletions
diff --git a/os/lia/modules/network/default.nix b/os/lia/modules/network/default.nix
index c8d9059..3d58636 100644
--- a/os/lia/modules/network/default.nix
+++ b/os/lia/modules/network/default.nix
@@ -1,4 +1,5 @@
-{ ... }: let
+{ ... }:
+let
wan = "enp9s0";
in
{
@@ -7,10 +8,12 @@ in
];
networking = {
- interfaces.${wan}.ipv4.addresses = [{
- address = "172.16.148.20";
- prefixLength = 22;
- }];
+ interfaces.${wan}.ipv4.addresses = [
+ {
+ address = "172.16.148.20";
+ prefixLength = 22;
+ }
+ ];
defaultGateway = {
address = "172.16.148.1";
interface = wan;
diff --git a/os/lia/modules/network/router.nix b/os/lia/modules/network/router.nix
index b8cac8c..4f22e31 100644
--- a/os/lia/modules/network/router.nix
+++ b/os/lia/modules/network/router.nix
@@ -1,6 +1,10 @@
-{ ... }: let
+{ ... }:
+let
wanInterface = "enp9s0";
- lanInterfaces = [ "enp1s0f0" "enp1s0f1" ];
+ lanInterfaces = [
+ "enp1s0f0"
+ "enp1s0f1"
+ ];
prefix = 24;
subnet = "192.168.1.0";
@@ -8,7 +12,10 @@
leaseRangeStart = "192.168.1.100";
leaseRangeEnd = "192.168.1.254";
- nameServer = [ "10.0.0.2" "10.0.0.3" ];
+ nameServer = [
+ "10.0.0.2"
+ "10.0.0.3"
+ ];
in
{
networking = {
@@ -21,17 +28,21 @@ in
};
interfaces.lan = {
- ipv4.addresses = [{
- address = host;
- prefixLength = prefix;
- }];
+ ipv4.addresses = [
+ {
+ address = host;
+ prefixLength = prefix;
+ }
+ ];
};
firewall = {
- allowedUDPPorts = [ 53 67 ];
+ allowedUDPPorts = [
+ 53
+ 67
+ ];
allowedTCPPorts = [ 53 ];
- extraCommands =
- "iptables -t nat -I POSTROUTING 1 -s ${subnet}/${toString prefix} -o ${wanInterface} -j MASQUERADE";
+ extraCommands = "iptables -t nat -I POSTROUTING 1 -s ${subnet}/${toString prefix} -o ${wanInterface} -j MASQUERADE";
};
};