A route is used to select a route. A route consists of a static route and a dynamic route. The corresponding route table is called a static route table and a dynamic route table. The static route table is manually created by the network administrator during system setup. It is a route table customized by the Administrator. The network structure changes. For example, the route expansion or reduction requires the network administrator to manually modify the route table. A dynamic route table is created dynamically based on the corresponding route data exchange protocols (such as RIP and OSPF, the data entries in the route table dynamically change according to the changes in the network topology. Human intervention is not required. The router automatically calculates the optimal data transmission path based on the functions provided by the routing protocol, and obtains the dynamic route table.
Static Routing has the following features:
1. The static route table is created by the network administrator before you start to select a route, and can only be changed by the network administrator. Therefore, it is only applicable to environments with simple network transmission statuses.
2. There is no need for Route switching for Static Routing, which saves network bandwidth, CPU utilization, and vro memory.
3. Static Routing provides higher security. In a network using a static route, all routers connected to the network must set their corresponding routes on the adjacent router. Therefore, network security is improved to some extent.
4. In some cases, you must use static routes, such as DDR and the network environment using NAT technology.
In addition, Static Routing has the following Disadvantages:
1. Managers must understand the network topology and correctly configure routes.
2. Poor network scalability. To add a network to the network, the Administrator must add a route to all routers.
3. configuration is cumbersome, especially when it is necessary to communicate across several routers, the routing configuration is more complex.
The following is a simple configuration of Static Routing:
First, set the corresponding CIDR Block, basic port number, and Topology chart.
You can choose Options> preference> portLabels Always Shown to mark the port corresponding to each vro.
Then configure according to the above identity:
Set the IP address, default gateway, subnet mask, and other information on the PC, and run commands in global configuration mode on the vro.
Int f0/0
Ip address 10.0.0.25255.5.255.255
No shutdown
Vrouters are set one by one. Because no static routing is set, the IP address of PC1 on PC0 is displayed as inaccessible.
Configure static IP routing:
Configure R1. First, use the showip route command to find that the routing table only has information about the two connected CIDR blocks and does not reach the CIDR Block 40.0.0.0.
Therefore, run the command R1 (config) # iproute 40.0.0.0 255.255.255.0 255.0.0.252
To send the packet to the CIDR Block 40.0.0.0, you only need to first send the packet to port 0.0.252.
Since R3 contains information directly to the 40.0.0.0 network segment, you only need to configure the R2 router:
R2 (config) # iproute 40.0.0.0 255.255.255.0 30.0.0.253
When we use the Ping command again, we can find that the returned error is no longer unreachabel but timeout, which proves that the Ping packet has passed through the router to the target host, however, no information is returned from the corresponding host. This is because no route information is set on the target side. You can set the router in the same way.
During the operation, I found that when the static route of the last gateway is specified to form a complete path, all the green spots flashed. Ping results:
In addition, if packet loss occurs at the beginning. It is normal because the router needs ARP to find the target host.
It should also be noted that although a pass is formed, P0 cannot be pinged to Ping R3. The result is:
This is because there is no route information that reaches the 30.0.0.0 network segment in the R1 route table. You need to add the following on R1:
R1 (config) # iproute 30.0.0.0 255.255.255.0 255.0.0.252.
From the above implementation, we can find that it is quite time-consuming to configure static routers. In the enterprise network implementation, if the internal network is set through static routing, if the internal network needs to access the Internet, when there is no matching table item between the external gateway routing table and the destination address of the package, it will return the information that the destination cannot be reached and discard the package. To solve this problem, you can set the default gateway.
The specific format is 0.0.0.0 0.0.0.0 default gateway IP address, that is, when the IP address in the package does not match the data in the route table, the package is sent to the specified Default Gateway, which is responsible for sending the package.
The no ip route command is used to delete the specified information in the static routing table.
About static floating routing:
:
When two routers are connected by more than one line, you can specify two static routes. The setting result is as follows:
This is a load balancing status, that is, if the two hosts exchange data through the two routes, the selected path is random and not fixed, you can change the status to set another path as a backup link.
Ip route 40.0.0.0 255.255.255.0 255.0.0.254 100
Or ip route40.0.0.0 255.255.0 30.0.0.254 100 is to add a path parameter later. The default value is 1. The smaller the value, the higher the priority. When one item fails, the other one can be used as a backup link.
In general, it is safe to use Static Routing when building a small environment with high security requirements.