Got it

[ Technical Dry Goods ] ECS node add permanent routing method

68 0 0 0 0

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:

1606831786627037436.png

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?.

1606831793819071537.png

This will take effect after restart or service network restart .

1606831802013080526.png


Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.