Juniper Netscreen NSRP (Netscreen  Standby Redundancy Protocol)
1. NSRP 两种工作模式:
    1-1)Active/Active: 类似于Cisco HSRP做load balancing.
    1-2)Active/Standby 类似于没有做Load balancing的HSRP.

2、NSRP典型结构与配置
       2.1、Layer3 口型A/P组网模式
       Layer3  口型A/P组网模式是当前很多企业广泛采用的HA模式,该模式具有对网络环境要求不高,无需网络结构做较大调整,具有较好冗余性、便于管理维护等优点。缺 点是Netscreen防火墙利用率不高,同一时间只有一台防火墙处理网络流量;冗余程度有限,仅在一侧链路和设备出现故障时提供冗余切换。Layer3  口型组网A/P模式具有较强冗余性、低端口成本和网络结构简单、便于维护管理等角度考虑,成为很多企业选用该组网模式的标准。
配置说明:两台Netscreen设备采用相同硬件型号和软件版本,组成Active/Passive冗余 模式,两台防火墙均使用一致的Ethernet接口编号连接到网络。通过双HA端口或将2Ethernet接口放入HA区段,其中控制链路用于NSRP心 跳信息、配置信息和Session会话同步,数据链路用于在两防火墙间必要时传输数据流量。
       NS-A(主用):
       Set hostname NS-A /***定义主机名***/
       Set interface ethernet1 zone untrust
       Set interface ethernet1 ip 100.1.1.4/29
       Set interface ethernet1 route
       Set interface ethernet2 zone trust
       Set interface ethernet2 ip 192.168.1.4/29
       Set interface ethernet2 route
       Set interface mgt ip 192.168.2.1/24 /***通过管理口远程管理NS-A***/
       /***配置接口:Untrust/Trust Layer3 路由模式***/
       Set interface ethernet3 zone HA
       Set interface ethernet4 zone HA
       /***Eth3和Eth4口用于HA互连,用于同步配置文件、会话信息和跟踪设备状态信息***/
       set nsrp cluster id 1
       set nsrp rto-mirror sync
       set nsrp vsd-group id 0 priority 50 /***缺省值为100,低值优先成为主用设备***/
       set nsrp monitor interface ethernet2
       set nsrp monitor interface ethernet1
       /***配置NSRP:Vsd-group缺省为0,VSI使用物理接口IP地址,非抢占模式***/
       NS-B(备用):
       Set hostname NS-B /***定义主机名***/
       Set interface ethernet1 zone Untrust
       Set interface ethernet1 ip 100.1.1.4/29
       Set interface ethernet1 route
       Set interface ethernet2 zone trust
       Set interface ethernet2 ip 192.168.1.4/29
       Set interface ethernet2 route
       Set interface mgt ip 192.168.2.2/24 /***通过管理口远程管理NS-A***/
       /***配置接口:Untrust/Trust Layer3 路由模式***/
       Set interface ethernet3 zone HA
       Set interface ethernet4 zone HA
       /***Eth3和Eth4口用于HA互连,用于同步配置文件、会话信息和跟踪设备状态信息***/
       set nsrp cluster id 1
       set nsrp rto-mirror sync
       set nsrp vsd-group id 0 priority 100
       set nsrp monitor interface ethernet2
       set nsrp monitor interface ethernet1
       /***Vsd-group缺省为0,VSI使用物理接口IP地址,备用设备:优先级100,成为非抢占模式***/
       2.2、Layer3 Fullmesh A/P组网模式
       Layer3  Fullmesh连接A/P组网使用全交叉网络连接模式,容许在同一设备上提供链路级冗余,发生链路故障时,由备用链路接管网络流量,防火墙间无需进行状 态切换。仅在上行或下行两条链路同时发生故障情况下,防火墙才会进行状态切换,Fullmesh连接进一步提高了业务的可靠性。该组网模式在提供设备冗余 的同时提供链路级冗余,成为很多企业部署关键业务时的最佳选择。
       NS-A(Active):
       Set hostname NS-A /***定义主机名***/
       Set interface mgt ip 192.168.2.1/24 /***通过管理口远程管理NS-A***/
       Set interface red1 zone Untrust /***创建冗余接口1***/
       Set interface e1 zone null
       Set interface e1 group red1
       Set interface e2 zone null
       Set interface e2 group red1
       Set interface red1 ip 10.1.1.4/29
       Set interface red2 zone trust
       Set interface e3 zone null
       Set interface e3 group red2
       Set interface e4 zone null
       Set interface e4 group red2
       Set interface red2 ip 192.168.1.4/29
       /***配置接口:Untrust/Trust Layer3 路由模式***/
       Set interface ethernet7 zone ha
       Set interface ethernet8 zone ha
       set nsrp cluster id 1
       set nsrp rto-mirror sync /***容许会话信息自动同步***/
       set nsrp vsd-group id 0 priority 50
       set nsrp monitor interface ethernet2
       set nsrp monitor interface ethernet1
       /***配置NSRP:Vsd-group缺省为0,VSI使用物理接口IP地址,优先级为50,非抢占模式***/
       NS-B(Backup):
       Set hostname NS-B /***定义主机名***/
       Set interface mgt ip 192.168.2.2/24 /***通过管理口远程管理NS-A***/
       Set interface red1 zone Untrust /***创建冗余接口***/
       Set interface e1 zone null
       Set interface e1 group red1 /***将该物理接口放置到冗余接口中***/
       Set interface e2 zone null
       Set interface e2 group red1
       Set interface red1 ip 10.1.1.4/29
       Set interface red2 zone trust
       Set interface e3 zone null
       Set interface e3 group red2
       Set interface e4 zone null
       Set interface e4 group red2
       Set interface red2 ip 192.168.1.4/29
       /***配置接口:Untrust/Trust Layer3 路由模式***/
       Set interface ethernet7 zone ha
       Set interface ethernet8 zone ha
       set nsrp cluster id 1
       set nsrp rto-mirror sync /***容许会话信息自动同步***/
       set nsrp vsd-group id 0 priority 100
       set nsrp monitor interface ethernet2
       set nsrp monitor interface ethernet1
       /***Vsd-group缺省为0,VSI使用物理接口IP地址,备用设备***/

3. Trouble shooting commands:
1、get license-key
查看防火墙支持的feature,其中NSRPA/A模式包含了A/P模式,A/P模式不支持A/A模式。Lite版本是简化版,支持设备和链路冗余切 换,不支持配置和会话同步。
2、exec nsrp sync global-config check-sum
检查双机配置命令是否同步
3、exec nsrp sync global-config save
如双机配置信息没有自动同步,请手动执行此同步命令,需重启系统。
4、get nsrp
查看NSRP集群中设备状态、主备关系、会话同步以及参数开关信息
5、Exec nsrp sync rto all from peer
手动执行RTO信息同步,使双机保持会话信息一致
6、exec nsrp vsd-group 0 mode backup
手动进行主备状态切换时,在主用设备上执行该切换命令,此时该主用设备没有启用抢占模式。
7、exec nsrp vsd-group 0 mode ineligible
手动进行主备状态切换时,在主用设备上执行该切换命令,此时该主用设备已启用抢占模式。
8、get alarm event
检查设备告警信息,其中将包含NSRP状态切换信息