Chinaunix首页 | 论坛 | 博客
  • 博客访问: 89986
  • 博文数量: 30
  • 博客积分: 1501
  • 博客等级: 上尉
  • 技术积分: 300
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-01 09:23
文章分类

全部博文(30)

文章存档

2011年(6)

2010年(24)

分类:

2011-04-09 12:46:03

重启:
root@junos1.taobao.com> request system reboot ?  
Possible completions:
  <[Enter]>            Execute this command
  at                   Time at which to perform the operation
  in                   Number of minutes to delay before operation
  media                Boot media for next boot
  message              Message to display to all users
  |                    Pipe through a command


关机:
root@junos1.taobao.com> request system power-off 
root@junos1.taobao.com> request system halt



日志查看:
root@junos1.taobao.com> show log messages | match fail 

保存配置:
[edit]
root@junos1.taobao.com# commit 
commit complete

[edit]
root@junos1.taobao.com#

回退配置:
[edit]
root@junos1.taobao.com# set chassis alarm sonet pll red    

[edit]
root@junos1.taobao.com# show chassis alarm sonet 
pll red;

[edit]
root@junos1.taobao.com# rollback                           
load complete

[edit]
root@junos1.taobao.com# show chassis alarm sonet    

[edit]
root@junos1.taobao.com# 

配置文件存放位置:
root@junos1% cd /config/
root@junos1% ls
.snap                   juniper.conf.2.gz       juniper.conf.gz
juniper.conf.1.gz       juniper.conf.3.gz       juniper.conf.md5
root@junos1% pwd
/config
root@junos1% 
这是前3个配置文件所在位置
其他的在如下目录中:
root@junos1% cd /var/db/config/
root@junos1% ls
juniper.conf.4.gz       juniper.conf.6.gz
juniper.conf.5.gz       juniper.conf.7.gz
root@junos1% pwd 
/var/db/config
root@junos1% 

rollback原则是:当前保存的配置文件是0,然后配置其他再度保存后前一次保存的配置文件由0变成1而刚刚保存的配置则是0以此类推,所以可以通过rollback+配置文件编号来实现各种回退
注:文件编号的范围是0-49

保存配置文件到其他机器上:
以下例子是SSH
root@junos1.taobao.com# save root@10.13.114.158:/var/tmp/1               
The authenticity of host '10.13.114.158 (10.13.114.158)' can't be established.
RSA key fingerprint is 51:55:8a:aa:64:9f:91:24:32:31:a1:92:80:90:bc:59.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.13.114.158' (RSA) to the list of known hosts.
root@10.13.114.158's password: 
tempfile                                                   100%  888     0.9KB/s   00:00    
Wrote 49 lines of configuration to 'root@10.13.114.158:/var/tmp/1'

[edit]
root@junos1.taobao.com# 
也可以FTP TFTP等配置。

[edit]
root@junos1.taobao.com# save terminal               \\等同于IOS的show run
加载配置文件到路由器上:
1.合并配置:
原有配置
[edit]
root@junos1.taobao.com# show chassis alarm sonet              
lol yellow;
pll red;
加载配置
chassis {
    alarm {
        sonet {
            pll red;
        }
    }
}
采用合并加载以后
root@junos1.taobao.com# load merge root@10.13.114.158:/var/tmp/1 
root@10.13.114.158's password: 
1                                                          100%  888     0.9KB/s   00:00    
load complete
lol yellow依然存在
[edit]
root@junos1.taobao.com# show chassis alarm sonet                    
lol yellow;
pll red;
2.覆盖加载:
而采用覆盖加载
[edit]
root@junos1.taobao.com# load override root@10.13.114.158:/var/tmp/1 
root@10.13.114.158's password: 
1                                                          100%  888     0.9KB/s   00:00    
load complete
发现lol yellow;不见了
[edit]
root@junos1.taobao.com# show chassis alarm sonet                       
pll red;

说明:合并是合并两个配置将不同的覆盖双方没有的合并,而覆盖是不同的覆盖自己没有的删除别人没有的添加。

replace则是替换,也就是自己有的对方没有的不改,对方有的自己没有的也不改,只改自己有的对方也有的但是配置不同的部分。

运行:
[edit]
root@junos1.taobao.com# ping            
                        ^
unknown command.
想要直接运行ping是不成功的
需要这样:
root@junos1.taobao.com# run ping 10.13.114.158   
PING 10.13.114.158 (10.13.114.158): 56 data bytes
64 bytes from 10.13.114.158: icmp_seq=0 ttl=64 time=1.269 ms
64 bytes from 10.13.114.158: icmp_seq=1 ttl=64 time=0.428 ms
^C
--- 10.13.114.158 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.428/0.848/1.269/0.421 ms

[edit]
root@junos1.taobao.com# 

说明:JUNOS是运行在FREEBSD上的一个特殊的应用程序而已与cisco的IOS不同。


阅读(3403) | 评论(0) | 转发(0) |
0

上一篇:[juniper-原创]JUNOS模式

下一篇:没有了

给主人留下些什么吧!~~