The static route configuration consists of two steps: first check the kernel router and then run the route command. The static route is a fixed route table set in the router. The static route does not change unless the network administrator intervene. Because static routing configuration does not reflect network changes, it is generally used in a network with a small network size and a fixed topology. Static Routing is simple, efficient, and reliable. Among all the routes, static routes have the highest priority. When a dynamic route conflicts with a static route, the static route prevails. Linux supports the following routing daemon processes:
Routed: supports the RIPI routing protocol;
Gated: supports four routing protocols: RIP, BGP, EGP, and OSPF;
Zebra: supports three routing protocols: RIP, BGP, and OSPF;
Static route configuration Step 1: view the kernel route table
Log on to the Linux server and view the route table. Run the following command: route, 127.0.0.1, that is, the closed loop address. We know that all computers using the TCP/IP protocol have an IP address, confirm each other by IP address, and transmit information and data. In some cases, we want to perform a test (such as whether the NIC is correctly installed), or do not have another computer as the receiving end. At this time, we can use this machine to assume the sender and acceptor of information. This is the so-called closed loop. You can also use the equivalent command: netstat-r.
Step 2 of static routing configuration: route command format:
The main options are as follows.
-N: The domain name is not displayed.
-E: displays other information.
-V: displays details.
-F: displays FIB information.
-C: displays FIB cache information.
Add: add a route.
Del: delete a route.
-Net: A route arrives at a network, not a host.
-Host: The route arrives at a host.
-Netmask Nm: Specifies the subnet mask of the route.
Gw: the gateway of the specified route.
Route command example:
Route entry added to the host
Route entry added to the network
Delete A route