Static Routing Principles and Configuration (ultra-detailed experiments to validate)

First, the principle of static routing

Routing: the router is responsible for control plane operating, whether the packet routing path from the source end through which the destination (source host to the best path between a target host)

Each interface on the router is a broadcast domain; each interface switch is on a collision domain ;

Routing table: route entry router set maintained, router routing table to make path selection

Forming the routing table: linear and non-linear network segment network segments (directly connected and indirectly connected)

Not directly connected: static routing and dynamic routing

Static routing manually configured, is characterized by one-way and a lack of flexibility (suitable for small-scale)

Default routing: routing table entries routing destination network can not be found, the request is forwarded to the default routing interface (leading to the other segments have one and only one path)

Priority: When the routing table at the same time there is the highest priority static and default route when static routing, matching on immediately forwarded, if there is no match on static routing, the default destination-based routing.

Second, the router forwards the packet encapsulation process (Layer 3 forwarding principle)

Features: IP unchanged, MAC is always changing; the router is to isolate broadcast

Described in detail below with illustration of this process:

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

First of all, our environment is that all equipment is the initial state, that is, the outside world knew little about, and now want to enable communication between hosts A and B

(1) Host A wants to communicate with host B, but only know the IP address of host B, so the first through the gateway, and when the host A does not know the MAC address of router A, it sends an ARP broadcast request so as to acquire routers a MAC address, in which case four elements:

Source IP address: 192.168.1.2/24

Source MAC address: 00-11-12-21-11-11

Destination IP Address: 192.168.1.1/24

Destination MAC address: FF-FF-FF-FF

(2) Since the ARP is broadcast, the E0 port receives this broadcast router A to view the data frame is found its own IP address, given from the response E0 port router A, the host A response is received for the ARP cache, this time send a ping packet from the host a, while the four elements (main content):

Source IP address: 192.168.1.2/24

Source MAC address: 00-11-12-21-11-11

Destination IP Address: 192.168.2.2/24

Destination MAC address: 00-11-12-21-22-22

E0 interface (3) router A destination MAC address is found themselves, and then open the packet (MAC header unlock), found that the IP address is the IP address of the host B, router A case opens queries whether the routing table entry information, matching the destination network segment, a path is found E1 direction, then need to re-encapsulated MAC header information, but can not package now, because no destination MAC address, the ping packets can be discarded, then the router a E1 port initiate an ARP broadcast, this time four elements are:

Source IP address: 10.1.1.1/8

Source MAC address: 00-11-12-21-33-33

Destination IP address: 10.1.1.2/8

Destination MAC address: FF-FF-FF-FF

(4) In this case E1 port router B receives this broadcast, the destination IP own found, the response is given, then the (E1 ports of router B) own MAC address (00-11-12-21-44 -44) tell a router's E1 port, E1 MAC address of the interface E1 port router a router B cache, in which case the host a ping packet can reach E1 ports, router B B router discovery to find their own, this start unpacking, routing table, router B E0 through to find the port sent the data package, but then do not know the MAC address of the destination (host B) of the ping packet is discarded, then the time of router B E0 port initiates an ARP broadcast, so as to acquire the MAC address of host B, when four elements are:

Source IP address: 192.168.2.1/24

Source MAC address: 00-11-12-21-55-55

Destination IP Address: 192.168.2.2/24

Destination MAC address: FF-FF-FF-FF

(5) when the host B receives the broadcast, unpacking find the target IP is their own, will be given in response to the interface E0 router B, telling its own MAC address, then E0 router interface to cache the response of B information, this time the host a ping packet data over again, this time four elements:

Source IP address: 192.168.2.1/24

Source MAC address: 00-11-12-21-55-55

Destination IP Address: 192.168.2.2/24

Destination MAC address: 00-11-12-21-66-66

After Host A and Host B can normally communicate with each other, thereby eliminating the need to broadcast the ARP. Note that in italics in the above process, verify that the previously mentioned "change the IP, the MAC always becomes" forwarding features.

Third, the experimental configuration of static routing operation

Binding process on the above principle, a simple experimental verification process.

First, tell us about the environment and topology

We need GNS3 software (my version is 1.3.10) in building this topology, the structure diagram shown below (which you can set the IP address settings yourself, but be careful to distinguish between network segments):

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

Cisco router equipment for the product, the mirror is c3725, R1 and R2 are two routers, PC1 and PC2 is a PC. Cisco equipment related model has the following four:

User mode (>), privileged mode (#), overall pattern (config #) and interface mode (config-if) it enters the representative feature brackets mode, during operation in the following explanation is given

(1) First, add your own good IP address, open the device connection, as shown below, add annotations that show the IP address, to prevent himself behind forgotten confusion configuration

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

(2) Open the red to green-point scale, represents a communication, then began to initiate operation of the respective devices to configure an IP address, then double-click the icon point device to open, will open the session window SecureCRT ( how GNS3 binding SecureCRT Please refer to the end of the article related supplement, has been achieved can be ignored ), this time to PC1 for example, the state opened as shown below:

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

(3) and enter the IP address of PC1 is set at first your IP address and other relevant information, the operation result shown below:

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

PC1 has been initialized at this time, do not close the session window, then a similar operation PC2

(4) After the above initialization is completed PC1 and PC2, remember not to close the session window, and then begins to initialize the router to R1, for example, is still double-click device configuration operations, the default will enter privileged mode, the following initial state:

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

(5) A router initialization process in accordance with the operation of FIG:

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

A case has been initialized to set the router, can use do show int ip brief view information needs to be configured and arranged to initialize the router B.

(6) The above steps complete the initialization operation of the device, then we need to manually configure the router static routes, shown with the specific operation is as follows:

And the operation on R1 are:

Format: ip route destination network number subnet mask to the interface address of the next hop router through a network of target

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

And the operation on R2 is (R1, such as the operation, but must pay attention parameters):

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

(7) to complete the simple router topology static routes according to an operation section (6) step, this time back to PC1 conversation window, enter the ping command, as shown below:

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

At this time found timeout occurs, which happens to verify the Layer 3 forwarding process in the above loss, of course, the number of packet loss need not be too concerned about, and then on the PC2 IP address of ping PC1 (I had some time to operation), the results as shown below:

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

If at this time once again to return to the PC1 continues to ping PC2, the result is:

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

In this case we found no timeouts, because communication has been established, not a loss.

Fourth, the relevant supplement

How GNS3 in conjunction with SecureCRT?

1. Select Edit in the Preferences in GNS3 software interface settings window open ...

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

2. Then the operation sequence diagram in number, must pay attention to the accuracy of the path below Set! ! !

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

3. Finally, talk about the background and font settings SecureCRT

(1) a valid figure (only the current window, closed after the next opening is invalid)

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

(2) permanently set (After setting need to close the window opens again to take effect)

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

Static Routing Principles and Configuration (ultra-detailed experiments to validate)

Remember permanent sure to close the window After selecting OK to open again to take effect! ! !

Guess you like

Origin blog.51cto.com/14557673/2443467