Static route Configuration
1 ip route x. x. y (port)
The port must belong to the device.
2 ip route x. x. y (ip -- address)
This IP address must be the peer device and the user
<IP address of the interface used for interconnection>
Note: A gateway is a port, not a device.
The device where the gateway (port) is located must have the "routing" Function
Any device with the "routing function" will use the gateway for communication. The gateway does not need to be configured for communication between devices in the same network segment.
When writing static routes, we strongly recommend that you use the IP address of the Peer device.
The principle of finding a route entry for a vro;
When the router matches the data packet with the route table entry
If multiple entries can be matched at the same time, select the subnet
The entry with a long mask is forwarded, which is called the longest matching principle.
Special route entries;
0.0.0.0/0 ------> indicates all networks <called default routes>
Configuration: ip route 0.0.0.0 0.0.0.0 10.10.23.2
Exchange: Communication in the same network segment is called Exchange (the exchange fails. Check the forwarding entries of the MAC and switch)
Route: communication between different CIDR blocks is called a route. (The route cannot be accessed. Check the forwarding entries of IP addresses and routes)
Case -- 1
Experiment Name: static route configuration and implementation
Lab extension:
Lab requirements: 1. Website Editing Based on Network Extension
2 ensure PC-1 and PC-2 Intercommunication
Experiment Configuration:
1. Configure the IP address related information of the terminal PC-1;
Ip-192.168.1.1
Mask-memory limit 255.0
Gateway-192.168.1.250
2. Configure the IP address of the R1 interface;
Interface gi0/1
No shutdown
Ip address 192.168.1.250 255.255.255.0
Exit
Interface gi0/0
No shutdown
Ip address 10.10.12.1 255.255.255.0
Exit
3. Configure the IP address of the R2 interface;
Interface gi0/2
No shutdown
Ip address 10.10.12.2 255.255.255.0
Exit
Interfasce gi0/1
No shutdown
Ip address 192.168.2.250 255.255.255.0
Exit
4. Configure the IP address related information of the terminal PC-2;
Ip-192.168.2.1
Mask-memory limit 255.0
Gateway-192.168.2.250
5. Make sure that the gateway of the PC-1 can go to the network segment of the PC-2;
R1:
Ip route 192.168.2.0 255.255.255.0 10.10.12.2
6. Make sure that the gateway of the PC-2 has a route to return to the network segment of the PC-1;
R2:
Ip route 192.168.1.0 255.255.255.0 10.10.12.1
Verification command:
Show ip interface
Show ip route
PC-1/2:
Ping 192.168.2.1
Ping 192.168.1.1