How to configure static routing

If there are two routers at the same time, how do the computers under the two routers communicate? Some people may also think of using jump, but do you know the specific configuration? Today, I will use the simulation software of Cisco routers to share with you how to configure static routing!

Baidu experience: jingyan.baidu.com

Tools/Materials

 
  • Route 2
  • 2 computers
  • 3 cross wires

Baidu experience: jingyan.baidu.com

network topology

 

Baidu experience: jingyan.baidu.com

steps/methods

 
  1. 1

    Set the IP of computer A to 192.168.1.2, the subnet mask to 255.255.255.0, and the gateway to 192.168.1.1! The diagram is as follows:

  2. 2
     
  3. 3

    Set the IP of computer B to 192.168.2.2, the subnet mask to 255.255.255.0, and the gateway to 192.168.2.1! The diagram is as follows:

  4. 4
     
  5. 5

    Configure the fastEthernet 0/0 port of route A as 192.168.1.1 and the subnet mask as 255.255.255.0. Since the default port of the route is closed, after configuring the IP for the route port, be careful to use no shutdown (no shutdown). close) command to open the port! The following are all the commands to configure route A port fastEthernet 0/0:

    Continuewith configuration dialog? [yes/no]: no

    Router#configure terminal (enter global configuration mode)

     

    Router(config)#interfacefastEthernet 0/0 (enter port mode, enter port 0/0)

     

    Router(config-if)#noshutdown (open port)

    The following is a screenshot (the command I entered with the red line drawn, the command without the red line drawn, that is the routing prompt):

  6. 6
     
  7. 7

    Configure the fastEthernet 1/0 port of route A as 192.168.3.1 and the subnet mask as 255.255.255.0. The following are all the commands to configure the fastEthernet 1/0 of route A port

    Router(config-if)#exit (return to global configuration mode from port 0/0)

    Router(config)#interfacefastEthernet 1/0 (into port 1/0)

    Router(config-if)#ipaddress 192.168.3.1 255.255.255.0 (IP and subnet mask are configured for port 1/0)

    Router(config-if)#noshutdown (open port)

    %LINK-5-CHANGED:Interface FastEthernet1/0, changed state to up

    Router(config-if)#exit (return to global configuration mode from port 1/0)

    The following is a screenshot (the command I entered with the red line drawn, the command without the red line drawn, that is the routing prompt):

  8. 8

    Configure the fastEthernet 1/0 port of route B as 192.168.3.2 and the subnet mask as 255.255.255.0. The following are all the commands to configure the fastEthernet 1/0 of route B port

    Continuewith configuration dialog? [yes/no]: no

    Router>enable (enter privileged mode)

    Router#configure terminal (enter global configuration mode)

    Enterconfiguration commands, one per line.End with CNTL/Z.

    Router(config)#interfacefastEthernet 0/0 (enter port mode, enter port 0/0)

    Router(config-if)#ipaddress 192.168.3.2 255.255.255.0 (IP and subnet mask are configured for port 0/0)

    Router(config-if)#noshutdown (open port)

    The following is a screenshot (the command I entered with the red line drawn, the command without the red line drawn, that is the routing prompt):

     

  9. 9

    Configure the fastEthernet 0/0 port of route B as 192.168.2.1 and the subnet mask as 255.255.255.0. The following are all the commands to configure the fastEthernet 1/0 of route A port

    Router(config-if)#exit (return to global configuration mode from port 0/0)

    Router(config)#interface fastEthernet 1/0 (into port 1/0)

    Router(config-if)#ip address 192.168.2.1 255.255.255.0 (IP and subnet mask are configured for port 1/0)

    Router(config-if)#no shutdown (open port)

    %LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

    Router(config-if)#exit (return to global configuration mode from port 1/0)

    The following is a screenshot (the command I entered with the red line drawn, the command without the red line drawn, that is the routing prompt):

     

  10. 10

    Set a static jump for route B. If it encounters a data packet accessing the network segment of computer A (that is, 192.168.1.0), it is specified for him to jump to port 1/0 of route A (that is, 192.168.3.1), Then query the routing table for the route reached after the jump, query the network segment of computer A (that is, 192.168.1.0), and then forward the data packet! The specific commands are as follows:

    Router(config)#iproute 192.168.1.0 255.255.255.0 192.168.3.1 (in global configuration mode)

    Screenshot below:

     

  11. 11

    A jump is also set on route A. If the data is sent out, and the way back is not found, then there is no return information! The specific commands are as follows:

    Router(config)#iproute 192.168.2.0 255.255.255.0 192.168.3.2 (in global configuration mode)

    Screenshot below:

     

  12. 12

    Use the ping command to test whether the entire network is connected! If you have done nothing wrong in the previous steps, then in the current test, you will get the following content:

     

    END

Baidu experience: jingyan.baidu.com

Precautions

 
  • To configure a static route, both routes must be configured to jump, otherwise, only one route is configured, then the result is that the data packet cannot be sent or the data packet is sent out, and the return address cannot be found! Remember

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326322271&siteId=291194637