How to specify default gateway device if multiple interface has gateway ?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Issue

  • How to specify default gateway device if multiple interface has gateway ?

Resolution

  • In order to set any specific device to be the default gateway device in the system, add following option in /etc/sysconfig/network file:
GATEWAYDEV=ethX

Root Cause

  • If a system has more than one interface, then the last interface which is being brought up will become the default gateway device. This is a designed behaviour in RHEL initscripts.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.