Skip to content

Instantly share code, notes, and snippets.

@miclip
Last active August 2, 2021 17:16
Show Gist options
  • Save miclip/109de2ddcef388fa4776cb53836e25e2 to your computer and use it in GitHub Desktop.
Save miclip/109de2ddcef388fa4776cb53836e25e2 to your computer and use it in GitHub Desktop.
Photon Static IP

Set static IP Photon

  1. List your networking interfaces networkctl. Take note of the device name, for example eth0, eth1
  2. Change directory to change to /etc/systemd/network and list files. You should see a file named 10-dhcp-en.network
  3. Remame file 10-dhcp-en.network.backup. This disables DHCP.
  4. Create a new file 10-static-en.network
    [Match]
    Name=eth0
    [Network]
    Address=192.168.118.20/24
    Gateway=192.168.118.1

Where Name is the device name from step 1, Address is the desired static IP and Gateway is obviously the networks gateway.

  1. Change permissions on the file chmod o+r 10-static-en.network
  2. Reboot

Avoid running systemctl restart systemd-networkd as it can cause issues with photon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment