JUNOS的基本操作

 重啓:

[email protected]> 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
 
 
關機:
[email protected]> request system power-off 
[email protected]> request system halt
 
 
 
日誌查看:
[email protected]> show log messages | match fail 
 
保存配置:
[edit]
commit complete
 
[edit]
 
回退配置:
[edit]
[email protected]# set chassis alarm sonet pll red    
 
[edit]
[email protected]# show chassis alarm sonet 
pll red;
 
[edit]
[email protected]# rollback                           
load complete
 
[edit]
[email protected]# show chassis alarm sonet    
 
[edit]
 
配置文件存放位置:
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
[email protected]# save [email protected]:/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.
[email protected]'s password: 
tempfile                                                   100%  888     0.9KB/s   00:00    
Wrote 49 lines of configuration to '[email protected]:/var/tmp/1'
 
[edit]
也可以FTP TFTP等配置。
 
[edit]
[email protected]# save terminal               \\等同於IOS的show run
加載配置文件到路由器上:
1.合併配置:
原有配置
[edit]
[email protected]# show chassis alarm sonet              
lol yellow;
pll red;
加載配置
chassis {
    alarm {
        sonet {
            pll red;
        }
    }
}
採用合併加載以後
[email protected]# load merge [email protected]:/var/tmp/1 
[email protected]'s password: 
1                                                          100%  888     0.9KB/s   00:00    
load complete
lol yellow依然存在
[edit]
[email protected]# show chassis alarm sonet                    
lol yellow;
pll red;
2.覆蓋加載:
而採用覆蓋加載
[edit]
[email protected]# load override [email protected]:/var/tmp/1 
[email protected]'s password: 
1                                                          100%  888     0.9KB/s   00:00    
load complete
發現lol yellow;不見了
[edit]
[email protected]# show chassis alarm sonet                       
pll red;
 
說明:合併是合併兩個配置將不同的覆蓋雙方沒有的合併,而覆蓋是不同的覆蓋自己沒有的刪除別人沒有的添加。
 
replace則是替換,也就是自己有的對方沒有的不改,對方有的自己沒有的也不改,只改自己有的對方也有的但是配置不同的部分。
 
運行:
[edit]
[email protected]# ping            
                        ^
unknown command.
想要直接運行ping是不成功的
需要這樣:
[email protected]# 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]
 
說明:JUNOS是運行在FREEBSD上的一個特殊的應用程序而已與cisco的IOS不同。
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章