Configure static routes on a Linux Server

Source: Internet
Author: User

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

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.