要给华为交换机端口添加IP,需要使用以下命令:

1. 进入全局配置模式:
sys
2. 进入交换机端口配置模式:
interface [接口类型] [接口编号]
例如:
interface GigabitEthernet 0/0/1
3. 启用端口:
port link-type access
4. 配置IP地址:
ip address [IP地址] [子网掩码长度]
例如:
ip address 192.168.1.1 24
5. 保存配置:
save
6. 退出配置模式:
quit
这样,就成功给华为交换机的端口添加了IP地址。