Dear All,
I am currently facing an issue that whenever I try to add a static route in my Centos 7, all the services stop working unless I restart my server. Service Network Restart is working properly and all eth interfaces restart properly but services go in halt unless server is restarted.
If any further details are required, kindly let me know. I will really appreciate if any solution to this problem can be provided as soon as possible.
Server Requires Restart After Every Modification in Network
Re: Server Requires Restart After Every Modification in Network
What is the exact command you run to add this static route?
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke
Re: Server Requires Restart After Every Modification in Network
I am using the following command to add the route
ip route add <ip-address>/<mask> via <gateway> dev eth0
after adding the route I access eth interface by using the following command
vi /etc/sysconfig/network-scripts/route-eth0
In that, I add the following line
<ip-address>/<mask> via <gateway> dev eth0
This whole process works fine and even when I restart services, eth0 interface shows to get up but my services go in halt somehow. I have to reboot the server just to get the services running again.
ip route add <ip-address>/<mask> via <gateway> dev eth0
after adding the route I access eth interface by using the following command
vi /etc/sysconfig/network-scripts/route-eth0
In that, I add the following line
<ip-address>/<mask> via <gateway> dev eth0
This whole process works fine and even when I restart services, eth0 interface shows to get up but my services go in halt somehow. I have to reboot the server just to get the services running again.
Re: Server Requires Restart After Every Modification in Network
When I said the "exact" command, I meant exactly that. It's not possible to see what you did based on a generic "I ran something a bit like this".
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke
Re: Server Requires Restart After Every Modification in Network
These were the exact commands except that I didn't mention the IP Addresses. But there you go, look at the commands below in sequence
--> ip route add 192.168.61.200/16 via 192.168.61.254 dev eth0
--> vi /etc/sysconfig/network-scripts/route-eth0
--> 192.168.61.200/16 via 192.168.61.254 dev eth0
--> service network restart
After service network restart, services stop working whereas eth0 interface restarts properly. So to get my services running again, I have to run "init 6" everytime I add a new route.
--> ip route add 192.168.61.200/16 via 192.168.61.254 dev eth0
--> vi /etc/sysconfig/network-scripts/route-eth0
--> 192.168.61.200/16 via 192.168.61.254 dev eth0
--> service network restart
After service network restart, services stop working whereas eth0 interface restarts properly. So to get my services running again, I have to run "init 6" everytime I add a new route.
Re: Server Requires Restart After Every Modification in Network
I do hope that that is obfuscated, for if that route is real, then it makes no sense.Code: Select all
ip route add 192.168.61.200/16 via 192.168.61.254 dev eth0
Code: Select all
$ ipcalc -n -b 192.168.61.200/16
BROADCAST=192.168.255.255
NETWORK=192.168.0.0
The .61.254 is within that range. Either your machine is link-local the the range (in which case you do not need the route)
or you have a separate more specific route how to reach 192.168.61.254 (but if you do, why?)
What do you have in ip ro?
Service restart hardly works "properly", if services halt. Then again, if you have existing connections to "services" and you change routes, then the replies might go via the new routes, which the client does not expect. Hence connections fail.