DHCP default route

Issues related to configuring your network
Post Reply
waranty92
Posts: 10
Joined: 2017/02/04 06:35:05

DHCP default route

Post by waranty92 » 2017/02/04 06:38:41

HI guys. I have 2 isp-a and I get IP address from both by dhcp, I need to set metric on one of interfaces higher than on another. I have tried adding METRIC=150 in ifcfg file but it did not work. My os id centos 7

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: DHCP default route

Post by aks » 2017/02/06 16:57:28

I don't think you can.
There's 2 ways (of course) to add routes with DHCP:
1) Option 33: http://www.networksorcery.com/enp/proto ... ion033.htm
2) Option 121: https://tools.ietf.org/html/rfc3442
I didn't read all of those links, but I seem to recall it can't be done anyway.

As a solution, perhaps you could add more specific routes, so traffic destined to *that* place will do down the more specific route, rather than the default (or another route)?

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: DHCP default route

Post by jlehtone » 2017/02/06 21:43:39

Editing an ifcfg-file and using nmcli can have a different result.

Check 'man nm-options' as there might be:
https://people.freedesktop.org/~lkundra ... ute-metric

Macenger
Posts: 23
Joined: 2016/10/18 08:29:57

Re: DHCP default route

Post by Macenger » 2017/02/26 14:55:00

Just for clarity of the issue: is the default route obtained from one DHCP getting overwritten by the DHCP from the other server?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: DHCP default route

Post by TrevorH » 2017/02/26 14:59:41

Most likely, yes. The solution should be to add DEFROUTE=no to the ifcfg file for the interface that shouldn't be setting the default route.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply