Add permanent route to Centos

Source: Internet
Author: User

When I was testing with a virtual machine today, I suddenly found that the Internet was disconnected. I remember that I had added a route before and restarted the network service. After careful consideration, it should be that the route to be added was temporary, the restart is gone, so I had the impulse to write it permanently. After reading some documents, as long as the/etc/sysconfig/network-scripts/route-eth0 since my system version is 5.4, there is no rout-etho file, so this file is created, the command is as follows:

Note: This must correspond to the NIC name.

Note: Add a CIDR Block
Note: add to a host
Note all networks, similar to default routes

 

 

Or you can change it to the following:







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.