关于网络:必须收藏华为配置命令手册大全

4次阅读

共计 3130 个字符,预计需要花费 8 分钟才能阅读完成。


  • 配置名称和明码

system-view 进入零碎视图配置

quit 或 return 退出零碎视图模式

sysname 名称 设置主机名

user-interface console 0 进入控制台

authentication-mode password

set authentication password cipher 明码 配置密文明码


  • 配置远程管理 IP 地址

interface vlanif 1 进入 VLAN

ip add 192.168.1.254 24 配置 IP

undo shutdown 开启接口

dns domain 域名 设置域名

dns server 192.168.254.254 设置域名 IP

dis vlan 显示 vlan

save 保留配置

dis curr 显示以后配置

reboot 重启设施

undo terminal monitor 勾销提示信息


  • 配置端口速率、双工、ARP:

int g0/0/1 进入接口

description 内容 端口形容

undo negotiation auto 勾销协商

duplex full 全双工

auto duplex full 主动协商速率

speed 10 速率 10M

auto speed 100 主动协商速率

arp static 192.168.1.8 5489-99cf-2603 绑定 MAC 地址

dis arp 或 dis arp all 查看 ARP


  • 配置接口 IP 和动态路由

int g0/0/1 进入接口

ip add 192.168.1.6 24 配 IP 地址

undo shutdown 开启

dis cur 或 dis cur 查看 ARP

ip route-static 192.168.20.0 24 10.0.12.2 配置动态路由

ip route-static 192.168.10.0 24 serial 0/0/1 端口

ip route-static 0.0.0.0 0 192.168.1.5 默认路由 8 个 0

display ip routing-table 查看路由表


  • 配置 VLAN

vlan 10 创立 vlan 10

description 内容 vlan 形容

vlan batch 30 40 创立多个 vlan 2 to 20

int g0/0/1 进入接口

port link-type access 拜访口

port default vlan 10 退出 vlan

port link-type trunk 干道口

port trunk allow pass vlan 10 20 容许通过

potr turnk allow pass vlan all 所有通过

int e0/0/2 进入接口

port link-type hybrid 混合口模式

undo port default vlan 删除默认 vlan

port hybrid untagged vlan 20 去标签

port hybrid pvid vlan 2 设置默认 vlan

port trunk allow-pass vlan 10 to 100 容许通过不间断用空格(后面加 undo 不容许)

dis port vlan 查看 vlan

display vlan 查看 vlan


  • 配置 VLAN 一致性 GVRP 双向注册

Normal 模式(服务器模式)

gvrp 开启 gvrp 也是默认模式 Fixed 模式(客户机模式)

gvrp registration fixed

Fobbidden 模式(通明模式)

gvrp registration forbidden

dis vlan summary 查看 vlan 汇总

dis gvrp status 查看 gvrp 状态


  • 配置 RIP 协定

rip 启用 RIP 默认 V1

network 192.168.1.0 公布直连网段

version 2 配置 v2 版本

dis rip 查看 rip

dis rip database 查看 rip 数据库

dis ip routing-table 查看路由表

优先级:直连 0、动态 60、rip 100、ospf 10/150


  • 配置 OSPF 协定

ospf 1 启用 OSPF 默认是过程 1

area 0 进入区域 0

network 192.168.3.0 0.0.0.255 公布直连网段

sildent-interface g0/0/2 被动接口只能往外发路由

dis ospf interface 查看 ospf 通告

dis ospf peer 查看 ospf 街坊

dis ip routing-table 查看路由表

dis ospf routing 查看 ospt 路由表


  • 配置基于全局的 DHCP 协定

dhcp enable 开启 dhcp

ip pool 名称 地址池名

network 192.168.1.0 地址池

lease day 2 租约默认为 1

gateway-list 192.168.1.254 网关

excluded-ip-address 192.168.1.250 192.168.1.253 排除 IP 范畴

dns-list 8.8.8.8 DNS 服务器

dhcp select global 基于全局


  • 配置基于接口的 DHCP 协定

dhcp enable 开启 dhcp

int g0/0/1 进入接口

dhcp select interface 基于接口

dhcp server lease day 2 租约默认为 1

dhcp server excluded-ip-address 192.168.1.1 192.168.1.10 排除 IP 范畴

dhcp server dns-list 8.8.8.8 DNS

dis ip pool 查看 dhcp

客户机:主动获取 查看 ipconfig/ifconfig


  • 配置根本 ACL:2000-2999

acl 2000 配置根本 acl

rule 5 permit source 1.1.1.1 0 容许源 IP(留神反掩码 0,默认步长 5)

rule 10 deny any 回绝任意

user-interface vty 0 4 进入接口

acl 2000 inbound 利用 acl

dis acl all 查看所有 acl

dis acl 2000 查看 acl 2000


  • 配置高级 ACL: 3000-3999

acl 3000 配置高级 acl

rule permit ip source 1.1.1.1 0 destination 4.4.4.4 0 容许拜访

user-interface vty 0 4 进入虚构接口

acl 3000 outbound 虚构利用 acl

int g0/0/1 进入物理接口

traffic-filter inbound acl 3000 物理利用 acl

dis acl all 查看所有 acl


  • 配置动静 NAT(多对少)

nat address-group 1 202.169.10.50 202.169.10.60 内部 IP

acl 2001 配置 ACL 抓流量

rule 5 permit source 172.17.1.0 0.0.0.255 外部 IP

int g0/0/01 进入接口

nat outbound 2001 address-group 1 no-pat 利用 NAT 不应用段数转换

dis nat outbound 查看 NAT


  • 配置动态 NAT(一对一)

int g0/0/1 进入接口

nat static global 202.169.10.5 inside 172.16.1.1 一对一转换用于服务器


  • 配置动静 NAPT(多对一)

int g0/0/0 进入接口

nat outbound 2001 多对一转换

dis nat static 查看动态 NAT


  • 配置三层交换机 VLAN 间路由

int vlanif 10 进入接口

ip add 192.168.1.254 24 配 IP

int vlanif 20 进入接口

ip add 192.168.2.254 24 配 IP

dis ip interface brief 接口简略信息

dis port vlan 接口 vlan 信息

dis vlan 查看 vlan 信息


  • 配置单臂路由 VLAN 间通信

ip add 192.168.1.254 24 配置 IP

dot1q termination vid 10 封装

arp broadcast enable 开启 arp

dis ip interface brief 查看接口

dis ip routing-table 查看路由表

display current-configuration 查看配置

戳这里收费下载试听课

关注咱们, 轻松带你搞定网工知识点 + 优良待业内推机会!!!

正文完
 0