Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running redhat, and am having a problem with it getting confused as to what the IP of the default gateway is. My default gateway is 192.168.1.1, and everything will work fine for a while (days, maybe even weeks) then the system will stop being able to acces the internet. If I look at the cached routeing table (/proc/net/rt_cache) it has the gateway for eth0 listed as 192.168.1.2 which is my wireless router, and not right. If I run "ip route replace 192.168.1.0/24 dev eth0" the default gateway is restored to 192.168.1.1 and access to the internet is restored. Can anyone suggest what I am doing wrong, and what I need to do to fix it?
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296
Rep:
have you tried manually editing your /etc/sysconfig/network-scripts/ifcfg-eth0? i believe that's the file, sorry if it's not, it's been a while since i used redhat.
<edit>hi NoneTheWiser, welcome to lq. sorry i forgot that.</edit>
The GATEWAY line in ifcfg-eth0 is correct, it's 192.168.1.1.
What I think is happening is the system tries to send an email from a cronjob while the DSL router is down and when it can't reach the outside world, deletes/modifies the default route. All of the places I can think to look for setting the default gateway are set correctly, but when the default gateway isn't working for reasons only my ISP knows, the system changes the setting in memory. I just can't figure where it gets the value from or how to stop it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.