-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathef_template.j2
1812 lines (1809 loc) · 54.2 KB
/
ef_template.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#jinja2: lstrip_blocks: "True", trim_blocks: "True"
#############################################
# CTRL+H (Find & Replace)
#############################################
# {{data['<HOSTNAME>']}} - Hostname
# {{data['<EF_LOOPBACK>']}} - Loopback IP address without CIDR mask
# {{data['<PRESHARED_KEY>']}} - Pre-shared key for IKE policy
# {{data['<CS_NAME>']}} - Hostname of CS01
# {{data['<CS_UPLINK_N0>']}} - Name of interface on CS01 n0 that uplinks to this port
# {{data['<CS_UPLINK_N1>']}} - Name of interface on CS01 n1 that uplinks to this port
# {{data['<VL901_EF01>']}} - IP address of EF01 downlink to CS01
# {{data['<WAN1_ISPNAME>']}} - Provider name for ISP1
# {{data['<WAN1_CKT_ID>']}} - Circuit ID
# {{data['<WAN1_SUPPORT_NO>']}} - Support number
# {{data['<WAN1_UP>']}} - Upload speed of ISP1, provide suffix (b, k, m, g, etc.)
# {{data['<WAN1_DOWN>']}} - Download speed of ISP1, provide suffix (b, k, m, g, etc.)
# {{data['<WAN1_IP>']}} - WAN1 IP address with CIDR mask
# {{data['<WAN1_GW>']}} - WAN1 IP address of gateway
# {{data['<WAN2_ISPNAME>']}} - Provider name for ISP2
# {{data['<WAN2_CKT_ID>']}}- Circuit ID
# {{data['<WAN2_SUPPORT_NO>']}} - Support number
# {{data['<WAN2_UP>']}} - Upload speed of ISP2, provide suffix (b, k, m, g, etc.)
# {{data['<WAN2_DOWN>']}} - Download speed of ISP2, provide suffix (b, k, m, g, etc.)
# {{data['<WAN2_IP>']}} - WAN2 IP address with CIDR mask
# {{data['<WAN2_GW>']}}- WAN2 IP address of gateway
# {{data['<ATL_TUN1_IP>']}} - IP address ATL tunnel 1
# {{data['<ATL_TUN2_IP>']}} - IP address ATL tunnel 2
# {{data['<DAL_TUN1_IP>']}} - IP address DAL tunnel 1
# {{data['<DAL_TUN2_IP>']}} - IP address DAL tunnel 2
# {{data['<SITE_ADDRESS>']}} - Physical site address
# {{data['<VL901_CS01>']}} - IP address of CS01 on VL901
# {{data['<SITE_SUPERNET>']}} - Site supernet including CIDR mask (e.g. 10.65.0.0/22)
# {{data['<BGP_ASN>']}} - ASN of branch office
# {{data['<ATL_TUN1_PEER>']}} - IP address of BGP peer on ATL tunnel 1
# {{data['<ATL_TUN2_PEER>']}} - IP address of BGP peer on ATL tunnel 2
# {{data['<DAL_TUN1_PEER>']}} - IP address of BGP peer on DAL tunnel 1
# {{data['<DAL_TUN2_PEER>']}} - IP address of BGP peer on DAL tunnel 2
#############################################
# EF v1.0 - 06/03/2019
#############################################
groups {
node0 {
system {
syslog {
file default-log-messages {
any any;
match "(requested 'commit' operation)|(copying configuration to juniper.save)|(commit complete)|ifAdminStatus|(FRU power)|(FRU removal)|(FRU insertion)|(link UP)|transitioned|Transferred|transfer-file|(license add)|(license delete)|(package -X update)|(package -X delete)|(FRU Online)|(FRU Offline)|(plugged in)|(unplugged)|GRES|(AIS_DATA_AVAILABLE)";
structured-data;
}
}
}
}
node1 {
system {
syslog {
file default-log-messages {
any any;
match "(requested 'commit' operation)|(copying configuration to juniper.save)|(commit complete)|ifAdminStatus|(FRU power)|(FRU removal)|(FRU insertion)|(link UP)|transitioned|Transferred|transfer-file|(license add)|(license delete)|(package -X update)|(package -X delete)|(FRU Online)|(FRU Offline)|(plugged in)|(unplugged)|GRES|(AIS_DATA_AVAILABLE)";
structured-data;
}
}
}
}
PROTECT-RE-GROUP {
interfaces {
lo0 {
unit <*> {
family inet {
filter {
input PROTECT-RE;
}
}
}
}
}
policy-options {
prefix-list DII-SNMP-HOSTS {
/* - ATL Jump Box Subnet */
10.3.0.0/24;
/* - ATL Netmon Subnet */
10.3.4.0/24;
/* - AWS Management Subnet */
10.135.0.0/23;
}
prefix-list localhost {
127.0.0.1/32;
apply-path "interfaces lo0 unit <*> family inet address <*>";
}
prefix-list DII-RADIUS-SRVS {
apply-path "system radius-server <*.*>";
}
prefix-list NTP-PEERS-IPV4 {
apply-path "system ntp server <*.*>";
}
prefix-list DII-NTP-SERVER {
apply-path "system ntp server <*>";
}
prefix-list DII-DNS-SERVERS {
apply-path "system name-server <*>";
}
prefix-list DII-BGP-NEIGHBORS-GLOBAL {
apply-path "protocols bgp group <*> neighbor <*>";
}
prefix-list DII-BGP-NEIGHBORS-ROUTING-INSTANCES {
apply-path "routing-instances <*> protocols bgp group <*> neighbor <*>";
}
prefix-list DII-RADIUS-SERVERS {
apply-path "system radius-server <*>";
}
prefix-list DII-LOCAL-INTERFACES {
apply-path "interfaces <*> unit <*> family inet address <*>";
}
prefix-list ospf {
224.0.0.5/32;
224.0.0.6/32;
}
prefix-list vrrp {
224.0.0.18/32;
}
prefix-list DII-RFC1918 {
/* - Internal Subnets */
10.0.0.0/8;
172.16.0.0/12;
192.168.0.0/16;
}
}
firewall {
family inet {
filter PROTECT-RE {
term DISCARD-FRAGMENTS {
from {
is-fragment;
}
then {
discard;
}
}
term ACCEPT-ICMP {
from {
protocol icmp;
icmp-type [ echo-reply echo-request unreachable time-exceeded ];
}
then accept;
}
term ACCEPT-TRACEROUTE-UDP {
from {
protocol udp;
port 33434-33534;
}
then accept;
}
term ACCEPT-SSH {
from {
source-prefix-list {
DII-RFC1918;
DII-MGMT-SSH-PUBLIC-IP;
}
protocol tcp;
port ssh;
}
then accept;
}
term ACCEPT-SNMP {
from {
source-prefix-list {
DII-SNMP-HOSTS;
}
protocol udp;
port snmp;
}
then accept;
}
term ACCEPT-NTP {
from {
source-prefix-list {
localhost;
DII-NTP-SERVER;
}
protocol udp;
port ntp;
}
then accept;
}
term ACCEPT-DNS {
from {
source-prefix-list {
DII-DNS-SERVERS;
}
protocol [ udp tcp ];
port domain;
}
then accept;
}
term ACCEPT-BFD {
from {
protocol udp;
port [ 3784-3785 4784 49152-65535 ];
}
then accept;
}
term ACCEPT-BGP {
from {
source-prefix-list {
DII-BGP-NEIGHBORS-GLOBAL;
DII-BGP-NEIGHBORS-ROUTING-INSTANCES;
}
protocol tcp;
port bgp;
}
then accept;
}
term ACCEPT-OSPF {
from {
source-prefix-list {
DII-LOCAL-INTERFACES;
}
protocol ospf;
}
then accept;
}
term ACCEPT-VRRP {
from {
source-prefix-list {
DII-LOCAL-INTERFACES;
}
protocol [ vrrp ah ];
}
then accept;
}
term ACCEPT-VPN {
from {
protocol [ udp esp ];
port [ 500 4500 ];
}
then accept;
}
term ACCEPT-RADIUS {
from {
source-prefix-list {
DII-RADIUS-SERVERS;
}
protocol udp;
port [ radacct radius ];
}
then accept;
}
term ACCEPT-DHCP {
from {
protocol udp;
port [ bootps bootpc ];
}
then accept;
}
term TCP-ESTABLISHED {
from {
protocol tcp;
tcp-established;
}
then accept;
}
term DISCARD {
then {
discard;
}
}
}
}
}
}
}
apply-groups [ "${node}" PROTECT-RE-GROUP ];
system {
host-name {{data['<HOSTNAME>']}};
time-zone UTC;
internet-options {
path-mtu-discovery;
tcp-drop-synfin-set;
}
authentication-order radius;
ports {
console {
authentication-order radius;
log-out-on-disconnect;
}
{%- if data['<MODEL>'] is not in ['SRX100', 'SRX210', 'SRX240'] %}
auxiliary port-type mini-usb;
{% endif %}
}
root-authentication {
encrypted-password ""; ## SECRET-DATA
}
name-server {
10.3.33.55 source-address {{data['<EF_LOOPBACK>']}};
}
radius-server {
10.132.8.128 {
port 1812;
secret ""; ## SECRET-DATA
timeout 1;
source-address {{data['<EF_LOOPBACK>']}};
}
10.132.10.152 {
port 1812;
secret "$"; ## SECRET-DATA
timeout 1;
source-address {{data['<EF_LOOPBACK>']}};
}
}
radius-options {
password-protocol mschap-v2;
}
accounting {
events [ login change-log interactive-commands ];
destination {
radius;
}
}
login {
message "\n\nWARNING: Restricted System, Property of . or its subsidiaries.\nThis computer system is for OFFICIAL USE ONLY by specifically authorized \npersonnel and includes confidential, proprietary and privileged information. \nThis system may be subject to monitoring. No expectation of privacy is to be \nassumed. Unauthorized attempts to upload, download or change information on \nthis system or other unauthorized activities are subject to disciplinary action \nincluding termination and criminal and civil prosecution. By continuing to use \nthis system you indicate your awareness of and consent to these terms and \nconditions of use.\n\n\n";
retry-options {
tries-before-disconnect 3;
backoff-threshold 1;
backoff-factor 5;
lockout-period 10;
}
{%- if data['<MODEL>'] is not in ['SRX210', 'SRX240'] %}
idle-timeout 60;
{%- endif %}
user user {
uid 2001;
class super-user;
authentication {
encrypted-password ""; ## SECRET-DATA
}
}
user remote {
full-name "RADIUS Remote Users";
uid 2100;
class super-user;
}
}
services {
ssh {
root-login deny;
no-tcp-forwarding;
protocol-version v2;
max-sessions-per-connection 10;
{%- if data['<MODEL>'] is not in ['SRX100', 'SRX210', 'SRX240'] %}
sftp-server;
{% endif %}
ciphers [ aes256-ctr "[email protected]" "[email protected]" aes256-cbc ];
macs [ "[email protected]" hmac-sha2-256 "[email protected]" "[email protected]" "[email protected]" ];
key-exchange [ curve25519-sha256 group-exchange-sha2 ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 ];
client-alive-count-max 4;
client-alive-interval 10;
hostkey-algorithm {
no-ssh-dss;
ssh-rsa;
no-ssh-ecdsa;
ssh-ed25519;
}
fingerprint-hash sha2-256;
connection-limit 30;
rate-limit 5;
}
netconf {
ssh;
{%- if data['<MODEL>'] is not in ['SRX210', 'SRX240'] %}
rfc-compliant;
{%- endif %}
}
}
syslog {
archive size 1m files 10 world-readable;
user * {
any emergency;
}
host 10.3.64.68 {
any info;
authorization any;
structured-data {
brief;
}
}
host 10.3.4.27 {
any notice;
explicit-priority;
}
host 10.3.4.67 {
any info;
explicit-priority;
}
host 10.135.1.117 {
any info;
explicit-priority;
}
host 10.135.1.209 {
any info;
explicit-priority;
}
host 10.135.1.234 {
any info;
explicit-priority;
}
file messages {
any warning;
authorization error;
}
file interactive-commands {
interactive-commands info;
}
file kmd-logs {
daemon info;
match KMD;
}
file authorization {
authorization error;
match User;
}
time-format year millisecond;
source-address {{data['<EF_LOOPBACK>']}};
}
ntp {
server 199.255.122.221 version 4;
server 199.68.212.201 version 4;
}
}
chassis {
usb {
storage {
disable;
}
}
{%- if data['<EF_TYPE>'] == 'Cluster' %}
cluster {
control-link-recovery;
reth-count 3;
heartbeat-interval 1000;
heartbeat-threshold 3;
redundancy-group 0 {
node 0 priority 200;
node 1 priority 100;
}
redundancy-group 1 {
node 0 priority 200;
node 1 priority 100;
preempt;
interface-monitor {
{%- if data['<MODEL>'] == 'SRX300' %}
ge-0/0/5 weight 255;
ge-1/0/5 weight 255;
{%- endif %}
{%- if data['<MODEL>'] == 'SRX320' %}
ge-0/0/4 weight 255;
ge-3/0/4 weight 255;
{%- endif %}
{%- if data['<MODEL>'] == 'SRX340' %}
ge-0/0/5 weight 255;
ge-5/0/5 weight 255;
{%- endif %}
{%- if data['<MODEL>'] == 'SRX1500' %}
ge-0/0/5 weight 255;
ge-7/0/5 weight 255;
{%- endif %}
}
}
redundancy-group 2 {
node 0 priority 200;
node 1 priority 100;
preempt;
}
redundancy-group 3 {
node 0 priority 100;
node 1 priority 200;
preempt;
}
}
{%- endif %}
}
{%- if data['<EF_TYPE>'] == 'Cluster' %}
services {
rpm {
probe ISP1 {
test ISP1 {
target address 8.8.8.8;
probe-count 3;
probe-interval 10;
test-interval 5;
routing-instance VR_ISP_1;
thresholds {
successive-loss 3;
total-loss 3;
}
}
}
}
}
{%- endif %}
security {
log {
mode stream;
format sd-syslog;
source-address {{data['<EF_LOOPBACK>']}};
stream strm {
category all;
host {
10.3.64.68;
port 514;
}
}
}
ike {
{%- if data['<DHCP>'] == 'Yes' %}
proposal IKE-PRE-G2-3DES-SHA {
authentication-method pre-shared-keys;
authentication-algorithm sha1;
encryption-algorithm 3des-cbc;
}
{%- endif %}
proposal IKE-PROPOSAL-DYC19 {
authentication-method pre-shared-keys;
dh-group group24;
encryption-algorithm aes-256-gcm;
lifetime-seconds 28800;
}
{%- if data['<DHCP>'] == 'No' %}
policy IKE-POLICY {
proposals IKE-PROPOSAL-DYC19;
pre-shared-key ascii-text "{{data['<PRESHARED_KEY>']}}";
}
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
policy IKE-POLICY-DYNAMIC {
mode aggressive;
proposals IKE-PRE-G2-3DES-SHA;
pre-shared-key ascii-text " "; ## SECRET-DATA
}
policy IKEv2-POLICY-DYNAMIC {
proposals IKE-PROPOSAL-DYC19;
pre-shared-key ascii-text ""; ## SECRET-DATA
}
{%- endif %}
gateway IKE-GW-ATL-P {
{%- if data['<DHCP>'] == 'No' %}
ike-policy IKE-POLICY;
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
ike-policy IKE-POLICY-DYNAMIC;
{%- endif %}
address 209.64.225.210;
{%- if data['<EF_TYPE>'] == 'Cluster' %}
external-interface reth1.0;
{%- endif %}
{%- if data['<MODEL>'] is in ['SRX240', 'SRX300', 'SRX320', 'SRX340', 'SRX1500'] and data['<EF_TYPE>'] != 'Cluster' %}
external-interface ge-0/0/4.0;
{%- endif %}
{%- if data['<MODEL>'] is in ['SRX210'] and data['<EF_TYPE>'] != 'Cluster' %}
external-interface ge-0/0/0.0;
{%- endif %}
{%- if data['<DHCP>'] == 'No' %}
version v2-only;
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
local-identity hostname {{data['<IKEHOST>']}};
{%- endif %}
}
{%- if data['<EF_TYPE>'] == 'Cluster' %}
gateway IKE-GW-ATL-B {
ike-policy IKE-POLICY;
address 209.64.225.210;
external-interface reth2.0;
version v2-only;
}
{%- endif %}
gateway IKE-GW-DAL-P {
{%- if data['<DHCP>'] == 'No' %}
ike-policy IKE-POLICY;
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
ike-policy IKEv2-POLICY-DYNAMIC;
{%- endif %}
address 209.64.241.210;
{%- if data['<EF_TYPE>'] == 'Cluster' %}
external-interface reth1.0;
{%- endif %}
{%- if data['<MODEL>'] is in ['SRX240', 'SRX300', 'SRX320', 'SRX340', 'SRX1500'] and data['<EF_TYPE>'] != 'Cluster' %}
external-interface ge-0/0/4.0;
{%- endif %}
{%- if data['<MODEL>'] is in ['SRX210'] and data['<EF_TYPE>'] != 'Cluster' %}
external-interface ge-0/0/0.0;
{%- endif %}
version v2-only;
{%- if data['<DHCP>'] == 'Yes' %}
local-identity hostname {{data['<IKEHOST>']}};
{%- endif %}
}
{%- if data['<EF_TYPE>'] == 'Cluster' %}
gateway IKE-GW-DAL-B {
ike-policy IKE-POLICY;
address 209.64.241.210;
external-interface reth2.0;
version v2-only;
}
{%- endif %}
}
ipsec {
vpn-monitor-options {
interval 2;
threshold 4;
}
{%- if data['<DHCP>'] == 'Yes' %}
proposal IPSEC-ESP-AES256-SHA {
protocol esp;
authentication-algorithm hmac-sha1-96;
encryption-algorithm aes-256-cbc;
lifetime-seconds 3600;
}
{%- endif %}
proposal IPSEC-DYC19 {
protocol esp;
encryption-algorithm aes-256-gcm;
lifetime-seconds 27000;
}
{%- if data['<DHCP>'] == 'Yes' %}
policy IPSEC-POLICY {
proposals IPSEC-ESP-AES256-SHA;
}
{%- endif %}
{%- if data['<DHCP>'] == 'No' %}
policy IPSEC-POLICY {
perfect-forward-secrecy {
keys group24;
}
proposals IPSEC-DYC19;
}
{%- endif %}
vpn VPN-ATL-P {
bind-interface st0.0;
vpn-monitor {
optimized;
source-interface st0.0;
destination-ip {{data['<ATL_TUN1_PEER>']}};
}
ike {
gateway VPN-ATL-P;
{%- if data['<DHCP>'] == 'No' %}
ipsec-policy IPSEC-POLICY;
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
ipsec-policy IPSEC-DYC19;
{%- endif %}
}
establish-tunnels immediately;
}
{%- if data['<EF_TYPE>'] == 'Cluster' %}
vpn VPN-ATL-B {
bind-interface st0.1;
vpn-monitor {
optimized;
source-interface st0.1;
destination-ip {{data['<ATL_TUN2_PEER>']}};
}
ike {
gateway VPN-ATL-B;
{%- if data['<DHCP>'] == 'No' %}
ipsec-policy IPSEC-POLICY;
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
ipsec-policy IPSEC-DYC19;
{%- endif %}
}
establish-tunnels immediately;
}
{%- endif %}
vpn VPN-DAL-P {
bind-interface st0.10;
vpn-monitor {
optimized;
source-interface st0.10;
destination-ip {{data['<DAL_TUN1_PEER>']}};
}
ike {
gateway VPN-DAL-P;
{%- if data['<DHCP>'] == 'No' %}
ipsec-policy IPSEC-POLICY;
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
ipsec-policy IPSEC-DYC19;
{%- endif %}
}
establish-tunnels immediately;
}
{%- if data['<EF_TYPE>'] == 'Cluster' %}
vpn VPN-DAL-B {
bind-interface st0.11;
vpn-monitor {
optimized;
source-interface st0.11;
destination-ip {{data['<DAL_TUN2_PEER>']}};
}
ike {
gateway VPN-DAL-B;
{%- if data['<DHCP>'] == 'No' %}
ipsec-policy IPSEC-POLICY;
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
ipsec-policy IPSEC-DYC19;
{%- endif %}
}
establish-tunnels immediately;
}
{%- endif %}
}
forwarding-options {
family {
inet6 {
mode flow-based;
}
}
}
flow {
tcp-mss {
all-tcp {
mss 1452;
}
ipsec-vpn {
mss 1350;
}
}
}
nat {
source {
rule-set TRUST-to-UNTRUST {
from zone [ TRUST junos-host ];
to zone [ UNTRUST_ISP_1 UNTRUST_ISP_2 ];
rule source-nat-rule {
match {
source-address 0.0.0.0/0;
}
then {
source-nat {
interface;
}
}
}
}
}
}
policies {
global {
policy TRUST-TO-UNTRUST {
match {
source-address any;
destination-address any;
application any;
from-zone TRUST;
to-zone [ UNTRUST_ISP_1 UNTRUST_ISP_2 ];
}
then {
permit;
log {
session-close;
}
}
}
policy TRUST-VPN {
match {
source-address any;
destination-address any;
application any;
from-zone [ TRUST VPN ];
to-zone [ TRUST VPN ];
}
then {
permit;
log {
session-close;
}
}
}
}
}
zones {
security-zone TRUST {
host-inbound-traffic {
system-services {
ping;
snmp;
ssh;
traceroute;
}
}
interfaces {
lo0.0;
{%- if data['<EF_TYPE>'] == 'Cluster' %}
reth0.901;
{%- endif %}
{%- if data['<EF_TYPE>'] == 'Single' and data['<MODEL>'] != 'SRX210' %}
ge-0/0/5.0;
{%- endif %}
{%- if data['<EF_TYPE>'] == 'Single' and data['<MODEL>'] == 'SRX210' %}
ge-0/0/1.0;
{%- endif %}
}
}
security-zone UNTRUST_ISP_1 {
host-inbound-traffic {
system-services {
dhcp;
ike;
ping;
ssh;
traceroute;
}
}
interfaces {
{%- if data['<EF_TYPE>'] == 'Single' and data['<MODEL>'] != 'SRX210' %}
ge-0/0/4.0;
{%- endif %}
{%- if data['<EF_TYPE>'] == 'Single' and data['<MODEL>'] == 'SRX210' %}
ge-0/0/0.0;
{%- endif %}
{%- if data['<EF_TYPE>'] == 'Cluster' %}
reth1.0;
{%- endif %}
}
}
security-zone UNTRUST_ISP_2 {
host-inbound-traffic {
system-services {
dhcp;
ike;
ping;
ssh;
traceroute;
}
}
{%- if data['<EF_TYPE>'] == 'Cluster' %}
interfaces {
reth2.0;
}
{%- endif %}
}
security-zone VPN {
host-inbound-traffic {
system-services {
ping;
snmp;
ssh;
traceroute;
}
protocols {
bgp;
}
}
interfaces {
st0.0;
st0.10;
{%- if data['<EF_TYPE>'] == 'Cluster' %}
st0.1;
st0.11;
{%- endif %}
}
}
}
}
interfaces {
{%- if data['<EF_TYPE>'] == 'Single' and data['<MODEL>'] != 'SRX210' %}
ge-0/0/4 {
description "ISP - {{data['<WAN1_ISPNAME>']}} - {{data['<WAN1_DOWN>']}}/{{data['<WAN1_UP>']}} - {{data['<WAN1_CKT_ID>']}} - {{data['<WAN1_SUPPORT_NO>']}}";
per-unit-scheduler;
unit 0 {
bandwidth {{data['<WAN1_DOWN>']}};
{%- if data['<DHCP>'] == 'No' %}
family inet address {{data['<WAN1_IP>']}};
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
family inet dhcp;
{%- endif %}
}
}
ge-0/0/5 {
description "{{data['<CS_NAME>']}} ge-0/0/{{data['<CORE_PORTS>']}}";
unit 0 {
family inet address {{data['<VL901_EF01>']}}/31;
}
}
{%- endif %}
{%- if data['<EF_TYPE>'] == 'Single' and data['<MODEL>'] == 'SRX210' %}
ge-0/0/0 {
description "ISP - {{data['<WAN1_ISPNAME>']}} - {{data['<WAN1_DOWN>']}}/{{data['<WAN1_UP>']}} - {{data['<WAN1_CKT_ID>']}} - {{data['<WAN1_SUPPORT_NO>']}}";
per-unit-scheduler;
unit 0 {
bandwidth {{data['<WAN1_DOWN>']}};
{%- if data['<DHCP>'] == 'No' %}
family inet address {{data['<WAN1_IP>']}};
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
family inet dhcp;
{%- endif %}
}
}
ge-0/0/1 {
description "{{data['<CS_NAME>']}} ge-0/0/{{data['<CORE_PORTS>']}}";
unit 0 {
family inet address {{data['<VL901_EF01>']}}/31;
}
}
{%- endif %}
{%- if data['<EF_TYPE>'] == 'Single' and data['<MODEL>'] == 'SRX240' %}
ge-0/0/4 {
description "ISP - {{data['<WAN1_ISPNAME>']}} - {{data['<WAN1_DOWN>']}}/{{data['<WAN1_UP>']}} - {{data['<WAN1_CKT_ID>']}} - {{data['<WAN1_SUPPORT_NO>']}}";
per-unit-scheduler;
unit 0 {
bandwidth {{data['<WAN1_DOWN>']}};
{%- if data['<DHCP>'] == 'No' %}
family inet address {{data['<WAN1_IP>']}};
{%- endif %}
{%- if data['<DHCP>'] == 'Yes' %}
family inet dhcp;
{%- endif %}
}
}
ge-0/0/5 {
description "{{data['<CS_NAME>']}} ge-0/0/{{data['<CORE_PORTS>']}}";
unit 0 {
family inet address {{data['<VL901_EF01>']}}/31;
}
}
{%- endif %}
{%- if data['<EF_TYPE>'] == 'Cluster' and data['<MODEL>'] == 'SRX300' %}
ge-0/0/4 {
description "ISP - {{data['<WAN1_ISPNAME>']}} - {{data['<WAN1_DOWN>']}}/{{data['<WAN1_UP>']}} - {{data['<WAN1_CKT_ID>']}} - {{data['<WAN1_SUPPORT_NO>']}}";
gigether-options {
redundant-parent reth1;
}
}
ge-0/0/5 {
description "{{data['<CS_NAME>']}} ge-0/0/{{data['<CORE_PORTS>']}}";
gigether-options {
redundant-parent reth0;
}
}
ge-1/0/4 {
description "ISP - {{data['<WAN2_ISPNAME>']}} - {{data['<WAN2_DOWN>']}}/{{data['<WAN2_UP>']}} - {{data['<WAN2_CKT_ID>']}} - {{data['<WAN2_SUPPORT_NO>']}}";
gigether-options {
redundant-parent reth2;
}
}
ge-1/0/5 {
description "{{data['<CS_NAME>']}} ge-0/0/{{data['<CORE_PORTS>']}}";
gigether-options {
redundant-parent reth0;
}
}
fab0 {
fabric-options {
member-interfaces {
ge-0/0/2;
}
}
}
fab1 {
fabric-options {
member-interfaces {
ge-1/0/2;
}
}
}
fab1 {
fabric-options {
member-interfaces {
ge-7/0/2;
}
}
}
{%- endif %}
{%- if data['<EF_TYPE>'] == 'Cluster' and data['<MODEL>'] == 'SRX320' %}
ge-0/0/4 {
description "ISP - {{data['<WAN1_ISPNAME>']}} - {{data['<WAN1_DOWN>']}}/{{data['<WAN1_UP>']}} - {{data['<WAN1_CKT_ID>']}} - {{data['<WAN1_SUPPORT_NO>']}}";
gigether-options {
redundant-parent reth1;
}
}
ge-0/0/5 {
description "{{data['<CS_NAME>']}} ge-0/0/{{data['<CORE_PORTS>']}}";
gigether-options {
redundant-parent reth0;
}
}
ge-3/0/4 {
description "ISP - {{data['<WAN2_ISPNAME>']}} - {{data['<WAN2_DOWN>']}}/{{data['<WAN2_UP>']}} - {{data['<WAN2_CKT_ID>']}} - {{data['<WAN2_SUPPORT_NO>']}}";
gigether-options {
redundant-parent reth2;
}
}
ge-3/0/5 {
description "{{data['<CS_NAME>']}} ge-0/0/{{data['<CORE_PORTS>']}}";
gigether-options {