From cb0606d7935d9c8cf35ce095c5c7b91a61fa683a Mon Sep 17 00:00:00 2001
From: sinanmohd <sinan@sinanmohd.com>
Date: Sat, 23 Dec 2023 11:07:10 +0530
Subject: kay/network: switch lan and wan port

---
 hosts/kay/modules/network.nix | 4 +++-
 hosts/kay/modules/router.nix  | 8 +++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/hosts/kay/modules/network.nix b/hosts/kay/modules/network.nix
index c31765b..0601815 100644
--- a/hosts/kay/modules/network.nix
+++ b/hosts/kay/modules/network.nix
@@ -2,7 +2,7 @@
 
 let
   inetVlan = 722;
-  wanInterface = "enp4s0";
+  wanInterface = "enp0s20u1";
   nameServer = "1.0.0.1";
   domain = config.userdata.domain;
 in
@@ -24,6 +24,8 @@ in
       id = inetVlan;
       interface = wanInterface;
     };
+    # isp checks this macid during ppp authentication
+    interfaces.${wanInterface}.macAddress = "c4:54:44:d5:17:68";
   };
 
   services = {
diff --git a/hosts/kay/modules/router.nix b/hosts/kay/modules/router.nix
index cc9aaae..c621620 100644
--- a/hosts/kay/modules/router.nix
+++ b/hosts/kay/modules/router.nix
@@ -1,7 +1,7 @@
 { ... }:
 
 let
-  lanInterface = "enp0s20u1";
+  lanInterface = "enp4s0";
   wanInterface = "ppp0";
   subnet = "10.0.0.0";
   prefix = 24;
@@ -24,6 +24,12 @@ in
         address = host;
         prefixLength  = prefix;
       }];
+      # the mac id of the built-in nic is required for
+      # ppp authentication with isp, this is here to avoid
+      # mac address collision since it's original mac id is used
+      # by the new wan interface for ppp authentication
+      # see ./network.nix
+      macAddress = "40:ed:00:08:ba:be";
     };
     firewall = {
       allowedUDPPorts = [ 53 67 ];
-- 
cgit v1.2.3