Hello, everyone!
Today I'm going to introduce you DAYU
Due to business requirements, it is necessary to add permanent routes. We know that we can use the following methods to add routes once normally, for example:
After the addition, route-n can find out whether the addition is effective.
But when the network card restarts or the ECS node restarts, you will find that the added routing information is lost. It is said on the Internet that you can add -p to specify a permanent addition, but this is on windows. Linux does not support it.
Here is a way to share.
Create a new route-eth1 in the /etc/sysconfig/network-scripts/ directory ( add whichever route is created for that network card, you can also write route-eth0 , route-eth1) , permission 600 is fine, no x permission is required. Then if routing information is inside, such as:
After adding, reboot or service network restart will do.
It will take effect after execution at this time. If the following error occurs when executing service network restart or the route is found to be lost after restarting:

It is because the default template in the ECS node has five network cards, and you may only have three network cards or less than five network cards. At this time, you need to delete the extra ifcfg-eth?.

This will take effect after restart or service network restart .
