-
Notifications
You must be signed in to change notification settings - Fork 18
/
provision-router.yml
364 lines (360 loc) · 10.8 KB
/
provision-router.yml
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
# Can't run util next CIX trip, talk to canty
# - name: "Provision router"
# hosts: router
# vars_files:
# - vars/network.yml
# tasks:
# - set_fact:
# config_path: "/tmp/router-config-{{ 100000000000 | random }}.boot"
# # Base config, don't touch this without talking to canty pls
# - copy:
# dest: "{{ config_path }}"
# content: |
# firewall {
# all-ping enable
# broadcast-ping disable
# config-trap disable
# ipv6-receive-redirects disable
# ipv6-src-route disable
# ip-src-route disable
# log-martians enable
# name infra-user {
# default-action accept
# }
# name infra-wan {
# default-action accept
# }
# name user-infra {
# default-action accept
# }
# name user-wan {
# default-action accept
# }
# name vmhost-wan {
# default-action accept
# }
# name wan-infra {
# default-action accept
# }
# name wan-user {
# default-action accept
# }
# name wan-vmhost {
# default-action accept
# }
# receive-redirects disable
# send-redirects enable
# source-validation disable
# syn-cookies enable
# twa-hazards-protection disable
# }
# interfaces {
# ethernet eth0 {
# vif 10 {
# address 10.0.0.99/24
# address 84.39.234.53/29
# address 84.39.234.52/29
# }
# vif 20 {
# address 10.0.20.1/24
# }
# vif 30 {
# address 10.0.30.1/24
# }
# vif 40 {
# address 10.0.40.1/24
# }
# vif 90 {
# address 10.0.90.1/24
# }
# }
# loopback lo {
# }
# }
# nat {
# destination {
# rule 800 {
# destination {
# address 84.39.234.53
# port 80,443
# }
# inbound-interface eth0.10
# protocol tcp
# translation {
# address {{ interfaces.managerN.net0.addresses[0] | ipaddr('address') }}
# }
# }
# rule 801 {
# destination {
# address 84.39.234.53
# port 80,443
# }
# inbound-interface eth0.30
# protocol tcp
# translation {
# address {{ interfaces.managerN.net0.addresses[0] | ipaddr('address') }}
# }
# }
# rule 802 {
# destination {
# address 84.39.234.52
# port 22
# }
# inbound-interface eth0.10
# protocol tcp
# translation {
# address {{ interfaces.portal.net0.addresses[0] | ipaddr('address') }}
# }
# }
# rule 803 {
# destination {
# address 84.39.234.52
# port 22
# }
# inbound-interface eth0.30
# protocol tcp
# translation {
# address {{ interfaces.portal.net0.addresses[0] | ipaddr('address') }}
# }
# }
# rule 900 {
# destination {
# address 84.39.234.53
# port 8006
# }
# inbound-interface eth0.10
# protocol tcp
# translation {
# address 10.0.20.53
# }
# }
# rule 901 {
# destination {
# address 84.39.234.53
# port 2222
# }
# inbound-interface eth0.10
# protocol tcp
# translation {
# address 10.0.20.53
# port 22
# }
# }
# rule 902 {
# destination {
# address 84.39.234.53
# port 8007
# }
# inbound-interface eth0.10
# protocol tcp
# translation {
# address 10.0.20.52
# port 8006
# }
# }
# rule 903 {
# destination {
# address 84.39.234.53
# port 2223
# }
# inbound-interface eth0.10
# protocol tcp
# translation {
# address 10.0.20.52
# port 22
# }
# }
# rule 904 {
# destination {
# address 84.39.234.53
# port 1194
# }
# inbound-interface eth0.10
# protocol tcp
# translation {
# address {{ interfaces.games.net0.addresses[0] | ipaddr('address') }}
# port 1194
# }
# }
# }
# source {
# rule 10 {
# outbound-interface eth0.30
# source {
# address 10.0.30.0/24
# }
# destination {
# address 10.0.30.0/24
# }
# translation {
# address masquerade
# }
# }
# rule 100 {
# outbound-interface eth0.10
# source {
# address 10.0.20.0/24
# }
# translation {
# address masquerade
# }
# }
# rule 101 {
# outbound-interface eth0.10
# source {
# address 10.0.40.0/24
# }
# translation {
# address 84.39.234.53
# }
# }
# rule 102 {
# outbound-interface eth0.10
# source {
# address 10.0.30.0/24
# }
# translation {
# address 84.39.234.53
# }
# }
# rule 901 {
# outbound-interface eth0.10
# source {
# address 10.0.200.0/24
# }
# translation {
# address 84.39.234.53
# }
# }
# }
# }
# protocols {
# static {
# route 0.0.0.0/0 {
# next-hop 84.39.234.49 {
# distance 1
# }
# }
# }
# }
# service {
# ssh {
# listen-address 10.0.90.1
# port 22
# }
# }
# system {
# config-management {
# commit-revisions 100
# }
# console {
# device ttyS0 {
# speed 115200
# }
# }
# host-name router.vm.netsoc.co
# login {
# user vyos {
# authentication {
# encrypted-password '$6$Z3O/fMz9g4zCWys$DiujfJa4GEAlgj8C0WQlAmTTdlqCWFLkMLq5Bq1aBTGusQeyhS7H5K6sLINHmx1qg1BYyF36oPtoCEz/ZZiVJ.'
# plaintext-password ""
# }
# level admin
# }
# }
# ntp {
# server 0.pool.ntp.org {
# }
# server 1.pool.ntp.org {
# }
# server 2.pool.ntp.org {
# }
# }
# syslog {
# global {
# facility all {
# level info
# }
# facility protocols {
# level debug
# }
# }
# }
# time-zone UTC
# }
# zone-policy {
# zone infra {
# default-action drop
# description "Infrastructure traffic"
# from user {
# firewall {
# name user-infra
# }
# }
# from wan {
# firewall {
# name wan-infra
# }
# }
# interface eth0.30
# }
# zone mgmt {
# default-action drop
# description "Management traffic"
# interface eth0.90
# }
# zone user {
# default-action drop
# description "User VM traffic"
# from infra {
# firewall {
# name infra-user
# }
# }
# from wan {
# firewall {
# name wan-user
# }
# }
# interface eth0.40
# }
# zone vmhost {
# default-action drop
# description "VM host traffic"
# from wan {
# firewall {
# name wan-vmhost
# }
# }
# interface eth0.20
# }
# zone wan {
# default-action drop
# description "WAN traffic"
# from infra {
# firewall {
# name infra-wan
# }
# }
# from user {
# firewall {
# name user-wan
# }
# }
# from vmhost {
# firewall {
# name vmhost-wan
# }
# }
# interface eth0.10
# }
# }
# /* Warning: Do not remove the following line. */
# /* === vyatta-config-version: "broadcast-relay@1:cluster@1:config-management@1:conntrack@1:conntrack-sync@1:dhcp-relay@2:dhcp-server@5:dns-forwarding@2:firewall@5:interfaces@3:ipsec@5:l2tp@1:mdns@1:nat@4:ntp@1:pptp@1:qos@1:quagga@4:snmp@1:ssh@1:system@11:vrrp@2:vyos-accel-ppp@2:wanloadbalance@3:webgui@1:webproxy@2:zone-policy@1" === */
# /* Release version: 1.2-rolling-201911230217 */
# - vyos_config:
# save: no
# src: "{{ config_path }}"
# register: result
# - debug:
# msg: "{{ result }}"