H3C学习笔记
进入系统视图
system-view
查看接口摘要信息
dis ip int brief
显示当前配置信息
dis cu(current-configuration)
显示当前端口配置
dis this
进入端口
int GE0/1(gi 0/1)
关闭/重启接口
shutdown/undo shutdown
配置IP地址
ip add ip地址 掩码
删除ip地址
undo ip add
显示stp信息
dis stp
配置桥ID
stp priority 0/4096
显示stp端口信息
dis stp brief
显示路由表
dis ip routing-table
静态路由配置
ip rout-static 目标网段网络地址 掩码 下一跳IP地址 [preference 优先级]
添加回环路由
int LoopBack 2
ip add 192.168.2.2 24
添加缺省路由
ip rout-static 0.0.0.0 0 下一跳IP地址
显示vlan
dis vlan brief
新增vlan
vlan 10
修改接口模式
port link-type access/trunk
进入端口后,将端口加入vlan
port access vlan 10
关闭消息中心
undo in en
删除vlan配置
undo port access vlan
为trunk端口指派vlan
port permit vlan 10 20
配置本真vlan,通信时不打标记
port trunk pvid vlan 20
启用端口
undo shutdown
接入子接口
int gi 0/0.1
为路由子接口指定vlan
vlan-type dot1q vid 10
创建虚拟端口
int vlan 10
为虚拟端口配置ip地址
ip add ip地址
dhcp配置
dhcp enable
dhcp server ip-pool a
gateway-list 12.1.1.1
network 12.1.1.0 mask 255.255.255.0
dns-list 8.8.8.8 9.9.9.9
dhcp select server
dhcp server forbidden-ip 12.1.1.1 12.1.1.10#排除ip地址
ip address dhcp-alloc#自动获取ip地址
NAT配置
nat outbound#使用端口外网地址
na address-group 1 #使用固定ip地址
address 12.1.1.3 12.1.1.4
acl basic 2000
rule permit source 192.168.10.0 0.0.0.255
int gi 0/1#进入端口
nat outbound 2000 address-group 1
开启telnet
telnet server enable
line vty 0 4
authentication-mode scheme
quit
local-user hcnp
password simple 123
#service-type terminal
service-type telnet
NAT内网地址
int gi 0/1
nat server protocal tcp global 外网地址 inside 内网地址 端口
dis nat session#显示nat信息
NAT调试命令
terminal debugging
terminal monitor
debugging nat event
debugging nat packet
二层链路聚合
int bridge-Aggrengation 1
int range gi 1/0/2 to gi 1/0/3
port link-aggregation group 1
acl配置
acl basic 2000#基本acl
rule deny source 192.168.10.1 0 #精确匹配
int gi 0/2
packet-filter 2000 outbound #阻塞指定源数据包
acl advanced 3000#高级acl
rule deny icmp source 192.168.10.0 0.0.0.255 destination 172.16.10.2 0 #阻塞指定网段ping目标地址
int gi 0/2
packet-filter 3000 outbound
智能弹性架构irf
交换机1
dis irf
irf member 1 priority 32
int rang Ten 1/0/50 to Ten 1/0/51
shutdown
irf-port 1/1
port group interface Ten-GigabitEthernet1/0/50
port group interface Ten-GigabitEthernet1/0/51
irf-port-configuration active
int rang Ten 1/0/50 to Ten 1/0/51
undo shutdown
save
插网线
交换机2
dis irf
irf member 1 renumber 2
int rang Ten 1/0/50 to Ten 1/0/51
shutdown
irf-port 1/1
port group interface Ten-GigabitEthernet1/0/50
port group interface Ten-GigabitEthernet1/0/51
irf-port-configuration active
int rang Ten 1/0/50 to Ten 1/0/51
undo shutdown
save
插网线