单位最近更新防火墙,打算把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