常用的命令-之找端口信息基于huawei

--通过ip找到局域网内的接口信息--基于华为的(h3c的映像中类似,貌似更方便点)

1.先看本地终端的IP/MAC

C:\Users\38742>ipconfig /all

Windows IP 配置

   主机名  . . . . . . . . . . . . . : LT0073

   主 DNS 后缀 . . . . . . . . . . . :

   节点类型  . . . . . . . . . . . . : 混合

   IP 路由已启用 . . . . . . . . . . : 否

   WINS 代理已启用 . . . . . . . . . : 否

   DNS 后缀搜索列表  . . . . . . . . : ihlt.com

以太网适配器 Win Adapter:

   媒体状态  . . . . . . . . . . . . : 媒体已断开连接

   连接特定的 DNS 后缀 . . . . . . . :

   描述. . . . . . . . . . . . . . . : TAP-Windows Adapter V9

   物理地址. . . . . . . . . . . . . : 00-FF-4E-3D-CA-E1

   DHCP 已启用 . . . . . . . . . . . : 是

   自动配置已启用. . . . . . . . . . : 是

未知适配器 VPN - VPN Client:

   媒体状态  . . . . . . . . . . . . : 媒体已断开连接

   连接特定的 DNS 后缀 . . . . . . . :

   描述. . . . . . . . . . . . . . . : VPN Client Adapter - VPN

   物理地址. . . . . . . . . . . . . : 5E-8F-BF-13-FA-75

   DHCP 已启用 . . . . . . . . . . . : 是

   自动配置已启用. . . . . . . . . . : 是

以太网适配器 vEthernet (Default Switch):

   连接特定的 DNS 后缀 . . . . . . . :

   描述. . . . . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter

   物理地址. . . . . . . . . . . . . : 00-15-5D-10-10-05

   DHCP 已启用 . . . . . . . . . . . : 否

   自动配置已启用. . . . . . . . . . : 是

   本地链接 IPv6 地址. . . . . . . . : fe80::7a11:4457:ace9:b900%37(首选)

   IPv4 地址 . . . . . . . . . . . . : 172.31.192.1(首选)

   子网掩码  . . . . . . . . . . . . : 255.255.240.0

   默认网关. . . . . . . . . . . . . :

   DHCPv6 IAID . . . . . . . . . . . : 620762461

   DHCPv6 客户端 DUID  . . . . . . . : 00-01-00-01-2B-03-C8-B4-8C-8C-AA-33-5E-68

   TCPIP 上的 NetBIOS  . . . . . . . : 已启用

以太网适配器 以太网:

   连接特定的 DNS 后缀 . . . . . . . : ihlt.com

   描述. . . . . . . . . . . . . . . : Realtek PCIe GbE Family Controller

   物理地址. . . . . . . . . . . . . : 8C-8C-AA-33-5E-68

   DHCP 已启用 . . . . . . . . . . . : 是

   自动配置已启用. . . . . . . . . . : 是

   本地链接 IPv6 地址. . . . . . . . : fe80::262c:bfea:ebcc:96b6%9(首选)

   IPv4 地址 . . . . . . . . . . . . : 10.6.13.27(首选)

   子网掩码  . . . . . . . . . . . . : 255.255.255.0

   获得租约的时间  . . . . . . . . . : Thursday, October 12, 2023 5:08:46 PM

   租约过期的时间  . . . . . . . . . : Thursday, October 12, 2023 6:08:41 PM

   默认网关. . . . . . . . . . . . . : 10.6.13.1

   DHCP 服务器 . . . . . . . . . . . : 10.6.100.12

   DHCPv6 IAID . . . . . . . . . . . : 109874346

   DHCPv6 客户端 DUID  . . . . . . . : 00-01-00-01-2B-03-C8-B4-8C-8C-AA-33-5E-68

   DNS 服务器  . . . . . . . . . . . : 58.22.96.66

                                       218.85.157.99

   主 WINS 服务器  . . . . . . . . . : 10.6.100.10

   辅助 WINS 服务器  . . . . . . . . : 10.6.100.11

   TCPIP 上的 NetBIOS  . . . . . . . : 已启用

2.登录核心交换机,查看终端IP对应的信息

<CORE-ICC>sys

Enter system view, return user view with Ctrl+Z.

[CORE-ICC]dis arp | in 13.27

IP ADDRESS      MAC ADDRESS     EXPIRE(M) TYPE        INTERFACE   VPN-INSTANCE

                                          VLAN/CEVLAN

------------------------------------------------------------------------------

10.6.13.27      8c8c-aa33-5e68  20        D-0         Eth-Trunk2

------------------------------------------------------------------------------

Total:244       Dynamic:231     Static:0     Interface:13  

[CORE-ICC]dis interface Eth-Trunk 2

Eth-Trunk2 current state : UP

Line protocol current state : UP

Description:

Switch Port, Link-type : trunk(configured),

PVID :    1, Hash arithmetic : According to SIP-XOR-DIP,Maximal BW: 2G, Current BW: 2G, The Maximum Frame Length is 9216

IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 845b-1240-15b0

Current system time: 2023-10-12 17:26:53

Last 300 seconds input rate 833320 bits/sec, 467 packets/sec

Last 300 seconds output rate 3780752 bits/sec, 640 packets/sec

Input:  229672659 packets, 73315451694 bytes

  Unicast:                  224997400,  Multicast:                     3001913

  Broadcast:                  1673346,  Jumbo:                               0

  Discard:                          0,  Pause:                               0

  Frames:                           0

  Total Error:                      0

  CRC:                              0,  Giants:                              0

  Jabbers:                          0,  Fragments:                           0

  Runts:                            0,  DropEvents:                          0

  Alignments:                       0,  Symbols:                             0

  Ignoreds:                         0

Output:  310977583 packets, 288596590473 bytes

  Unicast:                  301450287,  Multicast:                     2870136

  Broadcast:                  6657160,  Jumbo:                               0

  Discard:                          0,  Pause:                               0

  Total Error:                      0

  Collisions:                       0,  ExcessiveCollisions:                 0

  Late Collisions:                  0,  Deferreds:                           0

  Buffers Purged:                   0

    Input bandwidth utilization  : 0.04%

    Output bandwidth utilization : 0.19%

-----------------------------------------------------

PortName                      Status      Weight

-----------------------------------------------------

GigabitEthernet2/0/2          UP          1

GigabitEthernet2/0/3          UP          1

-----------------------------------------------------

The Number of Ports in Trunk : 2

The Number of UP Ports in Trunk : 2

[CORE-ICC]DIS LLdp neighbor interface GigabitEthernet 2/0/2

GigabitEthernet2/0/2 has 1 neighbor(s):

Neighbor index :1

Chassis type   :MAC address

Chassis ID     :f4b7-8dee-f28d

Port ID type   :Interface name

Port ID        :GigabitEthernet0/0/51

Port description    :GigabitEthernet0/0/51

System name         :JF3-SW04-10.6.13.14

System description  :Huawei Switch S5735S-L48T4S-A

Huawei Versatile Routing Platform Software

VRP (R) software, Version 5.170 (S5735 V200R019C10SPC500)

Copyright (C) 2000-2020 HUAWEI TECH Co., Ltd.

System capabilities supported   :bridge router

System capabilities enabled     :bridge router

Management address type  :ipv4

Management address value :10.6.13.14

OID  :0.6.15.43.6.1.4.1.2011.5.25.41.1.2.1.1.1. 

Expired time   :108s

Port VLAN ID(PVID)  :1

VLAN name of VLAN  1:VLAN 0001

Auto-negotiation supported    :Yes

Auto-negotiation enabled      :Yes       

OperMau   :speed(1000)/duplex(Full)

Power port class            :PD

PSE power supported         :No

PSE power enabled           :No

PSE pairs control ability   :No

Power pairs                 :Unknown

Port power classification   :Unknown

Link aggregation supported:Yes

Link aggregation enabled :Yes

Aggregation port ID      :2

Maximum frame Size       :10240

[CORE-ICC]

3.登录接入层交换机10.6.13.14,按mac找对应的端口

[JF3-SW04-10.6.13.14]dis mac-address | in 8c8c-aa33-5e68

-------------------------------------------------------------------------------

MAC Address    VLAN/VSI/BD                       Learned-From        Type     

-------------------------------------------------------------------------------

8c8c-aa33-5e68 13/-/-                            Eth-Trunk4          dynamic  

-------------------------------------------------------------------------------

Total items displayed = 179

[JF3-SW04-10.6.13.14]

[JF3-SW04-10.6.13.14]dis interface Eth-Trunk 4

Eth-Trunk4 current state : UP

Line protocol current state : UP

Description:

Switch Port, Link-type : trunk(configured),

PVID :    1, Hash arithmetic : According to SIP-XOR-DIP,Maximal BW: 2G, Current BW: 2G, The Maximum Frame Length is 10240

IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is f4b7-8dee-f28d

Current system time: 2023-05-28 06:31:51

Last 300 seconds input rate 1434248 bits/sec, 580 packets/sec

Last 300 seconds output rate 5854360 bits/sec, 822 packets/sec

Input:  227182579 packets, 70778420256 bytes

  Unicast:                  222610065,  Multicast:                     3024158

  Broadcast:                  1548356,  Jumbo:                         3991903

  Discard:                          0,  Pause:                               0

  Frames:                           0

  Total Error:                      0

  CRC:                              0,  Giants:                              0

  Runts:                            0,  DropEvents:                          0

  Alignments:                       0,  Symbols:                             0

  Ignoreds:                         0

Output:  307959577 packets, 284762156201 bytes

  Unicast:                  298240622,  Multicast:                     2928244

  Broadcast:                  6790711,  Jumbo:                        87273653

  Discard:                          0,  Pause:                               0

  Total Error:                      0

  Collisions:                       0,  Late Collisions:                     0

  Deferreds:                        0

    Input bandwidth utilization  : 0.07%

    Output bandwidth utilization : 0.29%

-----------------------------------------------------

PortName                      Status      Weight

-----------------------------------------------------

GigabitEthernet0/0/47         UP          1

GigabitEthernet0/0/48         UP          1

-----------------------------------------------------

The Number of Ports in Trunk : 2

The Number of UP Ports in Trunk : 2

[JF3-SW04-10.6.13.14]

[JF3-SW04-10.6.13.14]dis lldp neighbor interface GigabitEthernet 0/0/47

GigabitEthernet0/0/47 has 1 neighbor(s):

Neighbor index :1

Chassis type   :MAC address

Chassis ID     :f4b7-8dee-f2d5

Port ID type   :Interface name

Port ID        :GigabitEthernet0/0/47

Port description    :GigabitEthernet0/0/47

System name         :JF3-SW03-10.6.13.13

System description  :Huawei Switch S5735S-L48T4S-A

Huawei Versatile Routing Platform Software

VRP (R) software, Version 5.170 (S5735 V200R019C10SPC500)

Copyright (C) 2000-2020 HUAWEI TECH Co., Ltd.

System capabilities supported   :bridge router

System capabilities enabled     :bridge router

Management address type  :ipv4

Management address value :10.6.13.13

OID  :0.6.15.43.6.1.4.1.2011.5.25.41.1.2.1.1.1. 

Expired time   :116s

Port VLAN ID(PVID)  :1

VLAN name of VLAN  1:VLAN 0001

Auto-negotiation supported    :Yes

Auto-negotiation enabled      :Yes       

OperMau   :speed(1000)/duplex(Full)

Power port class            :PD

PSE power supported         :No

PSE power enabled           :No

PSE pairs control ability   :No

Power pairs                 :Unknown

Port power classification   :Unknown

Link aggregation supported:Yes

Link aggregation enabled :Yes

Aggregation port ID      :4

Maximum frame Size       :10240

[JF3-SW04-10.6.13.14]

4.进入对应的末端交换机10.6.13.13(即可修改所需的目的vlan)

[JF3-SW03-10.6.13.13]dis mac-address | in 5e68

-------------------------------------------------------------------------------

MAC Address    VLAN/VSI/BD                       Learned-From        Type     

-------------------------------------------------------------------------------

8c8c-aa33-5e68 13/-/-                            GE0/0/13            dynamic  

-------------------------------------------------------------------------------

Total items displayed = 175

[JF3-SW03-10.6.13.13]interface GigabitEthernet 0/0/13

[JF3-SW03-10.6.13.13-GigabitEthernet0/0/13]dis this

#

interface GigabitEthernet0/0/13

 description 3W78

 port default vlan 13

#

return

[JF3-SW03-10.6.13.13-GigabitEthernet0/0/13]

[JF3-SW03-10.6.13.13-GigabitEthernet0/0/13]port defaul vlan 999

[JF3-SW03-10.6.13.13-GigabitEthernet0/0/13]description --D54--

Ps:此交换机做了ACL登录限制,以下IP可以telnet登录,必须事先知晓

#

acl number 2000

 rule 0 permit source 10.6.100.27 0

 rule 1 permit source 10.6.16.36 0

 rule 2 permit source 10.6.16.125 0

 rule 3 permit source 10.6.16.89 0

 rule 4 permit source 10.6.16.16 0

 rule 5 permit source 10.6.116.165 0     

 rule 99 deny

#

user-interface con 0

 authentication-mode none

user-interface vty 0 4

 acl 2000 inbound

 authentication-mode aaa

5.验证测试

Ipconfig /all

Ethernet adapter 以太网:

   Connection-specific DNS Suffix  . :

   Description . . . . . . . . . . . : Realtek PCIe GbE Family Controller

   Physical Address. . . . . . . . . : 8C-8C-AA-33-5E-68

   DHCP Enabled. . . . . . . . . . . : Yes

   Autoconfiguration Enabled . . . . : Yes

   Link-local IPv6 Address . . . . . : fe80::262c:bfea:ebcc:96b6%9(Preferred)

   IPv4 Address. . . . . . . . . . . : 192.168.1.3(Preferred)

   Subnet Mask . . . . . . . . . . . : 255.255.255.0

   Lease Obtained. . . . . . . . . . : Thursday, October 12, 2023 5:39:45 PM

   Lease Expires . . . . . . . . . . : Friday, October 13, 2023 5:39:37 PM

   Default Gateway . . . . . . . . . : 192.168.1.1

   DHCP Server . . . . . . . . . . . : 192.168.1.1

   DHCPv6 IAID . . . . . . . . . . . : 109874346

   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2B-03-C8-B4-8C-8C-AA-33-5E-68

   DNS Servers . . . . . . . . . . . : fe80::1%9

                                       58.22.96.66

                                       218.85.157.99

   NetBIOS over Tcpip. . . . . . . . : Enabled

--基于cisco体系的查找,CDP命令更强大--

下次看到之前的工作记录贴上来。

--一个比较完整的局域网架构应该考虑到的问题:--

自己曾在benz五年的工作经历,从老外那边(德国先进的工业制造的理念——流程化和世界大厂的顾问,如cisco、mircosoft、sap、ibm等)学习到的一些架构设计的原理,自己写电出来。

以我曾呆过的整车制造业(主机厂)的网络设计,稍微总结下,逻辑跟着实际适用走。

0.benz的组网分了办公网和生产网;按组网媒介接入,又有高速1G/10G有线局域网和无线接入网;无线网按功能需求释放不同的SSID,如guest、office、plus、warehouse等;功能区域划分为综合办公楼、生产区域(焊装、涂装、总装、物流)、R&D研发中心、出车厂等。

1.局域网组网架构,采用经典的三层网络拓扑(核心-汇聚-接入),核心下辖5大汇聚区域(综合办公、生产区、研发中心、数据中心、研发2),其中生产区域和办公区域逻辑隔离,无线网guest由独立的互联网线路释放,和局域网内部强隔离。

2.出口为电信、联通互联网企业专线,搭配MSTP电路等专线,其中有连至总部斯图加特的链路,有连至研发2的,还有ADSL下行1000M的资源.

3.端口映射表(很重要),此条适用于很多vlan的情况下,且交换机数量巨大(benz我当初管理了200多台48口的接入层设备)

包含设备管理IP、端口编号、接口捆绑信息、VLAN信息、对端设备信息等

4.光纤映射表(复用链路使用时候很重要),ps,benz建厂初期,同一建筑楼接入数据机房的管网具有两路(防止破路和改造,同时光纤按1:1冗余扩展)

光纤常用的接口:LC-SC,LC-LC;

室外单模光纤、室内单模光纤、多模光纤(OM3)、光衰

5.SNMP管理规模的交换机设备,智能识别top连接,同时监控光纤链路状态。

6.局域网准入的控制

<think>好的,用户需要查华为设备上基于端口的DHCP配置命令。首先,我需要回忆一下之前提供的引用内容,看看是否有相关的配置步骤。 根据引用[3],里面有提到在接口模式下使用`dhcp select relay`命令,同时还需要创建一个DHCP服务组并指定服务器的IP地址。不过用户问的是基于端口的配置,可能更偏向于DHCP服务器直接绑定到接口的情况,而不是中继模式。 再看引用[1],里面明确提到了`dhcp select interface`命令,这是开启基于接口的DHCP服务器功能,应该就是用户需要的端口配置。同时,引用[4]提到静态绑定IP和MAC地址的命令,这也是基于接口配置的一部分。 引用[5]指出华为路由器可以作为DHCP服务器,这进一步确认了配置的可能性。因此,正确的步骤应该是在接口模式下启用DHCP接口模式,并配置地址池等相关参数。可能还需要排除地址和设置租期,如`dhcp server excluded-ip-address`和`dhcp server lease`命令。 需要确保用户清楚每个步骤的作用,比如`dhcp select interface`的作用是启用接口地址池,然后配置排除的IP和租期。同时,静态绑定部分如果用户有需求,也需要提供对应命令。此外,需要提醒用户全局启用DHCP功能,这在引用[3]中提到过`dhcp enable`命令。 用户的问题可能涉及基础配置,所以分步骤说明会更清晰。还要注意命令的正确顺序,先进入接口模式,再执行相关配置。最后,验证配置是否成功的方法,比如客户端获取IP,也是有用的信息。</think>### 华为设备基于端口的DHCP配置命令详解 #### 1. **基础配置流程** 在华为设备上,基于接口(端口)的DHCP配置主要通过以下步骤实现: - **全局启用DHCP服务** 需先在系统视图下执行`dhcp enable`命令激活DHCP功能[^3][^5]。 ```shell <Huawei> system-view [Huawei] dhcp enable ``` - **进入接口视图并绑定接口地址池** 在目标接口(如GigabitEthernet0/0/0)下配置`dhcp select interface`,表示该接口使用本地接口地址池分配IP地址[^1]。 ```shell [Huawei] interface GigabitEthernet 0/0/0 [Huawei-GigabitEthernet0/0/0] dhcp select interface ``` - **配置IP地址与地址池参数** 需为接口分配IP地址,并设置地址池范围(通过掩码隐式定义): ```shell [Huawei-GigabitEthernet0/0/0] ip address 192.168.1.1 24 [Huawei-GigabitEthernet0/0/0] dhcp server excluded-ip-address 192.168.1.1 # 排除网关地址 [Huawei-GigabitEthernet0/0/0] dhcp server lease day 3 # 设置租期为3天 ``` #### 2. **高级功能扩展** - **静态IP绑定MAC地址** 若需为特定设备固定IP地址,可使用静态绑定命令[^4]: ```shell [Huawei-GigabitEthernet0/0/0] dhcp server static-bind ip-address 192.168.1.100 mac-address 5489-9877-2e68 ``` - **配置DNS与网关** 通过`dhcp server dns-list`和`dhcp server gateway-list`提供附加网络参数: ```shell [Huawei-GigabitEthernet0/0/0] dhcp server dns-list 8.8.8.8 [Huawei-GigabitEthernet0/0/0] dhcp server gateway-list 192.168.1.1 ``` #### 3. **验证配置** - 查看地址池分配状态: ```shell [Huawei] display dhcp server interface GigabitEthernet 0/0/0 ``` - 检查租约信息: ```shell [Huawei] display dhcp server lease ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一个在高校打杂的

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值