How to set up static routes

mikelato

Verified User
Joined
Jan 25, 2010
Messages
74
Hi,

I seem to be having an issue with my routing tables. My network was working fine and then I rebooted my server and it does not work anymore. I am pretty sure that my IP configuration and ifcfg-eth0 files are configured correctly.

I believe I have narrowed it down to the routing tables having an issue.

I am using CentOS 5. Where are the static routes located? Is it /etc/sysconfig/network-scripts/route-eth0? If so, what should that file look like in order to have my routes work correctly on a network restart?

Right now the file looks like this...

ADDRESS0=XXX.XXX.XXX.0
GATEWAY0=XXX.XXX.XXX.190
NETMASK0=255.255.255.248

Thanks,
Mike
 
Also,

I just set up a remote reboot unit. I turned it on, put in the static IP, DNS, and gateway etc...

I rebooted the device and it is online with the static IP working fine.

Why does linux not work this way? For some reason I find it extremely difficult to get my network setup to be stable. Maybe I am just missing something in the setup but I have yet to find a good tutorial that walks me through the entire process from start to finish.

Are there any linux applications or scripts I can use that will walk me through the setup, prompt me for my information, and then modify the necessary files to get my networking set up properly?

Thanks again,
Mike
 
I am used to windows so sorry I am fairly new at this.

From that link you posted it seems I do not need static routes then. How do I flush out the static routes and stop them from creating the routes on network restart.

The server is offline so I cant copy and paste the eth0 file but it has to be correct because the server was working fine and it stopped working after reboot so it must be something that isn't sticking on a reboot or network restart.

Do you know of anything that could cause that?
 
Back
Top