單位最近更新防火牆,打算把10年前的2臺juniper換成如今的2臺juniper srx 3400,利用juniper的jsrp技術實現,雙機設備,一臺壞了,另外一臺自動接替。以爲此次juniper命令比之前有不少該變小弟菜鳥跟着學了一點。node
原理,每臺機子有9個板卡位,分別是012345678,把板卡插在那個地方就是那個位置,設一臺3400爲a,另外一臺爲b,那麼變雙機後,a,b變成一個總體,a爲主機板卡爲012345678,b爲備機板卡不在是012345678,而是從9開始,數9個數安全
fxp0爲a的telnet管理口 fxp1爲b的telnet管理口app
a的g1/0/15爲fab0 與 b的9/0/15爲fab1 相連 爲數據傳輸 心跳線(控制傳輸)爲固定的兩個端口相連ssh
a的g1/0/0 與 b的9/0/0 同屬reth10 與主交換機相連異步
a的g1/0/1 與 b的9/0/1 同屬reth11 與被交換機相連ide
詳細配置以下:紅色爲說明 黑色爲命令url
只要配置好主機就行了,另外一臺會自動同步的spa
配置Cluster id和Node id.net
注意,這一步兩個node都須要配置。orm
配置命令:
SRX3400A
SRX3400a>set chassis cluster cluster-id 1 node 0 reboot
//注1:注意該命令需在operational模式下輸入
//注2:Cluster ID取值範圍爲1 – 15,當Cluster ID = 0時會unsets cluster配置,成爲單機
SRX3400B
SRX3400b>set chassis cluster cluster-id 1 node 1 reboot
指定Fabric Link
Fabric Link是一個虛擬的交換平面,用於將兩個SRX機箱的數據平面鏈接在一塊兒,主要用於RTO對象同步和異步路由數據的回程。
配置命令:
SRX3400A
set interfaces fab0 fabric-options member-interfaces ge-1/0/15
set interfaces fab1 fabric-options member-interfaces ge-9/0/15
commit
//注5:Fabric Link中的Fab0固定用於node 0,Fab1固定用於node 1
配置Redundancy Group
Redundancy Group (RG)相似ScreenOS NSRP裏的VSD,用來抽象兩個機箱之間能夠互相熱備切換的一組對象,其中RG0固定用於RE切換,RG1用於一組redundant interface切換,若是要作AA,則還須要RG2。由此能夠看出,RE切換是獨立於接口切換的。
配置以下:
set chassis cluster reth-count 255
set chassis cluster redundancy-group 0 node 0 priority 254
set chassis cluster redundancy-group 0 node 1 priority 100
set chassis cluster redundancy-group 1 node 0 priority 254
set chassis cluster redundancy-group 1 node 1 priority 100
commit
每一個機箱的個性化配置
經過group模板來實現,相似JUNOS RE 的group配置,實際上JSRP中的跨機箱RE切換就是模擬了JUNOS中的RE Redundancy,這樣也方便之後實現NSR/ISSU。
配置以下:
set groups node0 system host-name juniper-srx-3400a
set groups node0 system backup-router 192.168.1.28
set groups node0 system backup-router destination 0.0.0.0/0
set groups node0 interfaces fxp0 unit 0 family inet address 192.168.1.26/28
set groups node1 system host-name juniper-srx-3400b
set groups node1 system backup-router 192.168.1.28
set groups node1 system backup-router destination 0.0.0.0/0
set groups node1 interfaces fxp0 unit 0 family inet address 192.168.1.27/28
set apply-groups ${node}"
commit
配置Redundant Ethernet Interface
Redundant Ethernet interface是一組主備的以太網接口,實際上利用了跨機箱的802.3ad link aggregate技術來實現兩個成員接口間的主備切換。
Redundant Ethernet interface的MAC地址是虛擬的,其值根據如下公式能夠計算得出:
0010DB11111111CCCCRRVV1111111
CCCC: Cluster ID
RR:Reserved. 00.
VV: Version, 00 for the first release
IIIIIIII:Interface id, derived from the reth index.
配置以下:
set interfaces ge-0/0/0 gigether-options redundant-parent reth0 // node0的ge-0/0/0
set interfaces ge-0/0/1 gigether-options redundant-parent reth1 // node0的ge-0/0/1
set interfaces ge-0/0/2 gigether-options redundant-parent reth2 // node0的ge-0/0/2
set interfaces ge-0/0/3 gigether-options redundant-parent reth3 // node0的ge-0/0/3
set interfaces ge-8/0/0 gigether-options redundant-parent reth0 // node1的ge-0/0/0
set interfaces ge-8/0/1 gigether-options redundant-parent reth1 // node1的ge-0/0/1
set interfaces ge-8/0/2 gigether-options redundant-parent reth2 // node1的ge-0/0/2
set interfaces ge-8/0/3 gigether-options redundant-parent reth3 // node1的ge-0/0/3
set interfaces ge-1/0/0 gigether-options redundant-parent reth10 // node0的ge-1/0/0
set interfaces ge-1/0/1 gigether-options redundant-parent reth11 // node0的ge-1/0/1
set interfaces ge-1/0/2 gigether-options redundant-parent reth12 // node0的ge-1/0/2
set interfaces ge-1/0/3 gigether-options redundant-parent reth13 // node0的ge-1/0/3
set interfaces ge-9/0/0 gigether-options redundant-parent reth10 // node1的ge-9/0/0
set interfaces ge-9/0/1 gigether-options redundant-parent reth11 // node1的ge-9/0/1
set interfaces ge-9/0/2 gigether-options redundant-parent reth12 // node1的ge-9/0/2
set interfaces ge-9/0/3 gigether-options redundant-parent reth13 // node1的ge-9/0/3
set interfaces reth0 redundant-ether-options redundancy-group 1 // 屬於RG1
set interfaces reth1 redundant-ether-options redundancy-group 1 // 屬於RG1
set interfaces reth2 redundant-ether-options redundancy-group 1 // 屬於RG1
set interfaces reth3 redundant-ether-options redundancy-group 1 // 屬於RG1
set interfaces reth10 redundant-ether-options redundancy-group 1 // 屬於RG1
set interfaces reth11 redundant-ether-options redundancy-group 1 // 屬於RG1
set interfaces reth12 redundant-ether-options redundancy-group 1 // 屬於RG1
set interfaces reth13 redundant-ether-options redundancy-group 1 // 屬於RG1
配置Interface Monitoring
默認狀況下,接口故障只會觸發Redundant Ethernet interface內部主備接口切換,這時異步路由流量會從Fabric Link送到egress接口所在的node;若是但願避免這種情況 (好比Fabric Link帶寬不夠) 則能夠經過配置interface monitoring來監控物理接口的存亡,並觸發整個Redundancy Group的切換。每一個被監控的成員接口須要被賦予一個權重(weight),當累積的weight超過threshold (default爲255)時則可觸發整個Redundancy Group切換。
配置以下:
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/0 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/1 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/2 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/3 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-8/0/0 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-8/0/1 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-8/0/2 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-8/0/3 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-1/0/0 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-1/0/1 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-1/0/2 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-1/0/3 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-9/0/0 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-9/0/1 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-9/0/2 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-9/0/3 weight 255
commit
至此一個基本的JSRP配置已經完成,其他安全策略部分的配置跟單機相似。
request support information
查看系統啓動信息show system boot-messages
查看存儲相關信息show system storage
查看系統進程信息show system processes extensive
查看系統啓動時間信息show system uptime
查看系統鏈接信息show system connections
CPU利用率覈查show chassis routing-engine
MEM利用率覈查show chassis routing-engine
OSPF鄰居關係覈查show ospf neighbor
BGP鄰居關係檢查show bgp neighbor
HSRP信息檢查 show vrrp extensive
電源狀態覈查show chassis environment pem
風扇狀態覈查show chassis environment
單板告警覈查show chassis alarms
單板狀態覈查show chassis fpc/show chassis fpc pic-status
單板溫度覈查show chassis fpc/show chassis fpc pic-status
單板固件版本信息檢查show chassis fpc detail
接口配置覈查show configuration interfaces
接口描述規範性覈查 show interface descriptions
AAA認證檢查 show configuration system
引擎板冗餘狀態檢查 show configuration chassis redundancy
NTP狀態覈查 show ntp associations
Telnet安全登陸配置檢查 show configuration system login
版本覈查show version
查看配置show configuration
commit check
commit
rollback
查看包含127的路由
show route | find 127
show interfaces terse
terse至關於IOS的brife
配置一個接口:
set interfaces em1 unit 0 family inet address 192.168.1.1/24
delete interfaces em1 unit 0 family inet address 192.168.1.1/24
開啓telnet:
root@RSR04E-1# set services telnet
新建一個用戶 admin
root@RSR04E-1# edit system login
root@RSR04E-1# set user admin class super-user authentication plain-text-password
New password:star123
Retype new password:star123
root@RSR04E-1# edit system services
[edit system services]
root@RSR04E-1# set ssh protocol-version v2
root@RSR04E-1# commit
set routing-options static route 1.1.1.0/10 next-hop 2.2.2.2
恢復出廠設置:
這裏我仍是要細講一下:能夠經過JUNOS CLI的load factory default命令恢復Juniper路由器、交換機的原廠默認配置。load factory default將清空當前JUNOS的活躍配置以及除root用戶之外的全部用戶賬號。另外root用戶的登陸密碼同時被清除:無密碼直接回車登陸。在commit激活JUNOS原廠默認配置以前,你最好也同時設定root用戶的登陸密碼
在清空配置的時候,如提示:
‘system’
Missing mandatory statement: ‘root-authentication’
error: configuration check-out failed: (missing statements)
則須要設置root驗證密碼
root@Juniper# set system root-authentication plain-text-password
New password:
Retype new password:
繼續commit check提示:
[edit]
root@Juniper# commit check
error: cannot create user account: root
error: user name is used by a system account
error: configuration check-out failed: daemon file propagation failed
這是由於以前我已經建立了一個username爲root的帳戶,實際上是我本身理解錯了,set sys root-authen的時候系統會自動建立root用戶,全部只要del掉以前我建立的那個root,check成功,直接commit,配置被清除。
root@Juniper# delete system login user root
[edit]
root@Juniper# commit check
configuration check succeeds
https://learningportal.juniper.net/juniper/user_courses.aspx