forked from colinbodor/projectton
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJuniper.conf
More file actions
71 lines (58 loc) · 1.95 KB
/
Juniper.conf
File metadata and controls
71 lines (58 loc) · 1.95 KB
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
# Created by Kelvin Tran - https://www.linkedin.com/in/tran-kelvin
# OPTIONAL - if you're on an SRX platform, make sure to allow BGP through in your security zone
set security zone security-zone YOURSECZONENAME host-inbound-traffic protocols bgp
# Create null routes for blackholes
edit routing-options static
set route 192.0.2.1/32 discard
set route 2001:DB8:0:DEAD:BEEF::1/128 discard
top
# Create export policy allowing nothing
edit policy-options policy-statement AllowNothing
set then reject
top
# Create community-lists
set policy-option community CL_CountryCodes members 65535:3166
set policy-option community CL_BlockCountry members [ 3166:1234 3166:5678 ]
set policy-option community CL_Blackhole members 65535:666
# Create import policy to black hole based on community
edit policy-options policy-statement PTON-Blackhole
edit term v4-Blackhole
set from community CL_BlockCountry
set from family inet
set then accept next-hop 192.0.2.1
exit
edit term v6-Blackhole
set from community CL_BlockCountry
set from family inet6
set then accept next-hop 2001:DB8:0:DEAD:BEEF::1
exit
edit term v4-BlockCountry
set from community CL_BlockCountry
set from family inet
set then accept next-hop 192.0.2.1
exit
edit term v6-BlockCountry
set from community CL_BlockCountry
set from family inet6
set then accept next-hop 2001:DB8:0:DEAD:BEEF::1
exit
edit term LeaveTheRestAlone
set from community CL_CountryCodes
set then reject
top
# Set protocol-agnostic routing protocol parameters
set routing-options router-id YOURROUTERIDHERE
set routing-options autonomous-system YOURASNHERE
# Set BGP specific configuration
edit protocols bgp
edit group PTON
set neighbor 162.208.89.180
set peer-as 4212345678
set multihop
# OPTIONAL - use only if you're not sourcing from physical interface (erase everything before/including the forward slash ->) / set local-address <IP address>
set export AllowNothing
set import PTON-Blackhole
set type external
# Commit
top
commit comment PTONCommit and-quit