As shown above, you will see three important information: ipv4 address, subnet mask and default gateway; The default gateway and subnet mask under the same subnet are the same.
A gateway is a "gateway" through which one network connects to another. It is actually the ip address from one network to another. Interfaces between different networks. A forwarding point from one network to another.
For ip addresses that are not in the same network, if they want to communicate with each other, they must rely on the gateway. This function is completed by the router, that is, the three-layer device.
Default Gateway: Just like a room with multiple doors, a host can have multiple gateways. Default gateway means that if the host cannot find an available gateway, it will send the packet to the default gateway.
The value of the gateway is generally the last ip address of this network segment.
If you want data to communicate normally in the network, three addresses are necessary.
The function of port number is to let all kinds of application processes in the application layer pass their own data down to the transport layer through the port, so that the transport layer knows that the data of its message segment should be uploaded to all application processes in the application layer. In this sense, each port is equivalent to each application process.
Matters needing attention
Generally speaking, port numbers can be roughly divided into three categories:
2 1 FTP transport protocol
Telnet remote login
Simple file transfer protocol
53 DNS domain name resolution protocol
80 HTTP hypertext transfer protocol
1 19 NNTP network news transfer protocol
16 1 SNMP Simple Network Management Protocol
8000, 800 1 QQ server ports
All devices on the network have a unique address-MAC address, also called physical address, also called network card address.
The MAC address consists of 48 bits, usually expressed in 12-bit hexadecimal.
The first six bits of 16 are usually uniformly allocated by IEEE to determine the uniqueness of vendors.
The last 6 digits of 16 are managed by each manufacturer.
View MAC address
The IP address works in the network layer to complete the packet addressing.
physical address
Network address (ip address)
Set in the software system
Each port number can have multiple network addresses.
Used when addressing between networks.
A device used for routing in the Internet, or a device that implements routing, is called a router.
The main functions of the router:
Routing is information that guides the sending of IP messages.
Routers rely on routing tables for data forwarding when working. The routing table is equivalent to a map, which contains information of each route, and each information contains at least three items:
Static routing algorithm is a non-adaptive routing algorithm, which is a simple and unmeasurable routing algorithm. It does not use network state information, only makes decisions according to some fixed rules, and configures the routing table by manually inputting information. By default, static routes are private and therefore very secure.
Static routing
Dynamic routing
Before configuration, please explain a problem: Huawei's simulation simulator Ensp is used in this configuration case, and there may be an error as shown in the following figure when turning on the equipment.
The solution to this problem is to click on the routing device->; Right click-> build
Change the serial number to 9600,9601,9602 and so on, as shown in the following figure.
Case description:
As shown in the figure: three routers are connected.
Experimental requirements: Configure the name, address and static route of the route so that PC 1 can communicate with PC2.
The port address is shown above.
Note: In the configuration of router R 1, because192.168.10/92.168.2.0 and R/kloc-0.
The same is true for other router configurations.
Example 1: Configure R 1
System View # Enter System Mode.
Cancel the prompt of information center enable # close.
Interface g0/0/0 # is switched to port GE0/0/0.
Ipaddress192.168.1.254 24 # configure the IP address of GE0/0/0.
Inter g0/0/ 1 # switch to port GE0/0/ 1.
Ipaddress192.168.2.124 # configure the IP address of GE0/0/ 1.
Exit # to return to system mode
Iproute-static192.168.3.024192.168.2.2 # configure static route.
Iproute-static192.168.4.0 24192.168.2.2 # Configure static route.
The last two lines of commands, I will make some simple explanations here. In these two lines of commands, you will see that there are three sets of data here:
Example 2: Configure R2
System View # Enter System Mode.
Cancel the prompt of information center enable # close.
Interface g0/0/0 # is switched to port GE0/0/0.
Ipaddress192.168.2.2 24 # configure the IP address of GE0/0/0.
Inter g0/0/ 1 # switch to port GE0/0/ 1.
Ipaddress192.168.3.124 # configure the IP address of GE0/0/ 1.
Exit # to return to system mode
Iproute-static192.168.1.024192.168.2.1# Configure the static route.
Iproute-static192.168.4.0 24192.168.3.2 # Configure static route.
At this point, we should pay attention to two points:
1. When R2 is going to192.168.1.0, the next hop (gateway) is192.168.2.1.
2. When R2 is going to 192. 168.4.0, the next hop (gateway) is 192.6438+068.3.2.
3. The network segment to 192. 168.3.0 was configured at R 1. Don't forget to visit the 192. 1.0 network segment when you are in R2.
In the process of routing communication, a request packet needs to be sent. If the communication is normal, communication delay information, that is, response information, will be returned. Otherwise, two situations may occur:
1, the host address is unreachable. Cause of error: ip address is not configured.
2. Request a time-out. Error reason: There are only routes to be configured, and there are no routes to be configured back.
At this time, the ip addresses from pc 1 to192.168.3.1can be accessed normally. Now let's do a simple test. Before testing, we need to configure pc 1.
As shown in the figure below:
Pay attention to the fluorescent part, and you will find that the gateway address is the same as the IP address of GE0/0/0 of R 1, that is, GE0/0/0 is the gateway of PC 1. So is PC2!
As can be seen from the above figure, PC 1 successfully accessed the IP address of 192 438+068.3. 1.
Example 3: Configure R3
System View # Enter System Mode.
Cancel the prompt of information center enable # close.
Interface g0/0/0 # is switched to port GE0/0/0.
Ipaddress192.168.3.2 24 # configure the IP address of GE0/0/0.
Inter g0/0/ 1 # switch to port GE0/0/ 1.
Ipaddress192.168.4.254 24 # configure the IP address of GE0/0/ 1
Exit # to return to system mode
Iproute-static192.168.1.024192.168.3.1# Configure the static route.
Iproute-static192.168.2.0 24192.168.3.1# Configure static route.