Command to add a route: 1.Route add
2.ip ro add
Common parameters:
Let the route still take effect after restarting the server: 1. Add in /etc/rc.local: The command to add a route is: directly copy the command in the command line operation to the file, save and exit. 2. Write in the /etc/sysconfig/static-routes file: If the file does not exist, create it manually and add the following content: Refer to the shell statement in the /etc/init.d/network file:
Then, if you want to add a static route, the command is: Then, add the following format to the /etc/sysconfig/static-routes file: or Comparison of two ways to add static routes: 1.rc.local: Restart the server to take effect; If you restart the network service, the static route will become invalid; rc.local is the last script to be run after the system is started, so if a service such as NFS requires a network connection to be mounted, this method is not suitable. 2.static-routes: Restart the server to take effect; Restart the network service to take effect: Suitable for services that require network requirements; The script method of adding static routing is similar to rc.local: This method is actually to write your own script, put it at the beginning of /etc/rc3.d/ and set it to S. S means start, the numbers are the sequence, and K means stop. Generally, startup is the startup sequence of the daemon process in a certain mode. The smaller the number, the earlier the startup order; /etc/rc3.d is a text multi-user environment, which is generally used in production environments. **If you need to add static routes, try to add the static routes to the /etc/sysconfig/static-routes file. Avoid routing failure due to restarting network services, thereby avoiding failures. ** The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Mysql database scheduled backup script sharing
>>: React's component collaborative use implementation
Beautiful code is the foundation of a beautiful we...
Basics The matching order of location is "ma...
As a backend programmer, sometimes I have to tink...
11. Use JavaScript to create page effects 11.1 DO...
Table of contents 1. this points to 2. Modify thi...
Table of contents Design scenario Technical Point...
Installation Steps 1. Install Redis Download the ...
Anaconda is the most popular python data science ...
Table of contents Preface SQL statement optimizat...
Preface We all know that the QR codes in official...
reason The mysql version that nacos's pom dep...
Effective solution for Ubuntu in virtual machine ...
First of all, this post is dedicated to Docker no...
The compatibility of browsers is getting better a...
Table of contents Implementation effect diagram I...