admin 管理员组文章数量: 1087135
2024年5月19日发(作者:fadetop 使用技巧)
华为交换机基本配置命令,附三大品牌命令对比表
前言:
最近一直有读者咨询有关于交换机配置命令的汇总有没有,我们从事弱电集成工作,会一
些简单的交换机配置还是有必要的,想深入学习的话,还是要偏向于网络工程师了。
正文:
一、单交换机VLAN划分
命令 命令解释
system 进入系统视图
system-view 进入系统视图
quit 退到系统视图
undo vlan 20 删除vlan 20
sysname 交换机命名
disp vlan 显示vlan
vlan 20 创建vlan(也可进入vlan 20)
port e1/0/1 to e1/0/5 把端口1-5放入VLAN 20 中
5700系列
单个端口放入VLAN
[Huawei]int g0/0/1
[Huawei]port link-type access (注:接口类型access,hybrid、trunk)
[Huawei]port default vlan 10
批量端口放入VLAN
[Huawei]port-group 1
[Huawei-port-group-1]group-member ethernet G0/0/1 to ethernetG0/0/20
[Huawei-port-group-1]port hybrid untagged vlan 3
删除group(组)vlan 200内的15端口
[Huawei]int g0/0/15
[Huawei-GigabitEthernet0/0/15]undo port hybrid untagged vlan 200
通过group端口限速设置
[Huawei]Port-group 2
[Huawei]group-member g0/0/2 to g0/0/23
[Huawei]qos lr outbound cir 2000 cbs 20000
disp vlan 20 显示vlan里的端口20
int e1/0/24 进入端口24
undo port e1/0/10 表示删除当前VLAN端口10
disp curr 显示当前配置
return 返回
Save 保存
info-center source DS channel 0 log state off trap stateoff
模块来实现(关闭配置后的确认信息显示)
通过关闭日志信息命令改变DS
info-center source DS channel 0 log state on trap stateon 通过打开日志信息命令改变DS
模块来实现(打开配置后的确认信息显示)
二、配置交换机支持TELNE
system 进入系统视图
sysname 交换机命名
int vlan 1 进入VLAN 1
ip address 192.168.3.100 255.255.255.0 配置IP地址
user-int vty 0 4 进入虚拟终端
authentication-mode password (aut password) 设置口令模式
set authentication password simple 222 (set aut pass sim 222) 设置口令
user privilege level 3(use priv lev 3) 配置用户级别
disp current-configuration (disp cur) 查看当前配置
disp ip int 查看交换机VLAN IP配置
删除配置必须退到用户模式
reset saved-configuration(reset saved) 删除配置
Reboot 重启交换机
三、跨交换机VLAN的通讯
在sw1上:
vlan 10 建立VLAN 10
int e1/0/5 进入端口5
port access vlan 10 把端口5加入vlan 10
vlan 20 建立VLAN 20
int e1/0/15 进入端口15
port access vlan 20 把端口15加入VLAN 20
int e1/0/24 进入端口24
port link-type trunk 把24端口设为TRUNK端口
port trunk permit vlan all 同上
在SW2上:
vlan 10 建立VLAN 10
int e1/0/20 进入端口20
port access vlan 10 把端口20放入VLAN 10
int e1/0/24 进入端口24
port link-type trunk 把24端口设为TRUNK端口
port trunk permit vlan all (port trunk permit vlan
VLAN使用
disp int e1/0/24 查看端口24是否为TRUNK
undo port trunk permit vlan all 删除该句
四、路由的配置命令
system 进入系统模式
只能为vlan 使用)24端口为所有10 10
sysname 命名
int e1/0 进入端口
ip address 192.168.3.100 255.255.255.0 设置IP
undo shutdown 打开端口
disp ip int e1/0 查看IP接口情况
disp ip int brief 查看IP接口情况
user-int vty 0 4 进入口令模式
authentication-mode password(auth pass) 进入口令模式
set authentication password simple 222 37 设置口令
user privilege level 3 进入3级特权
save 保存配置
reset saved-configuration 删除配置(用户模式下运行)
undo shutdown 配置远程登陆密码
int e1/4
ip route 192.168.3.0(目标网段) 255.255.255.0 192.168.12.1(下一跳:下一路由器的接口)
静态路由
ip route 0.0.0.0 0.0.0.0 192.168.12.1 默认路由
disp ip rout 显示路由列表
华3C AR-18
E1/0(lan1-lan4)
E2/0(wan0)
E3/0(WAN1)
路由器连接使用直通线。wan0接wan0或wan1接wan1
计算机的网关应设为路由器的接口地址。
五、三层交换机配置VLAN-VLAN通讯
sw1(三层交换机):
system 进入视图
sysname 命名
vlan 10 建立VLAN 10
vlan 20 建立VLAN 20
int e1/0/20 进入端口20
port access vlan 10 把端口20放入VLAN 10
int e1/0/24 进入24端口
port link-type trunk 把24端口设为TRUNK端口
port trunk permit vlan all (port trunk permit vlan
VLAN使用
sw2:
vlan 10
int e1/0/5
只能为vlan 使用)24端口为所有10 10
port access vlan 10
int e1/0/24
port link-type trunk 把24端口设为TRUNK端口
port trunk permit vlan all (port trunk permit vlan 10 只能为vlan 10使用)24端口为所有
VLAN使用
sw1(三层交换机):
int vlan 10 创建虚拟接口VLAN 10
ip address 192.168.10.254 255.255.255.0 设置虚拟接口VLAN 10的地址
int vlan 20 创建虚拟接口VLAN 20
ip address 192.168.20.254 255.255.255.0 设置虚拟接口IP VLAN 20的地址
注意:vlan 10里的计算机的网关设为 192.168.10.254
vlan 20里的计算机的网关设为 192.168.20.254
六、动态路由RIP
R1:
int e1/0 进入e1/0端口
ip address 192.168.3.1 255.255.255.0 设置IP
int e2/0 进入e2/0端口
ip adress 192.168.5.1 255.255.255.0 设置IP
rip 设置动态路由
network 192.168.5.0 定义IP
network 192.168.3.0 定义IP
disp ip rout 查看路由接口
R2:
int e1/0 进入e1/0端口
ip address 192.168.4.1 255.255.255.0 设置IP
int e2/0 进入e2/0端口
ip adress 192.168.5.2 255.255.255.0 设置IP
rip 设置动态路由
network 192.168.5.0 定义IP
network 192.168.4.0 定义IP
disp ip rout 查看路由接口
(注意:两台PC机的网关设置PC1 IP:
七、IP访问列表
int e1/0
ip address 192.168.3.1 255.255.255.0
int e2/0
ip address 192.168.1.1 255.255.255.0
int e3/0
ip address 192.168.2.1 255.255.255.0
:)192.168.3.1PC2 IP192.168.4.1
acl number 2001 (2001-2999属于基本的访问列表)
rule 1 deny source 192.168.1.0 0.0.0.255 (拒绝地址192.168.1.0网段的数据通过)
rule 2 permit source 192.168.3.0 0.0.0.255(允许地址192.168.3.0网段的数据通过)
以下是把访问控制列表在接口下应用:
firewall enable
firewall default permit
int e3/0
firewall packet-filter 2001 outbound
disp acl 2001 显示信息
undo acl number 2001 删除2001控制列表
扩展访问控制列表
acl number 3001
rule deny tcp source 192.168.3.0 0.0.0.255 destination 192.168.2.00.0.0.255 destination-port
eq ftp
必须在r-acl-adv-3001下才能执行
rule permit ip source an destination any (rule permit ip)
int e3/0
firewall enable 开启防火墙
firewall packet-filter 3001 inbound
必须在端口E3/0下才能执行
八、华为/思科/华三交换机配置命令
华为/思科/华三交换机配置命令有些分不清楚,这里对三者配置命令做了个汇总对比,希望对
大家有所帮助。
CISCO
H3C
HUAWEI
描述
no
show
exit
hostname
en, config terminal
delete
reload
write
username
shutdown
show version
undo
display
quit
sysname
system-view
delete
reboot
save
local-user
shutdown
display version
undo
display
quit
sysname
system-view
delete
reboot
save
local-user
shutdown
display version
取消、关闭当前设置
显示查看
退回上级
设置主机名
进入全局模式
删除文件
重启
保存当前配置
创建用户
禁止、关闭 端口
显示当前系统版本
查看已保存过的配置 show startup-config display saved-configuradisplay saved-configuratio
tion n
show running-config
display current-configurdisplay current-configurati
ation
ctrl+d
reset saved-configuratio
n
return
logout
info-center
user-interface
saved-configuration
current-configuration
on
ctrl+d
显示当前配置
no debug all 取消所有debug命令
erase startup-config reset saved-configuration 删除配置
end
exit
logging
line
start-config
running-config
return
logout
info-center
user-interface
saved-configuration
current-configuration
退到用户视图
登出
指定信息中心配置信息
进入线路配置(用户接口)模式
启动配置
当前配置
host ip host ip host host名字和ip地址对应
交换部分
enable password
set authentication passset authentication passwo
word simple rd simple
interface type/number
interface vlan 1
interface ethID to ID
super password
duplex (half|full|auto)
speed (10/100/1000)
配置明文密码
interface type/number interface type/number
interface vlan 1
interface rang
enabl esecret
duplex (half|full|auto)
speed (10/100/1000)
switchport mode trun
k
interface vlan 1
interface ethID to ID
super password
duplex (half|full|auto)
speed (10/100/1000)
进入接口
进入vlan配置vlan管理地址
定义多个端口的组
设置特权口令
配置接口状态
配置端口速率
port link-type trunk port link-type trunk 配置trunk
vlan ID /no vlan ID
vlan batch ID /undo vlavlan batch ID /undo vlan
n batch ID batch ID
添加、删除vlan
switchport access vla
n
show interface
show vlan ID
encapsulation
port default vlan ID port acces vlan ID 将端口接入vlan
display interface
display vlan ID
link-protocol
display interface
display vlan ID
link-protocol
查看接口
查看vlan
封装协议
channel-group 1 modport link-aggregation gport link-aggregation gro
e on
ip routing
no switchport
roup 1
默认开启
不支持
up 1
默认开启
不支持
链路聚合
开启三层交换的路由功能
开启接口三层功能
对跨以太网交换机的VLAN进行动态注
册和删除
vtp domain GVRP GVRP
spanning-tree vlan IDstp instance id root pristp instance id root prima
root primary
spanning-tree vlan ID
priority
show spanning-tree
mary ry
stp配置根网桥
stp primary vlaue stp primary vlaue 配置网桥优先级
dis stp brief dis stp brief 查看STP配置
路由部分
ip route 0.0.0.0 route-static 0.0.0.0 route-static 0.0.0.0 0.0.
0 0.0.0 0.0
配置默认路由
ip route 目标网段+掩ip route-static 目标网段+ip route-static 目标网段+掩
码 下一跳
show ip route
router rip /network 网
段
掩码 下一跳 码 下一跳
配置静态路由
display ip routing-table display ip routing-table 查看路由表
rip /network 网段 rip /network 网段 启用rip、并宣告网段
router ospf
network ip 反码 area
no auto-summary
show ip protocol
ospf ospf 启用ospf
area
rip split-horizon
display ip protocol
rip split-horizon
display ip protocol
配置RIP V2水平分割
查看路由协议
access-list 1-99 permi
t/deny IP
rule id permit sour
ce IP
rule id permit source IP 标准访问控制列表
access-list 100-199 prule {normal|special}{perrule {normal|special}{perm
ermit/deny protocol smit|deny}{tcp|udp}sourceit|deny}{tcp|udp}source {
ource IP+反码 destina {
tion IP+反码 operator on
扩展访问控制列表
operan ate]
standby group-numbevrrp vrid number virtuavrrp vrid number virtual-i
r ip virtual-ip l-ip p
配置HSRP组
standby group-numbevrrp vrid number priori
r priority ty
vrrp vrid number priority 配置HSRP优先级
standby group-numbevrrp vrid number preevrrp vrid number preemp
r preempt
standby group-numbe
r track
mpt-mode t-mode
配置HSRP占先权
配置端口跟踪
ip nat inside source s
tatic
nat server global
[port] inside
[protocol] tocol]
配置静态地址转换
版权声明:本文标题:华为交换机基本配置命令,附三大品牌命令对比表 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1716115557a691412.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论