# Static IP with dhcpcd

Edge devices like the OnLogic FR201 almost always need a predictable address. SCADA endpoints, MQTT brokers, and remote SSH all assume the device lives at the same IP across reboots. On older Raspberry Pi OS images (Buster and earlier Bullseye), the network stack is `dhcpcd`, and you set a static address by editing a single config file.

:::note[Which image am I on?]
Newer Raspberry Pi OS Lite images ship with `systemd-networkd` (or NetworkManager on Desktop) and no longer install `dhcpcd` by default. If `/etc/dhcpcd.conf` doesn't exist on your device, follow the [systemd-networkd guide](/guides/onlogic-fr201/systemd-networkd-configuration/) instead.
:::

## Configure the interface

The FR201 has two Ethernet ports. The PoE-capable port is `eth0` and the second port is `eth1`. Pick whichever one is plugged in.

1. Open `dhcpcd.conf` in your editor of choice:

    ```sh title="Edit the dhcpcd config"
    sudo nano /etc/dhcpcd.conf
    ```

2. Scroll to the bottom of the file and append a block for the interface you want to pin. Replace the addresses with values that match your network:

    ```ini title="/etc/dhcpcd.conf"
    # eth0 is the PoE port. Use eth1 if you wired into the standard LAN port.
    interface eth0

    # The address you want this device to keep across reboots.
    static ip_address=192.168.1.50/24

    # The default gateway (your router or layer-3 switch).
    static routers=192.168.1.1

    # DNS servers. You can list more than one separated by spaces.
    static domain_name_servers=192.168.1.1 1.1.1.1
    ```

    The `routers=` directive is dhcpcd-speak for "default gateway." If you're used to other tools that name it `gateway` or `via`, this trips up everyone the first time.

3. Save and exit (<kbd>Ctrl</kbd>+<kbd>O</kbd>, <kbd>Enter</kbd>, then <kbd>Ctrl</kbd>+<kbd>X</kbd>).

4. Restart `dhcpcd` so it picks up the new configuration:

    ```sh title="Restart dhcpcd"
    sudo service dhcpcd restart
    ```

## Verify the new address

Confirm the interface came up with the address you set:

```sh title="Show the address on eth0"
ip addr show eth0
```

Use `eth1` instead if you wired into the standard port. `ifconfig` works too, though it's deprecated on most modern Pi OS releases.

If the address didn't change, give it a minute — `dhcpcd` sometimes holds the previous DHCP lease for a short window — or reboot the device with `sudo reboot`.

## Sizing the subnet

The example above uses `/24` (a 256-address subnet, the typical home-lab default). On a real OT segment you'll often want a smaller broadcast domain. A `/26` gives you 64 addresses (62 usable) and reduces broadcast noise on networks with chatty industrial devices. Adjust the prefix length to whatever your IT or controls team has allocated for the device.