How to set default dhcp for new added network interface?


May I ask, for new added network interface, how to set it is DHCP as default, not static as right now? Thank you.

I create a VPS image from an existing OpenSUSE 15.4 which has a DHCP network setting. When I create a new VPS instance using this image, it gets a new “eth1” interface with static interface as default setting, which leading no internet connection. I have to login into console to delete the old eth0 and setup eth1 to dhcp.

Best regards.

I suspect it does not have any settings at all. Where are static parameters supposed to come from?

It sounds like interface names are based on interface MAC and new instance has different MAC. What is the content of /etc/udev/rules.d/70-persistent-net.rules and /etc/sysconfig/network/ifcfg-eth0?

cat /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM==“net”, ACTION==“add”, DRIVERS==“virtio-pci”, ATTR{dev_id}==“0x0”, KERNELS==“0000:01:00.0”, ATTR{type}==“1”, KERNEL==“eth*”, NAME=“eth1”

sudo cat /etc/sysconfig/network/ifcfg-eth0

sudo cat /etc/sysconfig/network/ifcfg-eth1