4.17 一

news/2024/11/28 11:41:18/

 现有一网络拓扑图如上

要求:①AR1 GE000口用接口DHCP分配IP ②AR1001口用全局DHCP分配IP ③各PC间互通

思路:

①想给PC1、2分配IP需要进入充当DHCP服务器的AR1的000端口配置IP,启用DHCP协议,配置接口地址池并调用。无需配置IP和网关。同时PC1、2基础配置勾选DHCP并应用。

②想给PC34分配IP需要进入AR1的001端口配置IP,启用DHCP协议,配置全局地址池并调用。同时PC3、4基础配置勾选DHCP并应用。

③进入PC1pingPC3和PC4

配置:

①:

AR1 000端口:

<Huawei>system-view    *切换视角*
[Huawei]dhcp enable   *启用DHCP协议*
[Huawei]interface g0/0/0   *进入000端口*
[Huawei-GigabitEthernet0/0/0]ip address 10.1.1.1 24   *配置地址为10.1.1.1掩码为24的IP*
[Huawei-GigabitEthernet0/0/0]dhcp select interface   *激活接口地址池*
[Huawei-GigabitEthernet0/0/0]dhcp server dns-list 8.8.8.8   *配置接口地址池DNS*.1

进入PC1,ipconfig:

PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fe42:5c5e
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 10.1.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 10.1.1.1
Physical address..................: 54-89-98-42-5C-5E
DNS server........................: 8.8.8.8

进入PC2,ipconfig:

PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fefa:75f8
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 10.1.1.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 10.1.1.1
Physical address..................: 54-89-98-FA-75-F8
DNS server........................: 8.8.8.8

②:

AR1 001端口:

<Huawei>system-view    *切换视角*
[Huawei]dhcp enable     *启用DHCP协议*
[Huawei]interface g0/0/1    *进入001端口*
[Huawei-GigabitEthernet0/0/1]ip address 10.1.2.1 24    *配置地址为10.1.2.1掩码为24的IP*
[Huawei-GigabitEthernet0/0/1]ip pool NAME    *创建名为NAME的地址池*
[Huawei-ip-pool-NAME]network 10.1.2.0 mask 24    *配置可分配的IP网段*
[Huawei-ip-pool-NAME]gateway-list 10.1.2.1    *配置网关*
[Huawei-ip-pool-NAME]dns-list 8.8.8.8 114.114.114.114    *配置DNS*
[Huawei-ip-pool-NAME]q    *退出池塘*
[Huawei]interface g0/0/1    *再次进入001端口*
[Huawei-GigabitEthernet0/0/1]dhcp select global    *激活全局配置*

进入PC3,ipconfig:

PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fe17:24ce
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 10.1.2.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 10.1.2.1
Physical address..................: 54-89-98-17-24-CE
DNS server........................: 8.8.8.8
                                    114.114.114.114

进入PC4,ipconfig:

Link local IPv6 address...........: fe80::5689:98ff:feb2:4cf5
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 10.1.2.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 10.1.2.1
Physical address..................: 54-89-98-B2-4C-F5
DNS server........................: 8.8.8.8
                                    114.114.114.114

PC1PINGPC3:

PC>ping 10.1.2.254

Ping 10.1.2.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.1.2.254: bytes=32 seq=2 ttl=127 time=78 ms
From 10.1.2.254: bytes=32 seq=3 ttl=127 time=78 ms
From 10.1.2.254: bytes=32 seq=4 ttl=127 time=63 ms
From 10.1.2.254: bytes=32 seq=5 ttl=127 time=94 ms

--- 10.1.2.254 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/78/94 ms

PC1PINGPC4:

PC>ping 10.1.2.253

Ping 10.1.2.253: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.1.2.253: bytes=32 seq=2 ttl=127 time=62 ms
From 10.1.2.253: bytes=32 seq=3 ttl=127 time=47 ms
From 10.1.2.253: bytes=32 seq=4 ttl=127 time=78 ms
From 10.1.2.253: bytes=32 seq=5 ttl=127 time=78 ms

--- 10.1.2.253 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/66/78 ms


http://www.ppmy.cn/news/535630.html

相关文章

【LeetCode】477. Total Hamming Distance 解题报告(Python C++)

作者&#xff1a; 负雪明烛 id&#xff1a; fuxuemingzhu 个人博客&#xff1a; http://fuxuemingzhu.cn/ 目录 题目描述题目大意解题方法位运算 日期 题目地址&#xff1a;https://leetcode.com/problems/total-hamming-distance/description/ 题目描述 The Hamming distanc…

【Leetcode】477. Total Hamming Distance

方法一&#xff1a; 思路&#xff1a; (1)遍历数组nums&#xff0c;对每一个nums[i]&#xff0c;求其余后面的每一个nums[j]的Hamming Distance。 (2)求x与y的Hamming Distance的方法&#xff1a; ---1)先求x^y的结果res。 ---2)再依次求32位res的每一位与1进行与操作的结…

Codeforces Round #477 C. Stairs and Elevators

Codeforces Round #477 C. Stairs and Elevators 题目链接 题意&#xff1a;给你一栋高n层&#xff0c;每一层由m个部分组成&#xff0c;可以看成是一个矩阵划分成行和列。给你一cl,ce分别表示有个楼梯和电梯&#xff0c;然后给你一个v表示电梯的速度。接下来行表示每个电梯…

[477]tf.reduce_mean()

tf.reduce_mean 函数用于计算张量tensor沿着指定的数轴&#xff08;tensor的某一维度&#xff09;上的的平均值&#xff0c;主要用作降维或者计算tensor&#xff08;图像&#xff09;的平均值。 reduce_mean(input_tensor,axisNone,keep_dimsFalse,nameNone,reduction_indices…

LeetCode_位运算_中等_477.汉明距离总和

目录 1.题目2.思路3.代码实现&#xff08;Java&#xff09; 1.题目 两个整数的汉明距离指的是这两个数字的二进制数对应位不同的数量。 给你一个整数数组 nums&#xff0c;请你计算并返回 nums 中任意两个数之间汉明距离的总和。 示例 1&#xff1a; 输入&#xff1a;nums …

LeetCode | 477. Total Hamming Distance

题目 The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given an integer array nums, return the sum of Hamming distances between all the pairs of the integers in nums. Example 1: Input: n…

【博客477】prometheus-----数值数据编码(varint与zigzag)

prometheus-----数据编码(varint与zigzag) prometheus对数值数据进行编码时&#xff0c;使用到了varint与zigzag varint与zigzag编码方法在protobuf中也被使用 prometheus encoding代码&#xff1a; https://github.com/prometheus/prometheus/blob/main/tsdb/encoding/encodi…

​LeetCode刷题实战477:汉明距离总和

算法的重要性&#xff0c;我就不多说了吧&#xff0c;想去大厂&#xff0c;就必须要经过基础知识和业务逻辑面试算法面试。所以&#xff0c;为了提高大家的算法能力&#xff0c;这个公众号后续每天带大家做一道算法题&#xff0c;题目就从LeetCode上面选 &#xff01; 今天和大…