IPV4 Classified Address Tutorial

The first part: the ip addresses 192.168.0.1 and 192.168.0.2 of the two PCs.
Refer to the topology diagram to configure the IP addresses and subnet masks of the two PCs;
insert image description here

Pc0 IP address configuration (I configured the gateway of pc0 in advance) insert image description here
Pc1 IP address configuration
insert image description here
At this point, the two PCs can be connected, that is, the two computers can communicate;
insert image description here
the second part: the ip address of the PC on the right is 172.16.1.1.
3. Modify the IP address of the PC on the right to 172.16.1.1, and configure the gateway in advance;
insert image description here
at this time, pc0 and pc1 cannot communicate as shown in the figure below;
insert image description here
Part 3: Modify the network topology and add a router (each port Different networks can be connected to realize communication between different networks).

insert image description here

Configure the correct ip address and subnet mask for the two ports of the router, and configure the corresponding gateways for the two PCs.
The g0/0 port of the router can be configured with an IPV4 address range of 192.168.0.2 192.168.0.254, and the g0/1 port of the router can be configured with an IPV4 address range of 172.16.1.2 172.16.255.254.
1. Please select the largest ipv4 address as the address of g0/0 port, and start it.
2. Please select the largest ipv4 address as the address of port g0/1, and start it.
The router configuration command is as shown in the figure:
when entering the router, choose yes/no to no;
the command is as follows:
insert image description here
after the configuration is completed, the connection between the router and the line turns green. The two computers can communicate;
insert image description here

Note: When using a router to connect the PC side, two conditions must be met for two PCs to communicate.
The first condition:
The PC side must be configured with a gateway. For example, if the IP address of Pc1 is 192.168.0.1, its gateway should be 192.168.0.254, 192.168 .0.2 is the broadcast address. If the Pc2IP address is 172.16.1.1, its gateway should be 172.16.255.254, and 172.16.255.255 is the broadcast address.
At this time, you little guy should ask, why their gateways will change, it is because their address types are different, 1.0.0.0 to 127.255.255.255 is a class A address; 128.0.0.0 to 191.255.255.255 is a class B address ; 192.0.0.0 to 223.255.255.255 are Class C addresses (the blue numbers represent variables),
so pc0 is a Class C address, and pc1 is a Class B address. Because the last address with 255 is a broadcast address, change the last one to 254 is the gateway, and the blue mark in front is written as the largest, so write 255. The
second condition:
configure the correct ip address and subnet mask for the two ports of the router
Router>en (access privilege)
Router#conf t (Enter global configuration)
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#inter g0/0 (Enter line g0/0)
Router(config-if)#no shutdown up ( Router, because when connecting to the router at the beginning, the connection is red and cannot be connected, the no shutdown command can make the line connected.)

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

Router(config-if)#no ip addr (this command is to eliminate the original IP address)
Router(config-if)#ip addr 192.168.0.254 255.255.255.0 (configure the new IP address of the router, but this IP address is pc0 , which is equivalent to recording the IP address of pc0 into the router. This IP address is the gateway. The subnet mask is the subnet mask of pc0)
Router(config-if)#inter g0/1 (enter the line g0/1)
Router (config-if)#no shutdown (router, because the connection is red when it is connected to the router at the beginning, it cannot be connected, the no shutdown command can make the line connected.)

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

Router(config-if)#no ip addr (this command is to eliminate the original IP address)
Router(config-if)#ip addr 172.16.255.254 255.255.0.0 (configure the new IP address of the router, but this IP address belongs to pc1 , which is equivalent to recording the IP address of pc1 into the router. This IP address is the gateway. The subnet mask is the subnet mask of pc1)

Router(config-if)#

Part 4: Change the IP address of the left PC to an assignable IP address of Class A, configure the IP address and subnet mask of the g0/0 port of the router, so that the left and right PCs can communicate.
1. What is the range of IPV4 addresses that can be allocated to g0/0 ports of hosts and routers (192.168.0.2) to (192.168.0.254)?
2. Please select the smallest assignable class A ipv4 address as the address of the left PC (1.0.0.1)? The subnet mask is set to 255.0.0.0.
3. Please reconfigure the IP address of the g0/0 port of the router to the largest ipv4 address (127.255.255.254) that can be allocated in class A, subnet mask 255.0.0.0, and start it.
What is the command to configure the IP address of router g0/0 port ()?
Please use the command format such as ip addr IP address subnet mask, otherwise the score will be affected.
Router(config)#inter g0/0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

Router(config-if)#no ip addr
Router(config-if)#ip addr 127.255.255.254 255.0.0.0

4. What is the default gateway address of the PC on the left (192.168.0.254)?

Guess you like

Origin blog.csdn.net/weixin_68310290/article/details/124274396