VMware Modern Apps Community
Bejron
Contributor
Contributor
Jump to solution

DHCP ?

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 ?

1 Solution

Accepted Solutions
caddo
Enthusiast
Enthusiast
Jump to solution

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.

View solution in original post

3 Replies
caddo
Enthusiast
Enthusiast
Jump to solution

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.

Bejron
Contributor
Contributor
Jump to solution

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

0 Kudos
praseodymium
Enthusiast
Enthusiast
Jump to solution

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.

0 Kudos