Too many late nights and a never ending list of tasks to complete with ever shortening deadlines. This is what lead me to discover some interesting behaviour in ESX and quite possibly apparent in Linux/Unix distro's too..?
To configure a default route in an ESX Service Console (or on a RHEL based distro) is to add the gateway into the /etc/sysconfig/network file. GATEWAY=10.0.0.1
You can then run the command route which should give you an output with something similar to this:
default 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
What I had, no gateway was being set, even though my network file was correctly configured. Manually running the route command was a temporary fix, though it was lost once a reboot or network service restart command was executed:
route add default gw 10.0.0.1As it turned out, the route was being dropped because of a configuration mis-match in my interfaces file. In the case of my ESX server, the interface file: /etc/sysconfig/network-scripts/ifcfg-vswif0
The culprit was the line: NETWORK=192.168.0.0 when in fact it should of been configured as NETWORK=10.0.0.0
Thus the end to my default route not being set by the configuration of /etc/sysconfig/network
2 comments:
Thanks, this has been bugging me for ages on one of my ESX servers!
Add one more to the list, just got me out of a troubleshooting nightmere, service restored in 5 minutes thanks to this post.
Post a Comment