12-目标配置管理
本章节下载: 12-目标配置管理 (238.69 KB)
进入私有模式系统视图或独占模式系统视图,以及从该视图进入其他视图后,对设备进行的配置为目标配置,在该模式下执行非实时生效的命令行并回车时,命令行不会立即生效,只有执行commit命令后,所有目标配置一起下发。如果目标配置下发成功,则会创建配置回滚点。
在私有/独占模式系统视图下,执行硬件类相关命令或动作类命令,是立即生效的,不需要再执行commit命令。
进入私有/独占模式系统视图时,命令提示符将以“~”开头,用以提示用户当前视图为私有/独占模式下的相关视图。当执行非实时生效的命令行后,命令提示符将改为以“*”开头,用以提示用户当前模式下已存在未生效的配置命令,执行commit命令后,命令提示符将改回以“~”开头。关于命令行视图的详细介绍,请参见“基础配置命令参考”中的“CLI”。
目标配置下发成功后,设备会创建配置回滚点。如果短时间内多次执行commit操作,使得设备同时创建多个配置回滚点,导致设备负载过大,有可能使目标配置下发失败,因此请不要频繁的执行commit操作。
使用commit命令用来下发目标配置时,可以通过save-running filename参数在执行commit命令前先将当前运行配置保存到配置文件中。执行configuration commit auto-save path命令后,执行commit命令且不指定save-running filename参数时,系统会自动先将当前运行配置保存到配置文件中。如果用户在执行commit命令时指定了save-running filename参数,则当前运行配置的保存以save-running filename参数为准,configuration commit auto-save path命令的配置不生效。
(1) (可选)配置系统最多可创建的回滚点的数量。
a. 进入实时生效系统视图。
system-view
b. 配置系统最多可创建的回滚点的数量。
configuration commit max-number max-number
缺省情况下,系统最多可创建的回滚点的数量为100。
当创建的回滚点数量超过当前配置的回滚点数量时,系统先删除最早的回滚点再保存最新生成的回滚点。
c. 退回用户视图。
quit
(2) (可选)开启执行commit命令时自动保存当前运行配置功能,并配置相关参数。
a. 进入实时生效系统视图。
system-view
b. 开启执行commit命令时自动保存当前运行配置功能,并配置相关参数。
configuration commit auto-save path directory filename-prefix filename-prefix [ user user-name [ password { cipher | simple } string ] | vpn-instance vpn-instance-name ] *
缺省情况下,执行commit命令时自动保存当前运行配置功能处于关闭状态。
c. 直接退回用户视图。
abort
(3) 进入独占模式系统视图或私有模式系统视图。
system-view { exclusive | private }
(4) 对设备各功能进行配置。
关于各功能的详细配置,请参见各模块的配置指导。
(5) (可选)显示目标配置。
display target-configuration
通过执行该命令检查目标配置是否完全正确,以免下发错误目标配置影响当前网络正常运行。
(6) (可选)更新未提交的目标配置。
refresh target-configuration
(7) 下发目标配置。
commit [ best-effort ] [ force ] [ label labelname ] [ save-running filename ] [ confirmed [ seconds | minutes minutes ] ] [ show-error ] [ clear-error ] [ description text ]
(8) (可选)执行配置回滚操作。
configuration replace { file filename | last number | commit-id commit-id | label labelname }
执行本命令后,设备配置将会回滚到指定的配置回滚点的配置,之前的配置将会丢失,请谨慎使用。
下发错误目标配置时,执行配置回滚操作,将当前运行配置回滚到下发目标配置前的配置。
关于configuration replace file命令的详细介绍,请参见“基础配置命令参考”中的“配置文件管理”。
在完成上述配置后,执行display命令可以显示目标配置。用户可以通过查看显示信息验证配置的效果。
在私有/独占模式下的任意视图下执行reset命令可以清除目标配置。
· 执行reset configuration commit命令删除的回滚点无法恢复,请谨慎使用。
· 执行reset target-configuration删除的目标配置无法恢复,需要用户再次手动配置,请谨慎使用。
|
操作 |
命令 |
说明 |
|
显示回滚点对应配置与当前运行配置或其他回滚点之间的差异 |
display configuration commit diff [ at commit-id | last number | since commit-id ] |
在任意视图下执行 |
|
显示回滚点的信息 |
display configuration commit list [ number | label ] [ verbose ] |
在任意视图下执行 |
|
显示CLI、NETCONF、CWMP和SNMP用户的配置会话信息 |
display configuration sessions |
在任意视图下执行 |
|
显示目标配置 |
display target-configuration [ diff | failure [ brief ] | merge | success ] |
在私有/独占模式下的任意视图下执行 |
|
清除已创建的回滚点 |
reset configuration commit number |
在用户视图下执行 清除不再使用的回滚点可以释放内存,提高设备性能 |
|
清除目标配置 |
reset target-configuration [ command [ text ] ] |
在私有/独占模式下的任意视图下执行 |
表2-1 私有/独占模式下支持的命令
|
模块名称 |
命令行 |
|
AAA |
accounting command |
|
AAA |
accounting login |
|
AAA |
authentication default |
|
AAA |
authentication login |
|
AAA |
authorization login |
|
AAA |
authorization command |
|
AAA |
authorization-attribute |
|
AAA |
domain default enable |
|
AAA |
key |
|
AAA |
primary accounting |
|
AAA |
primary authentication |
|
AAA |
secondary accounting |
|
AAA |
secondary authentication |
|
AAA |
secondary authorization |
|
AAA |
service-type |
|
AAA |
user-name-format |
|
AAA |
domain |
|
AAA |
hwtacacs scheme |
|
AAA |
local-user |
|
AAA |
radius scheme |
|
AAA |
user-group |
|
ACL |
rule |
|
ACL |
step |
|
ACL |
acl basic |
|
ARP |
arp ip-conflict log prompt |
|
ARP |
arp user-ip-conflict record enable |
|
BGP |
bgp |
|
BGP |
balance |
|
BGP |
peer bfd |
|
BGP |
peer advertise-community |
|
BGP |
preference |
|
BGP |
address-family ipv4 |
|
BGP |
address-family ipv6 |
|
BGP |
aggregate |
|
BGP |
peer route-policy |
|
BGP |
peer allow-as-loop |
|
BGP |
group |
|
BGP |
peer description |
|
BGP |
peer group |
|
BGP |
peer as-number |
|
BGP |
peer route-update-interval |
|
BGP |
router-id |
|
BGP |
bgp apply-policy on-startup duration |
|
BGP |
ip vpn-instance |
|
BGP |
router id |
|
CLI |
return |
|
DHCP |
dhcp client identifier |
|
IP地址 |
ip address |
|
IP性能优化 |
ip icmp source |
|
IP性能优化 |
ip ttl-expires enable |
|
IP性能优化 |
ip unreachables enable |
|
IRF |
irf auto-update enable |
|
IRF |
irf mac-address persistent |
|
IRF |
irf link-delay |
|
IRF |
irf member |
|
LLDP |
lldp global enable |
|
LLDP |
lldp global tlv-enable basic-tlv management-address-tlv |
|
MAC地址认证 |
nas-ip |
|
MPLS L3VPN |
ip binding vpn-instance |
|
MPLS L3VPN |
route-distinguisher |
|
NETCONF |
netconf ssh server enable |
|
NTP |
ntp-service enable |
|
NTP |
ntp-service source |
|
NTP |
ntp-service unicast-server |
|
RBAC |
description |
|
SNMP |
snmp-agent |
|
SNMP |
snmp-agent community |
|
SNMP |
snmp-agent local-engineid |
|
SNMP |
snmp-agent sys-info version |
|
SNMP |
snmp-agent target-host |
|
SNMP |
snmp-agent trap enable arp |
|
SSH |
ssh server enable |
|
SSL |
security-enhanced level |
|
VCF Fabric |
vpn-target export-extcommunity |
|
VCF Fabric |
vpn-target import-extcommunity |
|
VLAN |
vlan |
|
VLAN |
interface vlan-interface |
|
登录设备 |
authentication-mode |
|
登录设备 |
command accounting |
|
登录设备 |
command authorization |
|
登录设备 |
protocol inbound |
|
登录设备 |
line |
|
登录设备 |
line class |
|
登录设备 |
role name |
|
静态路由 |
ip route-static vpn-instance |
|
路由策略 |
apply community |
|
路由策略 |
apply as-path |
|
路由策略 |
ip prefix-list |
|
路由策略 |
ip community-list |
|
路由策略 |
route-policy |
|
路由策略 |
if-match community |
|
设备管理 |
clock protocol |
|
设备管理 |
sysname |
|
设备管理 |
clock timezone |
|
设备管理 |
hardware-resource linkscan-mode |
|
设备管理 |
hardware-resource routing-mode |
|
设备管理 |
hardware-resource switch-mode |
|
设备管理 |
parity-error consistency-check log enable |
|
设备管理 |
parity-error unrecoverable log enable |
|
设备管理 |
parity-error unrecoverable reboot |
|
设备管理 |
scheduler logfile size |
|
设备管理 |
system-working-mode |
|
设备管理 |
user-role |
|
生成树 |
stp bpdu-protection |
|
生成树 |
stp global enable |
|
信息中心 |
info-center loghost source |
|
信息中心 |
info-center loghost |
|
以太网接口 |
port link-mode |
|
以太网接口 |
interface |
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!
