# Networks & Switching

<details id="bkmrk-editable-diagram"><summary>Editable diagram</summary>

<div drawio-diagram="126"><img src="https://wiki.hexadust.net/uploads/images/drawio/2024-11/vGMNOS2JlKaeoPSL-drawing-3-1732908475.png" alt=""/></div>

</details>[![network.png](https://wiki.hexadust.net/uploads/images/gallery/2024-11/scaled-1680-/xOrahgcBwTwT1Yyk-network.png)](https://wiki.hexadust.net/uploads/images/gallery/2024-11/xOrahgcBwTwT1Yyk-network.png)

## VLANs

<table border="1" id="bkmrk-name-tag-network-des" style="border-collapse: collapse; width: 100%; height: 206.267px;"><colgroup><col style="width: 9.76927%;"></col><col style="width: 6.31428%;"></col><col style="width: 16.441%;"></col><col style="width: 32.8819%;"></col><col style="width: 34.669%;"></col></colgroup><tbody><tr style="height: 29.4667px;"><td style="height: 29.4667px;">**Name**  
</td><td style="height: 29.4667px;">**Tag**  
</td><td style="height: 29.4667px;">**Network**  
</td><td style="height: 29.4667px;">**Description**</td><td style="height: 29.4667px;">**Gateways**  
</td></tr><tr style="height: 29.4667px;"><td style="height: 29.4667px;">HOME</td><td style="height: 29.4667px;">1  
</td><td style="height: 29.4667px;">192.168.1.0/24</td><td style="height: 29.4667px;">Internal home network  
</td><td style="height: 29.4667px;">caroline: 192.168.1.1

justine: 192.168.1.2 (DHCP default)

</td></tr><tr style="height: 29.4667px;"><td style="height: 29.4667px;">GUEST</td><td style="height: 29.4667px;">10  
</td><td style="height: 29.4667px;">192.168.10.0/24</td><td style="height: 29.4667px;">Isolated network  
</td><td style="height: 29.4667px;">caroline: 192.168.10.1 (DHCP default)  
</td></tr><tr style="height: 29.4667px;"><td style="height: 29.4667px;">SERVER</td><td style="height: 29.4667px;">50  
</td><td style="height: 29.4667px;">192.168.50.0/24</td><td style="height: 29.4667px;">Internet exposed servers  
</td><td style="height: 29.4667px;">caroline: 192.168.50.1 (DHCP default)  
</td></tr><tr style="height: 29.4667px;"><td>IOT  
</td><td>80  
</td><td>192.168.80.0/24</td><td>IoT devices  
</td><td>carolone: 192.168.100.1 (DHCP default)

</td></tr><tr><td style="height: 29.4667px;">MGMT</td><td style="height: 29.4667px;">100  
</td><td style="height: 29.4667px;">192.168.100.0/24</td><td style="height: 29.4667px;">Management network  
</td><td style="height: 29.4667px;">carolone: 192.168.100.1

justine: 192.168.100.2 (DHCP default)

</td></tr></tbody></table>

### Connectivity

Caroline does VLAN routing.

<table border="1" id="bkmrk-name-internet-access" style="border-collapse: collapse; width: 100%; height: 147.334px; border-width: 1px;"><colgroup><col style="width: 12.2716%;"></col><col style="width: 21.803%;"></col><col style="width: 21.6884%;"></col><col style="width: 25.8493%;"></col><col style="width: 18.3479%;"></col></colgroup><tbody><tr style="height: 29.4667px;"><td style="height: 29.4667px;">**Name**  
</td><td style="height: 29.4667px;">**Internet access G/W** </td><td>**DNS** </td><td style="height: 29.4667px;">**WiFi SSID** </td><td style="height: 29.4667px;">**Access to** </td></tr><tr style="height: 29.4667px;"><td style="height: 29.4667px;">HOME</td><td style="height: 29.4667px;">Justine (VPN), Caroline  
</td><td>Justine (PiHole), Caroline  
</td><td style="height: 29.4667px;">Haru, Haru Legacy (2.4GHz)  
</td><td style="height: 29.4667px;">SERVER, IOT  
</td></tr><tr style="height: 29.4667px;"><td style="height: 29.4667px;">GUEST</td><td style="height: 29.4667px;">Caroline</td><td>Caroline</td><td style="height: 29.4667px;">Toudi, Toudi Legacy (2.4GHz)  
</td><td style="height: 29.4667px;">  
</td></tr><tr style="height: 29.4667px;"><td style="height: 29.4667px;">SERVER</td><td style="height: 29.4667px;">Caroline</td><td>Caroline</td><td style="height: 29.4667px;"> </td><td style="height: 29.4667px;">  
</td></tr><tr style="height: 29.4667px;"><td>IOT  
</td><td>Caroline</td><td>Caroline</td><td>Haru IoT (2.4GHz)  
</td><td style="height: 29.4667px;"> </td></tr><tr><td style="height: 29.4667px;">MGMT</td><td style="height: 29.4667px;">Justine (VPN), Caroline</td><td>Justine (PiHole), Caroline</td><td style="height: 29.4667px;">Haru MGMT (2.4GHz)  
</td><td style="height: 29.4667px;">SERVER</td></tr></tbody></table>

## Subnets

<table border="1" id="bkmrk-base-range-subnet-1-" style="border-collapse: collapse; width: 100%; height: 445.917px;"><colgroup><col style="width: 25.0174%;"></col><col style="width: 25.0174%;"></col><col style="width: 25.0174%;"></col><col style="width: 25.0174%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">**Base range**  
</td><td style="height: 29.8px;">**Subnet 1 / Usage**  
</td><td style="height: 29.8px;">**Subnet 2 / Usage**</td><td style="height: 29.8px;">**Subnet 3 / Usage**</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">10.0.0.0/8</td><td style="height: 29.8px;">*reserved for work VPNs*  
</td><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">172.16.0.0/12 (to 172.31.)  
</td><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">172.17.1.1/24</td><td style="height: 29.8px;">Justine VPN: `vpn`  
</td><td style="height: 29.8px;">  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">172.17.2.1/24</td><td style="height: 29.8px;">Justine VPN: `outpust`</td><td style="height: 29.8px;">  
</td></tr><tr><td>  
</td><td style="height: 29.3833px;">172.17.100.1/24</td><td style="height: 29.3833px;">VPS VPN: `vps`  
</td><td>  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">172.18.0.0/16</td><td style="height: 29.8px;">Justine Docker  
</td><td style="height: 29.8px;">  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">172.19.0.0/16</td><td style="height: 29.8px;">Igor Kubenretes  
</td><td style="height: 29.8px;">  
</td></tr><tr style="height: 29.4667px;"><td style="height: 29.4667px;">  
</td><td style="height: 29.4667px;">172.20.0.0/24</td><td style="height: 29.4667px;">Igor Sandbox VMs  
</td><td style="height: 29.4667px;">  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">192.168.0.0/16</td><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">  
</td><td style="height: 29.8px;"> </td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">192.168.1.0/24</td><td style="height: 29.8px;">HOME VLAN  
</td><td style="height: 29.8px;">  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">192.168.10.0/24</td><td style="height: 29.8px;">GUEST VLAN  
</td><td style="height: 29.8px;">  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">192.168.50.0/24</td><td style="height: 29.8px;">SERVER VLAN  
</td><td style="height: 29.8px;">  
</td></tr><tr style="height: 29.4667px;"><td style="height: 29.4667px;">  
</td><td style="height: 29.4667px;">192.168.80.0/24</td><td style="height: 29.4667px;">IOT VLAN  
</td><td style="height: 29.4667px;">  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">192.168.100.0/24</td><td style="height: 29.8px;">MGMT VLAN  
</td><td style="height: 29.8px;"> </td></tr></tbody></table>

## Adding networks

### Caroline

- *Network* -&gt; *Interfaces* -&gt; *Devices*
    - Add `VLAN (802.1q)` on `eth1` for new VLAN tag
- *Network* -&gt; *Interfaces*
    - Add interface for the new device
    - Configure DHPC server on the new interface with options for default G/W and DNS server 
        - `3,192.168.80.1`
        - <div class="item" tabindex="0">`6,192.168.80.1`</div>
- *Network* -&gt; *Firewall* -&gt; *Zones*
    - Add zone for the new interface
- *Network* -&gt; *Firewall* -&gt; *Traffic rules*
    - Add rule for DHCP (`UDP 67`)
    - Add rule for DNS (`UDP+TCP 53`)
    - Add rule for ICMP
- *Network* -&gt; *DHCP and DNS* -&gt; *Devices &amp; Ports*
    - Add new interface to DHCP server *Listen interfaces*

## Switch configuration

<p class="callout info">**OpenWRT edit VLAN tag assignment** Network -&gt; Interfaces -&gt; Devices -&gt; `switch` (Bridge device) -&gt; Configure... -&gt; Bridge VLAN filtering</p>