I was wondering if there is a way to configure an Ethernet interface such that the base interface (in my case it's enp9s0) uses a static interface, while the secondary interface enp9s0:0 uses DHCP.
If both interfaces use a static IP it does work. However, as soon as one of the interfaces is set to use DHCP, the interface does not show up.
This is for IPv4 on Centos 8 if this matters.
thanks in advance!
Chuck
Can you have a Static IP on a primary interface and use DHCP on a secondary interface?
Re: Can you have a Static IP on a primary interface and use DHCP on a secondary interface?
enp9s0:0 is an alias interface.
https://www.kernel.org/doc/html/latest/ ... alias.html writes:
NetworkManager can configure multiple IP addresses to one connection, although I'm not sure about the DHCP + statics combo.
A much bigger issue is that your question sounds like a XY problem http://xyproblem.info/
What do you actually try to achieve?
https://www.kernel.org/doc/html/latest/ ... alias.html writes:
It also writes: "Newer tools such as iproute2". Iproute2 has been in use two decades now ...IP-aliases are an obsolete way to manage multiple IP-addresses/masks per interface.
NetworkManager can configure multiple IP addresses to one connection, although I'm not sure about the DHCP + statics combo.
A much bigger issue is that your question sounds like a XY problem http://xyproblem.info/
What do you actually try to achieve?
Re: Can you have a Static IP on a primary interface and use DHCP on a secondary interface?
I would suspect that it might be possible to do the opposite and have a DHCP address on the main interface and then add a static alias...
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke
Re: Can you have a Static IP on a primary interface and use DHCP on a secondary interface?
Apparently combo is possible without any alias:
http://www.szakmeister.net/blog/2017/ju ... -ip-nmcli/
http://www.szakmeister.net/blog/2017/ju ... -ip-nmcli/