JUNOS配置激活引擎: commit – Part 2

JUNOS配置激活确认 – commit confirm

在对远程设备配置过程中,始终存在着意外断开设备或终止管理会话的风险,这一点总是存在于错误地删除末节站点路由器的默认路由,或错误修改出站接口的IP地址/掩码,甚至错误的NAT策略上面。Commit Confirm命令通过Commit Confirm这个Are Your Sure?激活机制,有助于防范在这些情况下失去连通性 —— 如果系统(在缺省的10分钟之内)没有收到确认改动的通知,系统就会回退到此前的配置。

[edit]
nigel@Atlanta# set system host-name Test
[edit]
nigel@Atlanta# commit confirmed 1
commit confirmed will be automatically rolled back
   in 1 minutes unless confirmed
commit complete
[edit]
nigel@Test# 

根据激活定义,假如一分钟后没有再次“Commit”确认,配置自动回滚到之前状态

[edit]
nigel@Atlanta# 

JUNOS定时激活 – commit at

另外,我们可以制订时间计划,预定当前配置在将来某一个时候被提交,实现无人值守配置;当然,我们建议你在此前通过commit check确认被提交的配置语法是准确无误的。虽然距离现实依然有相当大的距离,JUNOS终于给予半夜三更起来割接的网络工程师一线希望。

手工设定Juniper路由器时区及时间

首先,我们需要设置系统时区及时间。在配置路由器的过程中,由于我们将在路由器本地保存大量的日志文件,跟踪记录及配置备份副本,相对于IOS,在JUNOS系统上设定精确的系统时间 —— 或者配置NTP同步具有更强的实际意义。

nigel@Atlanta# set system time-zone Asia/Chongqing
[edit]
nigel@Atlanta# run set date 200805100110.00

查询系统时区及启动时间:

[edit]
nigel@Atlanta# run show system uptime
Current time: 2008-05-10 01:11:08 CST
System booted: 2008-05-09 22:18:29 CST (02:52:39 ago)
Protocols started: 2008-05-09 22:19:05 CST (02:52:03 ago)
Last configured: 2008-05-10 09:10:09 CST (-7:-59:-1 ago) by
nigel
 1:11AM  up 2:53, 1 user, load averages: 0.04, 0.02, 0.00

设置未来配置提交计划:

nigel@Atlanta# commit at "2008-05-12 0:00"
configuration check succeeds
commit at will be executed at 2008-05-12 00:00:00 CST
Exiting configuration mode
nigel@Atlanta

清空配置提交计划:

nigel@Atlanta> configure
Entering configuration mode
Users currently editing the configuration:
  nigel terminal p0 (pid 7196) on since 2008-05-10 09:14:53
CST, idle 00:06:06 commit-at
[edit]
nigel@Atlanta# run clear system commit
Pending commit cleared

JUNOS为配置打上标签 – commit comment

当你每次激活一个新的配置的时候,为该配置版本添加一段注释是一个很好的习惯,在使用我们将在下面讨论的回滚 (Rollback) 功能的时候,一段简单的注释将让你能确定系统将恢复到你希望的得到的恢复版本中。

nigel@Atlanta# set system root-authentication
plain-text-password
New password:
Retype new password:
[edit]
nigel@Atlanta# commit comment "root auth."
commit complete 

在激活配置的同时,为该配置加入注释 —— 添加root用户验证。

[edit]
nigel@Atlanta# run show system commit
0   2008-05-10 01:51:04 CST by nigel via cli
    root auth.
1   2008-05-10 01:19:01 CST by nigel via cli
2   2008-05-10 09:10:09 CST by nigel via cli
3   2008-05-10 09:27:40 CST by nigel via cli 

One thought on “JUNOS配置激活引擎: commit – Part 2

  1. JUNOS配置标注技巧 « JUNIPER JUNOS & CISCO IOS 互联路由

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s