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