配置管理
提交配置
commit check # 语法检查,并不提交配置
commit confirmed # 后边加分钟数,在多少分钟后回滚配置,非常有用
commit comment string # string可以替换为描述
commit at "YYYY-MM-DD HH:MM:SS" # 在某个时间生效,这个不常用
clear system commit # 清除计划的提交任务
commit and-quit # 提交并退出到操作模式
show system commit # 查看历史提交配置
show configuration | compare rollback 10 # 比较历史配置
show | compare # 比较未提交的配置
救援配置
request system configuration rescue save # 保存救援配置
rollback rescue # 回滚到救援配置
保存配置
show config | display-set | no # 保存配置
save /tmp/backup_config # 保存为本地文件
root@srx> file list /var/db/config/ # 查看配置文件列表
文件管理
file show test # 查看文件
file copy
file delete
file checksum md5
恢复密码
-
启动时按空格恢复进入boot恢复模式
-
进入单用户模式
输入 boot -s 命令可进入
-
进入密码恢复过程
输入 recovery 进入
-
进入config 模式配置新密码
user@host# set system root-authentication plain-text-password
配置后注意commit
然后reboot即可
match 与 find
root@SRX550-1> show security policies | find "Index\: 19"
Policy: CH_ZhuY, State: enabled, Index: 19, Scope Policy: 0, Sequence number: 21
Source addresses: CH_ZhuY
Destination addresses: any
Applications: any
Action: permit, log
Policy: CH_ShenC, State: enabled, Index: 20, Scope Policy: 0, Sequence number: 22
Source addresses: CH_ShenC
Destination addresses: SH_Student_Business_Center
Applications: 81
Action: permit, log
# find 后边的是正则表达式