From ce9c9c1a8b080dd23158ebf9d2b2674a632fadae Mon Sep 17 00:00:00 2001 From: Ariel Sosnovsky Date: Mon, 12 Feb 2024 15:08:15 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Updated=20Router=20Config=20at?= =?UTF-8?q?=20Mon=20Feb=2012=2015:08:15=20EST=202024?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/routers/glmain/config.yaml | 9 +++++++++ os/routers/glmain/gen-mappings.py | 8 ++++++++ os/routers/glmain/output/etc/ethers | 5 +++++ os/routers/glmain/output/summary.yaml | 11 ++++++++++- 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/os/routers/glmain/config.yaml b/os/routers/glmain/config.yaml index 3a744a1..18d6fbf 100644 --- a/os/routers/glmain/config.yaml +++ b/os/routers/glmain/config.yaml @@ -95,3 +95,12 @@ router: mac: '94:83:C4:31:D5:CE' - name: 'orbi-office' mac: '34:98:B5:AC:36:67' +devices: + - name: 'fwlaptop' + mac: '14:AC:60:29:85:4D' + - name: 'sumomac' + mac: 'F8:E4:3B:36:0F:E4' + - name: 'steamdeck' + mac: '34:6F:24:CA:70:57' + - name: 'vitapc' + mac: 'E0:0A:F6:79:C6:E9' \ No newline at end of file diff --git a/os/routers/glmain/gen-mappings.py b/os/routers/glmain/gen-mappings.py index b21a27f..88bb200 100755 --- a/os/routers/glmain/gen-mappings.py +++ b/os/routers/glmain/gen-mappings.py @@ -24,6 +24,12 @@ ip_prefix_map = { "iot": "10.0.14.", "apl": "10.0.15.", "router": "10.0.16.", + "devices": "10.0.0.", +} +defaults = { + 'devices': { + 'justMac': True, + } } def cap1_and_join(*args: str) -> str: @@ -38,12 +44,14 @@ with CONFIG_FILE.open('r') as fp: with DNSMASQ_CONF.open('w') as dfp, SUMMARY.open('w') as sfp, ETHERS.open('w') as efp: for sub_domain, configs in devices.items(): + default_values = defaults.get(sub_domain, {}) ip_prefix = ip_prefix_map[sub_domain] sfp.write(f'\n{cap1_and_join(sub_domain)}:') efp.write(f'#{cap1_and_join(sub_domain)}\n') ip_suffix = 0 for dvc in configs: ip_suffix += 1 + dvc = {**default_values, **dvc} mac = dvc['mac'] name = dvc['name'] sfp.write(f'\n {cap1_and_join(name)}:') diff --git a/os/routers/glmain/output/etc/ethers b/os/routers/glmain/output/etc/ethers index c80a4ee..a8c1a32 100644 --- a/os/routers/glmain/output/etc/ethers +++ b/os/routers/glmain/output/etc/ethers @@ -77,3 +77,8 @@ D8:BE:65:F2:ED:18 amzn-bedroom.apl.internal 94:83:C4:31:D5:CE gl-basement.router.internal 34:98:B5:AC:36:67 10.0.16.2 34:98:B5:AC:36:67 orbi-office.router.internal +#Devices +14:AC:60:29:85:4D fwlaptop.devices.internal +F8:E4:3B:36:0F:E4 sumomac.devices.internal +34:6F:24:CA:70:57 steamdeck.devices.internal +E0:0A:F6:79:C6:E9 vitapc.devices.internal diff --git a/os/routers/glmain/output/summary.yaml b/os/routers/glmain/output/summary.yaml index 95c3df0..091a849 100644 --- a/os/routers/glmain/output/summary.yaml +++ b/os/routers/glmain/output/summary.yaml @@ -120,4 +120,13 @@ Router: host: "gl-basement.router.internal" Orbi-office: ip: "10.0.16.2" - host: "orbi-office.router.internal" \ No newline at end of file + host: "orbi-office.router.internal" +Devices: + Fwlaptop: + host: "fwlaptop.devices.internal" + Sumomac: + host: "sumomac.devices.internal" + Steamdeck: + host: "steamdeck.devices.internal" + Vitapc: + host: "vitapc.devices.internal" \ No newline at end of file