Photon OS

 View Only
  • 1.  DHCP ?

    Posted Apr 22, 2015 10:12 AM

    Hi,

    I have tried launching Photon on a network witthout DHCP and setting the ip, gw and everything via ifconfig but no luck.

    Any advice to running Photon with a static IP set from inside ?



  • 2.  RE: DHCP ?
    Best Answer

    Posted Apr 22, 2015 11:35 AM

    You need to use the iproute2 commands and ifconfig commands are deprecated.

    Try this:

    ip addr flush dev eth0     # remove running ip config

    ip addr add xxx.xxx.xxx.xxx/xx dev eth0     # set ip for dev eth0

    ip addr show

    ip route add default via xxx.xxx.xxx.xxx dev eth0      # set default gateway

    It should work but i don't know how to make this survive a reboot, didn't have time to play with config files yet.



  • 3.  RE: DHCP ?

    Posted Apr 22, 2015 01:06 PM

    That worked liked a charm. Thank you, now we just have to figure out to make it persistent..



  • 4.  RE: DHCP ?

    Posted May 08, 2015 05:02 PM

    Remove /etc/systemd/network/10-dhcp-eth0.network and create a new file /etc/systemd/network/static.network with the following contents:

    [Match]

    Name=eth0

    [Network]

    Address=xx.xx.xx.xx/24

    Gateway=xx.xx.xx.xx

    DNS=xx.xx.xx.xx

    Domains=xx

    Then execute systemctl restart systemd-networkd.