Controlling DHCP settings on the host when using multiple interfaces

wetshoes

New Member
Feb 5, 2025
4
1
3
I have multiple interfaces on the host attached to different switch ports, all using DHCP. I want to have a "primary" interface that sets the default route, the DNS domain and DNS search values (again, all for the host itself).

In Ubuntu using netplan, this is easy, I would do something like:
Code:
network:
  ethernets:
    eno1:
      dhcp4: true
      dhcp4-overrides:
        use-routes: false
        use-dns: false
        use-domains: false
    eno2:
      dhcp4: true
  version: 2

I've accomplished this on the host by manipulating the dhclient options (in /etc/dhcp/dhclient.conf):
Code:
request subnet-mask, broadcast-address, time-offset, host-name,
    dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;
interface "en02" {
    also request routers, domain-name-servers, domain-name, domain-search;
}

It works, but it's particularly inelegant, and I'm looking for better suggestions.
 
  • Like
Reactions: jamesP
One of the primary reasons I have this setup is because I'm running Proxmox in a cluster and I have a dedicated Corosync VLAN that doesn't have any network egress. As DHCP values get resolved per interface, they overwrite any previous routes, include the default gw, and dns resolution settings in /etc/resolv.conf. I have this setup to ensure the default route for the host itself is never this Corosync VLAN.
 
Last edited:
Finding things like resolvconf and openresolv, although they only control access to /etc/resolv.conf.

I guess I could use one of those in combination with ip route replace to increase the route metric in a post-up command from /etc/network/interfaces.

But these combinations are even more inelegant than just modifying /etc/dhcp/dhclient.conf.
 
Even in NetworkManager you can easily do this:

Code:
ignore-auto-dns=true
ignore-auto-routes=true
never-default=true
 
Last edited:
I have multiple interfaces on the host attached to different switch ports, all using DHCP. I want to have a "primary" interface that sets the default route, the DNS domain and DNS search values (again, all for the host itself).

In Ubuntu using netplan, this is easy, I would do something like:
Code:
network:
  ethernets:
    eno1:
      dhcp4: true
      dhcp4-overrides:
        use-routes: false
        use-dns: false
        use-domains: false
    eno2:
      dhcp4: true
  version: 2

I've accomplished this on the host by manipulating the dhclient options (in /etc/dhcp/dhclient.conf):
Code:
request subnet-mask, broadcast-address, time-offset, host-name,
    dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;
interface "en02" {
    also request routers, domain-name-servers, domain-name, domain-search;
}

It works, but it's particularly inelegant, and I'm looking for better suggestions.
I only installed pve yesterday, but I was already wondering where I would do this (I haven't looked very hard yet, and I have lots of other things to get set up in before this becomes a priority), I will be interest to see if there is an answer.