Routing, static routing, default routing, command

One, routing

Routing : the forwarding process from the source host to the target host

### Diagram

Switch for forwarding through the same network segment

Routers for forwarding on different network segments

1.1 How the router works

Figure

1.2 Formation of the routing table

Routing table:
1. The collection of routing entries maintained in the router.
2. The router selects the routing table based on the
routing table. The routing table is formed:
1. Directly connected network segment
2. Configure IP address and port UP status to form a direct Connected route
b, indirectly connected network segment

1.3 Static routing

Manually configured by the administrator, it is one-way

Lack of flexibility
Insert picture description here

1.4 Default route

When the router cannot find the routing entry of the target network in the routing table, the router forwards the request to the default routing interface

The default route is a special static route

### Diagram

The ARP table is used to establish a connection. The
routing table is used for forwarding between routes.

Second, the command

1. Establish routing and PC connection, configure the corresponding IP and interface

< Huawei >sys

[Huawei]sys R1

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]ip address 192.168.0.10 24

[R1-GigabitEthernet0/0/0]undo shutdown

[R1-GigabitEthernet0/0/0]quit

[Huawei]display interface brief ####Check the network port status, open or closed
Insert picture description here


Insert picture description here

[R1] ip route-static 192.168.0.0 24 10.0.0.1

[R1] ip route-static 192.168.0.0 24 20.0.0.1 preference 70

[R1] ip routing-table

PC distribution IP

Command ping

Guess you like

Origin blog.csdn.net/IvyXYW/article/details/109282525