华为交换机配置详细步骤 华为交换机配置命令大全

华为交换机基本命令
1.Ssh:
interface MEth0/0/1
ip address 192.168.90.92 255.255.255.0
ip route-static 0.0.0.0 0.0.0.0 192.168.90.254
stelnet server enable
Aaa
local-user admin password
local-user admin privilege level 15
local-user admin service-type ssh
user-interface vty 0 4
authentication-mode aaa

  1. System name:
Sysname test
  1. Clock&time:
[ ]:
clock timezone beijing add 8:00:00
<test >
clock datetime 10:16:30 2021-07-30
  1. Vlan:
批量建 vlan:
vlan batch 100 200 300 400 500
Vlan batch 10 to 50
  1. Trunk:
port link-type trunk
【华为交换机配置详细步骤 华为交换机配置命令大全】 port trunk allow-pass vlan all
  1. 开关端口:
Shutdown
Undo shutdown
  1. L2/L3 端口模式:
Portswitch 二层端口
Undo portswitch 三层端口
  1. 指定端口工作模式和速率:
undo negotiation auto
speed 100
duplex half
Spantree:
stp mode rstp
  1. 端口捆绑:
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan all
load-balance src-dst-mac
Mode lacp
Int g0/0/45
Eth-trunk 1
Int g0/0/46
Eth-trunk 1
  1. ospf
ospf 1
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 172.16.1.0 0.0.0.3
  1. 端口镜像
observe-port 1 interface Eth-Trunk1
interface GigabitEthernet0/0/20
port-mirroring to observe-port 1 all
  1. vrrp
interface Vlanif2
ip address 2.2.2.2 255.255.255.0
vrrp vrid 1 virtual-ip 2.2.2.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 30
  1. bfd
本端:bfd 1 bind peer-ip 1.1.1.2 source-ip 1.1.1.1 auto
对端:bfd 1 bind peer-ip 1.1.1.1 source-ip 1.1.1.2 auto
与 vrrp 联动:
vrrp vrid 1 track bfd-session session-name 1 reduced 50
与静态路由联动:
ip route-static 3.3.3.0 255.255.255.0 1.1.1.2 track bfd-session 1
#bfd 进程 shutdown,相应的静态路由将被删除
  1. 重启
reboot
  1. Clear 接口配置
Clear configuration interface g0/0/45
或在接口下:clear configuration this
  1. 恢复出厂配置
reset factory-configuration
  1. Backup 配置文件
dir 查看 flash:所有文件
tftp 192.168.63.130 put flash:/vrpcfg.zip
  1. Stack
Switch A(主):
Stack slot 0 priority 200
Interface stack-port 0/1
Port interface xg0/0/4 enable
Switch B(备):
Stack slot 0 renumber 1
Interface stack-port 0/2
Port interface xg0/0/4 eanble
*配置完后两台交换机关电,连接好堆叠线后加电重启
  1. 密码恢复
通过 Console 口连接交换机
重启交换机,看到 Ctrl+B 提示时,快速按 Ctrl+B 进入 BootLoader 菜单,输入初始密码:Admin@huawei.com
选择”Clear the console login password”
重启并重新配置 console 密码
  1. 批量配置端口
int rang g0/0/3 to g0/0/10
Portswitch
Port link-type access
Port default vlan 2
  1. 组播
multicast routing-enable 开且组播功能
Igmp
version 2 配置 igmp 版本号
Pim
static-rp 2.2.2.2 配置静态 rp
Pim sm 配置组播模式
  1. 静态路由
ip route-static 0.0.0.0 0.0.0.0 192.168.90.254

    推荐阅读