HCIA ENSP uses +DHCP+Telnet

1. ENSP configuration steps

2. DHCP

1. DHCP–Dynamic Host Configuration Protocol

2. The working process of DHCP

3. DHCP lease

4. DHCP configuration

3. Telnet service

1. Enter aaa to enter the system view

2. Create user and user password

3. Set the user as telnet service

4. Limit the number of remote login devices

4. DHCP + Telnet experiment

?1. Router configuration IP address

2. Configure DHCP service

3. Enter the corresponding interface to activate the configuration of the global pond

4. PC set DHCP to obtain IP address and use ipconfig command to check

5. Verify whether there is access between PCs

6. Use the Client emulator to visit the www.haha.com website

7. Configure Telnet service (remote login service)

1. ENSP configuration steps

1. Look at the broadcast domain — look at the interface of the router

2. Assign network segments

3. Configure IP address—configure IP address for all nodes that need to configure IP address

4. Huawei supports command abbreviation and auto-completion configuration — use the TAB key — can auto-completion

5. Common commands

View all configurations made by the device

display current-configuration

View the location, some commands with

display this

To delete the configuration, add an UNDO before the original configuration command

undo + command

Second, DHCP

1, DHCP- – Dynamic Host Configuration Protocol

C/S Architecture Protocol ===> Client/Server Architecture Protocol

Use UDP for transmission–port number 67 68

C-Client: It is a client–a device that wants to obtain an address through DHCP Port: 68

S-Server: Server–the device that sends the address Port: 67

2, the working process of DHCP< /strong>

①The first scenario: The PC acquires an IP address for the first time.

DHCP–Discover Discovery Packet–is sent by the client to the server—the client broadcasts and sends data packets.

The composition of the Discover package:

Source port: 68 Destination port: 67 –Transport layer

Source IP: 0.0.0.0 (indicating that the client has no IP) Destination IP: 255.255.255.255 (broadcast) — network layer

Source MAC: PC1 Destination MAC: FF-FF..FF — Data Link Layer

DHCP–Offer packet–The server carries an IP address data packet and replies to the client.

Distinguish vendors: Huawei for unicast, Cisco for broadcast

Offer package structure:

Source port: 67 Destination port: 68 –Transport layer

Source IP: the IP address of the server Destination IP: the IP address to be delivered–network layer

Source MAC: MAC of the server itself Destination MAC: PC1–data link layer

When there are multiple DHCP servers in the network, there will be multiple Offer packets

DHCP-Request request packet–The client sends a request to the server–Broadcast sending

When the client receives multiple Offers, it will make a selection and select the IP address carried in the Offer package received first.

The composition of the Request package:

Source port: 68 Destination port: 67

Source IP: 0.0.0.0 Destination IP: 255.255.255.255

Source MAC: PC1 Destination MAC: FF-FF..FF

DHCP-ACK confirmation packet–the data packet sent by the server to the client

According to the equipment of different manufacturers, it can perform unicast or broadcast

The composition of the ACK packet:

Source port: 67 Destination port: 68

Source IP: server Destination IP: issued IP address

Source MAC: Server Destination MAC: Client

②The second scenario: PC (client) obtains IP address again

The PC has the function of storing memory.

Within a certain period of time, if the PC wants to obtain the IP address again, repeat the process of three or four in the first scenario

DHCP-Request request packet–the client sends a request to the server–unicast sending

When the client receives multiple Offers, it will make a selection and select the IP address carried in the Offer package received first.

The composition of the Request package:

Source port: 68 Destination port: 67

Source IP: IP address obtained before Destination IP: IP address of the server

Source MAC: PC1 Destination MAC: Server

DHCP-ACK confirmation packet–the data packet sent by the server to the client

According to the equipment of different manufacturers, it can perform unicast or broadcast

The composition of the ACK packet:

Source port: 67 Destination port: 68

Source IP: server Destination IP: issued IP address

Source MAC: Server Destination MAC: Client

DHCP–NAK packet-the server’s rejection response message to the client’s DHCP Request packet

DHCP–relize–release IP

3, DHCP lease term

Start timing from the IP address issued, default 24 hours (1 day)

T1–50% of the default lease period, which is 12 hours

T2–87.5% of the default lease period, which is 21 hours

DHCP has a lease renewal behavior. When the time comes to the T1 time node, send a lease renewal request packet to the server, and the server will reply with an ACK packet when it receives it, and then the PC will refresh the lease period for 24 hours–unicast.

When the time comes to the T2 time node, the PC broadcasts and sends a Request packet carrying the currently used IP address, and the server replies with an ACK packet when it sees it, and then the PC refreshes the lease time to 24 hours.

If none of the above two types of lease renewal requests the use of an IP address, you need to use the first scenario to obtain an IP address.

4, DHCP configuration

① Start DHCP service

[r1] dhcp enable

② Create an address pool aaa (as many address pools as there are broadcast domains)

[r1] ip pool aaa

③ Announce the address range for delivery

[r1-ip-pool-aaa] network 192.168.1.0 mask 24

④ Send gateway information

[r1-ip-pool-aaa] gateway-list 192.168.1.1

⑤ Send DNS server information

[r1-ip-pool-aaa]dns-list 8.8.8.8 114.114.144.114

Note: These two IPs are the IP addresses of open source domain name resolution servers

⑥ Enter the interface to select DHCP service

[r1]int g0/0/0

[r1-GigabitEthernet0/0/0] dhcp select global

Third, Telnet service

1. Enter aaa to enter the system view

[r1]aaa

[r1-aaa]

2. Create user and user password

[r1-aaa]local-user username privilege level user privilege level password cipher password

Note: There are 16 user levels from 0 to 15

3. Set user as telnet service

[r1-aaa]local-user a1 service-type telnet

4. Limit the number of remote login devices

[r1-aaa]q

[r1]user-interface vty 0 4 Here is a limit of 5

5. Account and password bound to aaa space

[r1-ui-vty0-4] authentication-mode aaa

Fourth, DHCP+Telnet experiment

Use the DHCP service to provide dynamic IP distribution for the host, there is a DNS server and HTTP server, the client can access the website www.haha.com through the domain name, and use the router R2 to remotely log in to R1. As shown below

1. router configuration IP address

R1:

<Huawei>system-view
[Huawei] sysname r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
[r1-GigabitEthernet0/0/1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip address 192.168.5.1 24

Telnet client:

<Huawei>system-view
[Huawei]sysname Telnet
[Telnet]int g0/0/0
[Telnet-GigabitEthernet0/0/0]ip address 192.168.1.1 24

2. Configure DHCP service

[r1]dhcp enable
[r1]ip pool aaa #create pond aaa
[r1-ip-pool-aaa] network 192.168.1.0 mask 24
[r1-ip-pool-aaa] gateway-list 192.168.1.1
[r1-ip-pool-aaa]dns-list 8.8.8.8 114.114.144.114
[r1]ip pool bbb #create pond bbb
[r1-ip-pool-bbb] network 192.168.2.0 mask 24
[r1-ip-pool-bbb] gateway-list 192.168.2.1
[r1-ip-pool-bbb]dns-list 8.8.8.8 114.114.114.114

3. Enter the corresponding interface to activate the configuration of the global pond

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0] dhcp select global
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]dhcp select global

4. Use the ipconfig command to view the PC setting DHCP to obtain the IP address

other PCs in turn Use this method.

5. Verify whether PCs are accessible

Here is a demonstration, first check the IP address of PC4, and use PC2 to Ping to check whether it is connected. Other PCs are This method can be used to check whether the connection

6. Configure HTTP server and DNS server

HTTP server

DNS server

Note: The DHCP server is set up here. These devices should be able to dynamically obtain information such as IP addresses, but the emulator does not support dynamic acquisition. Only an unused IP address and other information in the broadcast domain are statically configured.

6. Use the Client emulator to visit the www.haha.com website

Because the PC in the emulator does not support access to web pages, the Client emulator is used to access, and the emulator does not support dynamic acquisition, so it is also necessary to statically configure an unused IP address and other information in the broadcast domain.

7. Configure Telnet service (remote login service)

[r1]aaa
[r1-aaa]local-user fzw privilege level 15 password cipher 123456
[r1-aaa]local-user fzw service-type telnet
[r1-aaa]q
[r1] user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa

Use Telnet to remotely log in to R1–telnet 192.168.5.1

syntaxbug.com © 2021 All Rights Reserved.