Wednesday, June 13, 2012

force default gateway through eth0

On a CentOS 5.8 machine, I needed to keep the default gateway route through eth0, even though both eth0 and eth1 were receiving DHCP. It took a suprisingly long time to Google that in CentOS, you can simply use GATEWAYDEV=eth0 in /etc/sysconfig/network rather than mucking with /etc/sysconfig/network-scripts/, etc.

It is a little annoying that although CentOS will pick up the hostname from the first dhcp upped interface (eth0 in this case), it will set the default route through the last dhcp upped interface (eth1 in this case).

2 comments:

  1. You are officially my hero. Your little blogpost here concluded my almost hour-long web-search.

    ReplyDelete
    Replies
    1. Eureka! I'm sorry that it took even that long.

      Delete

Note: Only a member of this blog may post a comment.