0

I've overridden the ip routing rules on my RHEL machine by adding custom logic in a new script ifup-local that is run immediately after a new interface is attached.

/etc/sysconfig/network-scripts/ifup-eth executes dhclient with lease times for each interface. At the end of a lease period dhclient tries to update the ip rules which conflict with my settings.

Is there a way I can avoid this? As a work-around I've also written a script that runs at the same time as dhclient and removes the new rules written by dhclient.

user1071840
  • 125
  • 1
  • 1
  • 8

1 Answers1

0

You can use dhclient-script and its hooks to override the route configuration.

For example, add this line to /etc/dhcp/dhclient-enter-hooks.d/no-default-route:

unset new_routers

So the default gateway does not get set. You can add any logic you want in this script.

gtirloni
  • 5,746
  • 3
  • 25
  • 52