Static IPs and DHCP Reservations Before Home Automation
Home automation lives or dies on a reliable network. Before a single smart plug gets connected, you need to know that your Home Assistant instance will always be at the same address, that your Raspberry Pi won't get a different IP after a reboot, and that your 3D printer isn't going to end up in the same subnet as your work laptop.
This post covers how I structured IP addressing on my home network ahead of setting up Home Assistant — what hardware I'm working with, why I chose DHCP reservations over static IPs configured on devices, and how I laid out address ranges across the network.
The Hardware
The network starts at a Juniper SRX handling routing, firewall rules, and DHCP for the whole house. Internet comes in via an ONT, through the SRX, then out to a managed 2.5Gb core switch that distributes connectivity around the house.
From that core switch:
- Three runs go upstairs to home office ports
- One run goes to the lounge, into an unmanaged 5-port switch, which feeds the desktop PC, the TV, and — via an in-wall cable — a Juniper access point in the master bedroom
- A dedicated run goes to the homelab, into a second managed switch (same model as the core) that connects a Raspberry Pi (future Home Assistant host) and a ThinkCentre Tiny PC
- Two access points handle WiFi: the Juniper AP upstairs, and a TP-Link AP downstairs connected directly to the core switch
The network topology looks like this:
graph TD
SRX["Juniper SRX\nRouter/Firewall/DHCP"]
Core["Managed\nCore Switch"]
SRX --> Core
Core -->|"Office x3"| Offices["Home Office Ports"]
Core -->|"Homelab"| Lab["Managed\nLab Switch"]
Core -->|"Lounge"| Lounge["Unmanaged Switch"]
Core -->|"Downstairs AP"| DAP["TP-Link AP\nDownstairs"]
Lab --> RPi["Raspberry Pi"]
Lab --> ThinkC["ThinkCentre"]
Lounge --> Desktop["Desktop PC"]
Lounge --> TV["Smart TV"]
Lounge -->|"In-wall"| JuniperAP["Juniper AP\nUpstairs"]
JuniperAP -. "WiFi" .-> Printer["3D Printer"]
JuniperAP -. "WiFi" .-> Mobile["Phones / Laptops"]
DAP -. "WiFi" .-> Mobile
DAP -. "WiFi" .-> IoT["IoT Devices"]graph TD
SRX["Juniper SRX\nRouter/Firewall/DHCP"]
Core["Managed\nCore Switch"]
SRX --> Core
Core -->|"Office x3"| Offices["Home Office Ports"]
Core -->|"Homelab"| Lab["Managed\nLab Switch"]
Core -->|"Lounge"| Lounge["Unmanaged Switch"]
Core -->|"Downstairs AP"| DAP["TP-Link AP\nDownstairs"]
Lab --> RPi["Raspberry Pi"]
Lab --> ThinkC["ThinkCentre"]
Lounge --> Desktop["Desktop PC"]
Lounge --> TV["Smart TV"]
Lounge -->|"In-wall"| JuniperAP["Juniper AP\nUpstairs"]
JuniperAP -. "WiFi" .-> Printer["3D Printer"]
JuniperAP -. "WiFi" .-> Mobile["Phones / Laptops"]
DAP -. "WiFi" .-> Mobile
DAP -. "WiFi" .-> IoT["IoT Devices"]Static IPs vs DHCP Reservations
There are two ways to give a device a predictable address:
- Configure a static IP on the device itself — set the IP, subnet mask, gateway, and DNS directly in the OS or device settings
- DHCP reservation on the router — tell the router "whenever you see MAC address
aa:bb:cc:dd:ee:ff, always hand out192.168.1.21"
DHCP reservations are better for a home network in almost every case:
- All your address assignments live in one place — the router
- Devices still go through normal DHCP, so they get gateway and DNS automatically
- No risk of address conflicts from misconfigured devices
- Easy to change an address without touching the device
The only time a static IP on the device itself makes sense is if the device might be connected to a network without a DHCP server, or if you specifically need the device to have its address before the router is reachable (rare at home).
Planning the Address Space
The SRX300 hands out addresses from a single 192.168.1.0/24 subnet for now. I'm not running VLANs yet — the plan is to add them once Home Assistant is up and running and I have a clearer picture of which devices need to be isolated. For now, flat network with sensible reservations is sufficient.
I divided the address space into ranges by purpose:
| Range | Purpose |
|---|---|
192.168.1.1 |
SRX300 gateway |
192.168.1.2 – .9 |
Network infrastructure (switches, APs) |
192.168.1.10 – .49 |
Reserved — DHCP reservations for known devices |
192.168.1.50 – .199 |
Dynamic DHCP pool — unknown/guest devices |
192.168.1.200 – .254 |
Reserved for future use |
Infrastructure addresses
These are set as static IPs on the devices themselves since they need to be reachable before DHCP is available:
| Device | Address |
|---|---|
| Managed Core Switch | 192.168.1.2 |
| Managed Lab Switch | 192.168.1.3 |
| TP-Link AP | 192.168.1.4 |
| Juniper AP | 192.168.1.5 |
DHCP reservations for known devices
Everything else gets a reservation on the SRX. These are bound to MAC addresses, so the assignments survive reboots and the devices don't need any special configuration:
| Device | Address | Why it needs one |
|---|---|---|
| Raspberry Pi (Home Assistant) | 192.168.1.21 |
HA URL must be stable |
| ThinkCentre Tiny PC | 192.168.1.22 |
Stable address for remote access |
| Desktop PC | 192.168.1.10 |
Stable address for remote access |
| 3D Printer | 192.168.1.30 |
Stable address for web UI |
The Raspberry Pi and desktop get addresses in the .10–.19 range — primary devices I interact with directly. Homelab and server devices get .20–.29. IoT-adjacent things like the printer get .30–.39. This leaves room to grow each category without renumbering.
Discovering Devices on the Network
Before setting up reservations you need to know the IP and MAC address of each device. The quickest way to scan the entire subnet from any Linux machine on the network is with nmap:
sudo nmap -sn 192.168.1.0/24-sn does a ping scan — no port scanning, just discovery. The output lists every responding host with its IP and MAC address:
Nmap scan report for 192.168.1.2
Host is up (0.0012s latency).
MAC Address: AA:BB:CC:DD:EE:01 (Juniper Networks)
Nmap scan report for 192.168.1.10
Host is up (0.0031s latency).
MAC Address: AA:BB:CC:DD:EE:02 (Dell)If nmap isn't installed:
# Arch / Manjaro
sudo pacman -S nmap
# Ubuntu / Debian
sudo apt install nmap
# Fedora
sudo dnf install nmapFor a quicker scan that only checks the ARP cache (devices you've communicated with recently), arp -a works without root and without installing anything:
arp -aThe output is less complete than nmap — it only shows devices that have been seen recently — but it's useful for a fast check.
Once you have the MAC addresses from the scan, you can create reservations on the SRX to lock each device to a fixed IP.
Setting Up Reservations on the SRX
There are three ways to configure DHCP reservations on the Juniper SRX — the Mist cloud portal, J-Web (the SRX's built-in browser UI), or the CLI. All three produce the same result. Which to use depends on how the SRX is being managed.
Option 1: Juniper Mist Portal
If the SRX is enrolled in Mist as a WAN Edge device, reservations can be configured through the cloud dashboard at manage.mist.com. Since the Juniper AP already runs through Mist, this is a natural place to manage the SRX as well.
Finding the device:
- Log in and select your site from the left sidebar
- Navigate to WAN → WAN Edges
- Click on the SRX to open its configuration panel
Configuring the DHCP server:
- Select the LAN tab in the device config
- Find the relevant LAN interface (typically
irb.0for a home setup) and click to expand it - Scroll to the DHCP Server section and ensure it is enabled
- Set the address pool range — e.g.
192.168.1.50to192.168.1.199for the dynamic pool
Adding fixed bindings (reservations):
- Under the DHCP server config, look for Fixed Bindings or Reserved Addresses
- Click Add and fill in three fields for each device:
- Name — a label for the entry (e.g.
raspberry-pi) - MAC Address — the device's hardware address (e.g.
aa:bb:cc:dd:ee:ff) - IP Address — the address to assign (e.g.
192.168.1.21)
- Name — a label for the entry (e.g.
- Repeat for each device that needs a reservation
- Click Save and then Push Config to deploy the changes to the SRX
Mist will push the updated DHCP config to the physical device. Changes typically take effect within a minute or two without any downtime.
Option 2: J-Web (built-in SRX browser UI)
If the SRX is not enrolled in Mist, J-Web is the next easiest option. It's the SRX's own web interface, accessible directly on the local network without any cloud dependency.
- Open a browser and navigate to
https://192.168.1.1(the SRX management IP) - Log in with the admin credentials
- Navigate to Network → DHCP → Server
- Select the DHCP pool for your LAN interface
- Under the Hosts or Static Bindings tab, click Add
- Enter the hostname, MAC address, and IP address for each device
- Click OK then Commit to apply
J-Web is simpler than Mist for a one-off change but doesn't give the same visibility or audit trail. For ongoing management of a Mist-enrolled SRX, it's better to keep all config changes in Mist so the cloud and device stay in sync.
Option 3: CLI
For completeness, the same configuration via SSH or console:
set system services dhcp-local-server group HOMELAN interface irb.0
set access address-assignment pool HOME-POOL family inet network 192.168.1.0/24
set access address-assignment pool HOME-POOL family inet range DYNAMIC-RANGE low 192.168.1.50
set access address-assignment pool HOME-POOL family inet range DYNAMIC-RANGE high 192.168.1.199
set access address-assignment pool HOME-POOL family inet dhcp-attributes router 192.168.1.1
set access address-assignment pool HOME-POOL family inet dhcp-attributes name-server [1.1.1.1 8.8.8.8]
set access address-assignment pool HOME-POOL family inet host raspberry-pi hardware-address aa:bb:cc:dd:ee:ff
set access address-assignment pool HOME-POOL family inet host raspberry-pi ip-address 192.168.1.21
set access address-assignment pool HOME-POOL family inet host desktop hardware-address aa:bb:cc:dd:ee:ff
set access address-assignment pool HOME-POOL family inet host desktop ip-address 192.168.1.10Replace aa:bb:cc:dd:ee:ff with the actual MAC addresses. After committing the config, a dhcp renew on the client side (or just a reboot) will pick up the reservation.
Note: If the SRX is managed by Mist, avoid making CLI changes directly to DHCP config — Mist owns that config and will overwrite manual changes on the next push.
To confirm active leases from the CLI:
show dhcp server bindingVerifying the Raspberry Pi
Once the reservation is committed and the Pi has renewed its lease, verify it from the Pi itself:
ip addr show eth0You should see 192.168.1.21/24 (or whatever address you assigned). Then confirm the gateway is reachable:
ping 192.168.1.1At this point the Pi has a stable, predictable address on the network. That's the foundation for everything that follows — installing Home Assistant OS, setting up remote access, and eventually connecting devices to it.
What's Next
With addressing sorted, the next step is getting Home Assistant OS onto the Pi and doing the initial setup. Reliable address assignment means the onboarding URL (192.168.1.21:8123) will be the same every time, integrations that reference the HA host by IP won't break after a reboot, and any port forwarding rules on the SRX300 will stay valid.
The homelab VLAN separation is on the list too — once HA is running and I have a sense of which IoT devices are chatty, it's worth isolating them from the main network. The GWN7721 managed switches make that straightforward to set up without rewiring anything.
Comments