【文章內(nèi)容簡(jiǎn)介】
4 開(kāi)機(jī)登錄1. 第一次開(kāi)機(jī)登錄用戶名為 root,密碼為空。(如何連上 console 詳見(jiàn))Console 輸出如下:Amnesiac (ttyu0)login: root JUNOS built 20220511 05:02:14 UTC2. 登錄之后,我們?cè)?shell 模式下,輸入 cli 進(jìn)入用戶模式,然后輸入 configure進(jìn)入配置模式:root@%root@% cliroot root configure Entering configuration mode[edit]root1. 剛進(jìn)入配置模式下,通過(guò) show 命令可以看到設(shè)備原有的配置,這是初始默認(rèn)配置,包括以后用 reset 鍵恢復(fù)配置,恢復(fù)出來(lái)的都是出廠默認(rèn)配置。此默認(rèn)配置對(duì) SRX 進(jìn)行了基本連通性的配置,其中 fe0/0/0 為外網(wǎng)口,接廣域網(wǎng)出口,fe0/0/17 為內(nèi)網(wǎng)口,地位等同,接內(nèi)網(wǎng)交換機(jī)。同時(shí),防火墻對(duì)內(nèi)網(wǎng)開(kāi)啟 DHCP 服務(wù),網(wǎng)段為 。默認(rèn)策略放開(kāi)所有由內(nèi)到外的數(shù)據(jù),拒絕所有從外到內(nèi)的主動(dòng)訪問(wèn)。2. 一般情況下這份配置不要保留使用,為了方便日后故障排查,我們需要將其刪17 / 34除,重新配置:root delete This will delete the entire configurationDelete everything under this level? [yes,no] (no) yes配置 root 根用戶密碼,這個(gè)必須配置,否則無(wú)法 mit 提交生效配置。root set system rootauthentication plaintextpassword New password:Retype new password:root mit1. 配置 root 根用戶密碼,這個(gè)必須配置,否則無(wú)法 mit 提交生效配置。root set system rootauthentication plaintextpassword New password:Retype new password:2. 配置 hostname[edit]root set system hostname SRX1003. 配置時(shí)區(qū)[edit]root set system timezone GMT+84. 配置登錄登錄權(quán)限及用戶名密碼,這里配置了一個(gè)名為 lab,權(quán)限為超級(jí)用戶的登錄用戶。Junos 系統(tǒng)的要求密碼最少為六位,而且必須包含字母和數(shù)字。set system login class super idletimeout 20set system login class super permissions all set system login user lab class super set system login user lab authentication plaintextpassword new password:retype new password:5. 配置 tel、web 管理服務(wù),這個(gè)需要在將來(lái)的 zone 的配置中進(jìn)一步放行流量。默認(rèn)情況下,系統(tǒng)禁止所有流量。在這里,針對(duì) fe0/0/1 接口開(kāi)啟 web 管理服務(wù)。18 / 34[edit]root set system services telroot set system services webmanagement interface fe0/0/16. 配置接口地址,這里配置外網(wǎng)接口 fe0/0/0 地址為 ,內(nèi)網(wǎng)接口 fe0/0/1 地址為 。對(duì)于 SRX210,對(duì)應(yīng)前兩個(gè)接口為千兆口,所以端口命名為:ge0/0/0 和 ge0/0/1,其余的為 fe。[edit]root set interfaces fe0/0/0 unit 0 family i address [edit]root set interfaces fe0/0/1 unit 0 family i address 7. 將接口放到對(duì)應(yīng)的 zone 中,這里是將 fe0/0/0 放到 untrust zone,fe0/0/1 放到 trust zone。[edit]root set security zones securityzone untrust interfaces fe0/0/0 [edit]root set security zones securityzone trust interfaces fe0/0/18. 在內(nèi)網(wǎng)區(qū)域 trust zone 內(nèi)放行系統(tǒng)管理的流量,默認(rèn)情況下,外網(wǎng)口禁止tel 和 web 管理的訪問(wèn)流量。[edit]rootset security zones securityzone trust hostinboundtraffic systemservices tel[edit]root set security zones securityzone trust hostinboundtraffic systemservices 9. 配置允許內(nèi)網(wǎng)到外網(wǎng)的流量和策略。[edit]rootset security zones securityzone trust hostinboundtraffic protocols all[edit]rootset security policies fromzone trust tozone untrust policy 19 / 34trust_to_untrust match sourceaddress any[edit]rootset security policies fromzone trust tozone untrust policy trust_to_untrust match destinationaddress any[edit]rootset security policies fromzone trust tozone untrust policy trust_to_untrust match application any[edit]rootset security policies fromzone trust tozone untrust policy trust_to_untrust then permit10. 配置出口默認(rèn)路由。[edit]root set routingoptions static route 11. 配置基于出口的源 nat,所有內(nèi)網(wǎng) ip 經(jīng)過(guò) fe0/0/0 出口后的數(shù)據(jù)包,全部轉(zhuǎn)換為 fe0/0/0 的地址路由到公網(wǎng)上。[edit]rootset security nat source ruleset trusttountrust from zone trust[edit]rootset security nat source ruleset trusttountrust to zone untrust[edit]rootset security nat source ruleset trusttountrust rule sourcenatrule match sourceaddress [edit]rootset security nat source ruleset trusttountrust rule sourcenatrule then sourcenat interface12. 提交配置,使當(dāng)前配置生效。寫(xiě)完配置一定要提交,否則配置不生效。[edit]rootmitmit plete20 / 345. 常用故障診斷命令查看端口狀態(tài)lab@SRX show interfaces terse Interface Admin Link Proto Local Remotege0/0/0 up up ge0/0/1 up down查看路由表lab@SRX show route terse : 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)+ = Active Route, = Last Active, * = BothA Destination P Prf Metric 1 Metric 2 Next hop AS path* * ge0/0/ 查看 OSPF 鄰居關(guān)系lab@r1 show ospf neighbor Address Interface State ID Pri Dead fe0/0/ Full 128 36 fe0/0/ Full 128 3521 / 34Pinglab@srx ping PING (): 56 data bytes64 bytes from : icmp_seq=0 ttl=61 time= mslab@srx ping rapid PING (): 56 data bytes!!!!!lab@SRX run ping rapid count 1000 size 1000 PING (): 1000 data bytes!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1000 packets transmitted, 1000 packets received, 0% packet lossroundtrip min/avg/max/stddev = Traceroutelab@srx traceroute traceroute to (), 30 hops max, 40 byte packets 1 () ms ms ms2 () ms ms ms監(jiān)控接口流量lab@srx monitor interface fe0/0/122 / 34監(jiān)控 RE CPU 利用率lab@srxshow chassis routingengine監(jiān)控并發(fā)會(huì)話數(shù)lab@srxshow security flow session summary冷卻系統(tǒng)故障檢查冷卻系統(tǒng)包含安裝在機(jī)箱側(cè)面的風(fēng)扇盤(pán)來(lái)保證 SRX 工作在一個(gè)可以接受的溫度環(huán)境下。要檢查風(fēng)扇盤(pán),執(zhí)行下面的步驟:? 通過(guò) CLI 命令行檢查電源模塊狀態(tài)。通過(guò)下面的命令,觀察輸出的 Status 域的狀態(tài):user@host show chassis environment ..23 / 34.? 如果有風(fēng)扇盤(pán)發(fā)生故障,可以通過(guò)觀察判斷出哪一個(gè)風(fēng)扇除了問(wèn)題。然后再處理。機(jī)箱硬件組件故障檢查對(duì)機(jī)箱組件進(jìn)行故障檢查,使用下面的指導(dǎo):? 通過(guò)查看各板卡上相應(yīng)的 LED,可以檢查出相應(yīng)板卡的狀態(tài)。? 使用 CLI 可以查看各板卡的狀態(tài),使用下面的命令:user@host show chassis hardware24 / 346. 設(shè)備日常維護(hù)本章節(jié)描述了如何維護(hù) SRX 中的各種硬件組件。日常維護(hù)步驟為優(yōu)化設(shè)備的性能,有規(guī)律的執(zhí)行下面的預(yù)防步驟:? 檢查設(shè)備所在的機(jī)房的條件:濕度、電源線、數(shù)據(jù)線纜以及空氣過(guò)濾網(wǎng)是否有過(guò)多的灰塵。同時(shí)應(yīng)保證路由器的通風(fēng)條件,設(shè)備本身的進(jìn)出風(fēng)口沒(méi)有距離過(guò)近的阻擋。? 檢查設(shè)備 Craft Interface 上的狀態(tài)報(bào)告,看看是否有系統(tǒng)告警,LED 顯示是否正常。配置文件查看配置文件可從維護(hù)模式(提示符)下查看lab@SRX show configuration配置文件也可從配置模式(提示符 )下查看,注意配置模式下看得配置文件是當(dāng)前正在編輯的配置文件,跟系統(tǒng)當(dāng)前運(yùn)行的配置文件不一定一致.lab@SRX showJUNOS 默認(rèn)情況下用層次化的結(jié)構(gòu)來(lái)顯示配置,不同層次間用{}區(qū)分,如果管理員習(xí)慣看直接輸入的命令格式,可以通過(guò)管道符把輸出送到 display options 里去改變格式,比如:lab@SRX show configuration | display set配置文件提交每次配置更改后都需要”mit”提交25 / 34 常用功能及典型配置安全策略是在 SRX 上定義的一系列規(guī)則告訴 SRX 如何處理在各個(gè)安全域(zone)之間或同一安全域內(nèi)各個(gè)接口之間轉(zhuǎn)發(fā)的報(bào)文應(yīng)該如何處理,比如對(duì)其進(jìn)行轉(zhuǎn)發(fā)(permit),丟棄(deny), NAT,IPsec VPN 加解密, IPS 入侵防御檢查或防病毒檢查等等。 SRX 常用功能配置 安全域 zone 配置Zone 是共享相同安全級(jí)別的一組網(wǎng)絡(luò)接