1. Simple Topology
Preparatory Knowledge Points
Router principles:
As the third layer device, the basic function of a router is to select routes according to the network layer address.After it judges the packets it receives based on the destination address, it sends them from the interface that can reach the destination address, and each router in the network completes the work so that all packets can cross the network from the source host to the destination host.All routers can forward packets correctly because they have a router table in their memory that records the corresponding forwarding interface for this network. A router only needs to check the routing table to know from which interface the packets should be forwarded.
Router functions:
The basic function of a router is to select the optimal path to forward packets based on the destination address.With the rapid development of network technology, the function of router has been greatly expanded.In addition to basic functions, routers now have the following main functions:
- Together with different types of networks: Routers support a variety of LAN and WAN interfaces, and can connect different types of networks to achieve interconnection between networks.
- Data processing: Provides functions including packet filtering, forwarding, priority, encryption, compression, and firewall.
- Network management: Provides functions including router configuration management, performance management, fault tolerance management and traffic control.
- Support a variety of business: support MPLS, three-tier VPN, two-tier VPN and other new services.
Simple applications of routers in network topology and the next hop of routers are illustrated with practical examples.
We introduce the simple use of the router and the next hop of the router through such a simple network topology diagram.
In this network topology, there are 192.168.1.0 192.168.2.0 192.168.3.0 192.168.4.0 network segments, which are directly connected to the router port. The router can automatically find the destination address for forwarding, but how can it forward a segment that is not directly connected to the router port?
Next we will look at the router's next hop.
Next hop: The next point of the route, if the router is not directly connected to the destination network, it will have a neighbor router that provides the next hop route to transfer data to the destination
Example description:
For Router 0 in the topology:
ip route 192.168.3.0 255.255.255.0 192.168.2.2 ip route 192.168.4.0 255.255.255.0 192.168.3.2
Router 0 is not directly connected to 192.168.3.0 and 192.168.4.0 segments. If we are looking for these two segments, we will first find 192.168.2.2 and 192.168.3.2 segments and then 192.168.3.0 and 192.168.4.0 segments respectively.
For Router 1 in the topology:
ip route 192.168.4.0 255.255.255.0 192.168.3.2 ip route 192.168.1.0 255.255.255.0 192.168.2.1
Router 0 is not directly connected to 192.168.1.0 and 192.168.4.0 segments. If we are looking for these two segments, we will first find 192.168.2.1, 192.168.3.2 and then 192.168.1.0 and 192.168.4.0 segments respectively.
For Router 2 in the topology:
ip route 192.168.1.0 255.255.255.0 192.168.2.1 ip route 192.168.2.0 255.255.255.0 192.168.3.1
Router 0 is not directly connected to 192.168.1.0 and 192.168.2.0 segments. If we are looking for these two segments, we will first find 192.168.2.1, 192.168.3.1 and then 192.168.1 and 192.168.2.0 segments respectively.
IOS Command
Router 0
Router>enable Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface FastEthernet0/0 Router(config-if)#ip address 192.168.1.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up Router(config-if)#exit Router(config)#interface FastEthernet0/1 Router(config-if)#ip address 192.168.2.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2 Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.3.2 Router(config)#exit Router#write
Router 1
Router>enable Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface FastEthernet0/0 Router(config-if)#ip address 192.168.2.2 255.255.255.0 Router(config-if)#no shutdown Router(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up Router(config-if)#exit Router(config)#interface FastEthernet0/1 Router(config-if)#ip address 192.168.3.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1 Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.3.2 Router(config)#exit Router#write
Router 2
Router>enable Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface FastEthernet0/0 Router(config-if)#ip address 192.168.3.2 255.255.255.0 Router(config-if)#no shutdown Router(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up Router(config-if)#exit Router(config)#interface FastEthernet0/1 Router(config-if)#ip address 192.168.4.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1 Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.1 Router(config)#exit Router#write
(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.1
Router(config)#exit
Router#write