ENSP常用命令_HCIA/HCIP
基本操作 | 命令 |
---|---|
进入系统视图模式 | <>system-view(sys) |
退出当前模式 | quit(qu) |
设备名称更改 | sysname x |
查看当前正在执行的所有配置 | display current-configuration(cu) |
查看接口ip地址 | display ip int brief |
查看接口的简要信息 | display interface brief( int b) |
查看MAC表 | display mac-address |
查看路由表 | display ip routing-table |
查看ospf邻居关系 | display ospf peer |
查看链路聚合状态 | display int Eth-Trunk |
进入回环接口 | int loopback1(loo1) |
查看当前模式下的配置 | display this |
查看ospf邻居表 | display ospf peer brief |
保存 | <>save |
查看硬盘 | <>dir |
查看系统和内存以及硬盘 | dis version |
查看内存 | dis memory-usage |
查看CPU | display cpu-usage |
回退用户模式 | ctrl+z |
日志提示语言为中文 | language-mode chinese |
回车符 | < CR> |
TAB键 | 支持补全 |
显示当前条件下配置 | dis this |
查看邻居表 | dis ospf peer brief |
重置ospf 进程 | < >reset ospf process |
以1.1.1.1 为源地址ping 2.2.2.2 | ping -a 1.1.1.1 2.2.2.2 |
追踪 | tracert -a 1.1.1.1 2.2.2.2 |
指定次数,源地址,目标地址 | ping -c 1000 -a 1.1.1.1 2.2.2.2 ping |
查看静态相同目的不通路径优先级 | dis ip routing-table protocol static |
查看bfd简易内容 | dis bfd session all |
查看bfd全部内容 | dis bfd session all verbose |
undo | 命令 |
---|---|
恢复缺省状态 | undo sysname |
禁用某个功能 | undo ftp server |
删除某项设置 | undo ip address |
关闭系统提示 | undo info-center enable (un in en) |
配置系统下次启动文件 | 命令 |
---|---|
保存x文件 | save x |
下次启动x文件 | startup saved-configuration x |
添加路由条目 | 命令 |
---|---|
静态 | ip route-static 10.1.1.0 24 10.1.4.3 |
默认 | ip route-static 0.0.0.0 0.0.0.0 10.1.4.3 |
FTP
服务端:
ftp server enable
set default ftp-directory flash: 设置ftp主目录
aaa (认证 授权 审计)
local-user lisi privilege level 3 password cipher 123
local-user lisi service-type ftp
客户端:
< >ftp 12.1.1.1
[FTP]get xxxx 取文件
[FTP]put xxx 上传文件
VLAN
[SW1]vlan batch 10 20//创建多VLAN
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-Ethernet0/0/3]port link-type trunk
[SW1-Ethernet0/0/3]port trunk allow-pass vlan 10 20
<SW1>display vlan
单臂路由
交换机配置
sys #进入系统模式
sysname sw1 #修改名称
vlan bat 10 20 #批量创建vlan10 20
int e0/0/1 #进入端口
port link-type access #指定端口类型
port default vlan 10 #加入vlan10
undo shutdown #开启端口
int e0/0/3 #进入端口
port link-type trunk #定义trunk类型端口
port trunk allow-pass vlan all #允许所有vlan通过
undo sh #打开端口
路由器配置
undo t m #关闭提示信息
sys #进入系统视图
sysname R1 #修改名称
int g0/0/0.10 #进入端口 范围0-4095
dot1q termination vid 10 #开启单臂路由
ip add 192.168.10.1 24 #配置IP地址
arp broadcast enable #开启ARP协议
undo sh #打开端口
STP生成树
stp mode stp(/rstp/mstp)
stp enable
stp priority 4096
display stp breif#查看stp接口状态摘要
TELNET
[Huawei]aaa
[Huawei-aaa]local-user adimn privilege level 3 password cipher 123#授予用户三级权限
[Huawei-aaa]local-user admin service-type telnet #授权telnet服务
[Huawei]user-interface vty 0 4#5个接口访问
[Huawei-ui-vty0-4]authentication-mode aaa#3a认证模式
SSH
[Huawei]stelnet server enable#开启ssh功能
[Huawei]aaa
[Huawei-aaa]local-user adimn privilege level 3 password cipher 123#授予用户三级权限
[Huawei-aaa]local-user admin service-type ssh # 允许用户ssh访问权限
[Huawei]user-interface vty 0 4# 5个接口访问
[Huawei-ui-vty0-4]authentication-mode aaa# 3a认证模式
[Huawei-ui-vty0-4]protocol inbound ssh //登录协议为ssh登入
ACL
acl 2000 #基本acl编号:2000-2999
rule deny source 192.168.10.1 0//拒绝源地址,0表示反掩码0.0.0.0,精确匹配
acl 3005 #高级acl编号:3000-3999
rule deny tcp source 192.168.10.2 0 destination 12.0.0.2 0 destination-port eq 23#拒绝源地址192.168.10.2 telnet 访问 12.0.0.2
OSPF
ospf 1 router-id 1.1.1.1#创建并运行ospf进程
area 0#创建并进入ospf区域
network 10.1.12.0 0.0.0.3#添加该区域网段
GRE vpn
interface Tunnel0/0/0
tunnel-protocol gre
source 23.1.1.3 #隧道源地址
destination 12.1.1.1 #隧道目标地址
ip add 192.168.13.3 24 #隧道接口地址(逻辑接口)