-
Notifications
You must be signed in to change notification settings - Fork 8
/
alma-9-openvpn.sh
537 lines (500 loc) · 16.7 KB
/
alma-9-openvpn.sh
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
#!/bin/bash -e
dnf -q -y install checkpolicy openvpn gnutls-utils dnsmasq 1>/dev/null
cat <<-EOF > /etc/openvpn/vpn-cert.cfg
organization = "Lavabit LLC"
unit = "Lavabit Developer Proxy"
state = "Texas"
country = US
email = "[email protected]"
cn = "vpn.alma.local"
dc = "alma.local"
serial = 003
activation_date = "2021-01-01 12:00:00"
expiration_date = "2031-12-31 12:00:00"
dns_name = "vpn.alma.local"
dns_name = "242.vpn.alma.local"
dns_name = "243.vpn.alma.local"
dns_name = "244.vpn.alma.local"
dns_name = "245.vpn.alma.local"
signing_key
encryption_key
tls_www_server
EOF
# VPN
certtool --stdout-info --sec-param=high --bits=4096 --generate-privkey --outfile /etc/openvpn/vpn-key.pem --template /etc/openvpn/vpn-cert.cfg 1>/dev/null
certtool --stdout-info --generate-request --load-privkey /etc/openvpn/vpn-key.pem --outfile /etc/openvpn/vpn-request.pem --template /etc/openvpn/vpn-cert.cfg 1>/dev/null
certtool --stdout-info --generate-certificate --load-request=/etc/openvpn/vpn-request.pem --load-privkey /etc/openvpn/vpn-key.pem --outfile /etc/openvpn/vpn-cert.pem \
--load-ca-certificate /etc/vpnweb/ca-cert.pem --load-ca-privkey /etc/vpnweb/ca-key.pem --template /etc/openvpn/vpn-cert.cfg 1>/dev/null
# DH Params
# Pre-generated DH values for use on test servers. Uncomment
# the openssl command below to generate a unique set of DH parameters
# if you;re setting up a production server.
cat <<-EOF > /etc/openvpn/dh.pem
-----BEGIN DH PARAMETERS-----
MIICCAKCAgEAmqnEVulBNsQLMyErDSnHxoofwcSu9shFBbfhtFEE7LUFw+PTdS0G
8FsqBXHbw61F7ZydR6Kf6ComVCUydF0ipeYmV7faOl6EnAug0+sVSHRCo+OLOUMq
wng1RPO9U25juBwbtR6rnxxiiuXJ4atILLifgMI0wrfdrYnuO5ibW/roAIaHUZci
cQjmXrlwrQyvlN0R/aY5SGOWUB7PhWV1hNNVDDQbYpdWti6AJPfOBWgWHm1gwP39
F/6c0KLnFij6Ut4sGU1gnuiSpY8+Kcf4xwk+VRc6AgCR1XRWoqS1MQJfbm9l9ZPx
oZAXsG1lxjlMWyFKa2cp8iAgQCL9P8UTeHIJWKVw9Wx4CjDmRdVfgW+DCz24hSUA
eGRNWZy5oP1poGr684UmfnEFlWe2zf8Y/PrJ3hXyr4D+b5h+gbPUE8s7PqE1G3Ev
6PISobokoqgQVMchds5d8d/mprq+avDEanyDfSS6I8HEh1IDI8ievBYsaC1Gf1Qs
H8WAWaLk0/2zidHv8hAhbpYkliULVHtMOCRpoewSE9+D8pTP3ZiPVEO4244ap5JV
qDL2M1mnW0cfRIyrZwyVB/S15hWzJCilUYz4jg2pDNjESs2JU9Vu13eQPQThaNc/
5Hxd4DGdtZWd30ay3JWLdnHuoBNWrOYex9Di+KnIMYqiUpK34XvbxLMCAQU=
-----END DH PARAMETERS-----
EOF
# Uncomment this for production deployments to generate new/unique Diffie-Hellman parameters.
# openssl dhparam -5 -outform PEM -out /etc/openvpn/dh.pem 4096
# Create log directory.
[ ! -d /var/log/openvpn/ ] && mkdir /var/log/openvpn/
cat <<-EOF > /etc/openvpn/server/tcp.242.conf
port 443
proto tcp
explicit-exit-notify 0
tls-server
mode server
user openvpn
group openvpn
ca /etc/vpnweb/ca-cert.pem
cert /etc/openvpn/vpn-cert.pem
key /etc/openvpn/vpn-key.pem
dh /etc/openvpn/dh.pem
auth SHA256
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
tls-version-min 1.2
dev tun
duplicate-cn
keepalive 10 30
local 192.168.221.242
mute-replay-warnings
# push "dhcp-option DNS 10.242.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 4.2.2.1"
push "dhcp-option DNS 4.2.2.2"
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"
script-security 1
server-ipv6 2001:db8:123::/64
server 10.242.0.0 255.255.248.0
tcp-nodelay
topology subnet
max-clients 2048
max-routes-per-client 2048
tcp-queue-limit 8192
txqueuelen 4096
bcast-buffers 8192
rcvbuf 2097152
sndbuf 2097152
verb 1
# log-append /var/log/openvpn/server.log
# push "block-outside-dns"
verify-x509-name "CN=BAZINGA"
EOF
cat <<-EOF > /etc/openvpn/server/udp.242.conf
port 554
proto udp
explicit-exit-notify 1
tls-server
mode server
user openvpn
group openvpn
ca /etc/vpnweb/ca-cert.pem
cert /etc/openvpn/vpn-cert.pem
key /etc/openvpn/vpn-key.pem
dh /etc/openvpn/dh.pem
auth SHA256
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
tls-version-min 1.2
dev tun
duplicate-cn
keepalive 10 30
local 192.168.221.242
mute-replay-warnings
# push "dhcp-option DNS 10.142.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 4.2.2.1"
push "dhcp-option DNS 4.2.2.2"
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"
script-security 1
server-ipv6 2001:db8:123::/64
server 10.142.0.0 255.255.248.0
topology subnet
max-clients 2048
max-routes-per-client 2048
txqueuelen 4096
bcast-buffers 8192
rcvbuf 2097152
sndbuf 2097152
verb 1
# log-append /var/log/openvpn/server.log
# push "block-outside-dns"
verify-x509-name "CN=BAZINGA"
EOF
cat <<-EOF > /etc/openvpn/server/tcp.243.conf
port 443
proto tcp
explicit-exit-notify 0
tls-server
mode server
user openvpn
group openvpn
ca /etc/vpnweb/ca-cert.pem
cert /etc/openvpn/vpn-cert.pem
key /etc/openvpn/vpn-key.pem
dh /etc/openvpn/dh.pem
auth SHA256
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
tls-version-min 1.2
dev tun
duplicate-cn
keepalive 10 30
local 192.168.221.243
mute-replay-warnings
# push "dhcp-option DNS 10.243.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 4.2.2.1"
push "dhcp-option DNS 4.2.2.2"
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"
script-security 1
server-ipv6 2001:db8:123::/64
server 10.243.0.0 255.255.248.0
tcp-nodelay
topology subnet
max-clients 2048
max-routes-per-client 2048
tcp-queue-limit 8192
txqueuelen 4096
bcast-buffers 8192
rcvbuf 2097152
sndbuf 2097152
verb 1
# log-append /var/log/openvpn/server.log
# push "block-outside-dns"
verify-x509-name "CN=BAZINGA"
EOF
cat <<-EOF > /etc/openvpn/server/udp.243.conf
port 554
proto udp
explicit-exit-notify 1
tls-server
mode server
user openvpn
group openvpn
ca /etc/vpnweb/ca-cert.pem
cert /etc/openvpn/vpn-cert.pem
key /etc/openvpn/vpn-key.pem
dh /etc/openvpn/dh.pem
auth SHA256
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
tls-version-min 1.2
dev tun
duplicate-cn
keepalive 10 30
local 192.168.221.243
mute-replay-warnings
# push "dhcp-option DNS 10.143.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 4.2.2.1"
push "dhcp-option DNS 4.2.2.2"
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"
script-security 1
server-ipv6 2001:db8:123::/64
server 10.143.0.0 255.255.248.0
topology subnet
max-clients 2048
max-routes-per-client 2048
txqueuelen 4096
bcast-buffers 8192
rcvbuf 2097152
sndbuf 2097152
verb 1
# log-append /var/log/openvpn/server.log
# push "block-outside-dns"
verify-x509-name "CN=BAZINGA"
EOF
cat <<-EOF > /etc/openvpn/server/tcp.244.conf
port 443
proto tcp
explicit-exit-notify 0
tls-server
mode server
user openvpn
group openvpn
ca /etc/vpnweb/ca-cert.pem
cert /etc/openvpn/vpn-cert.pem
key /etc/openvpn/vpn-key.pem
dh /etc/openvpn/dh.pem
auth SHA256
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
tls-version-min 1.2
dev tun
duplicate-cn
keepalive 10 30
local 192.168.221.244
mute-replay-warnings
# push "dhcp-option DNS 10.244.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 4.2.2.1"
push "dhcp-option DNS 4.2.2.2"
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"
script-security 1
server-ipv6 2001:db8:123::/64
server 10.244.0.0 255.255.248.0
tcp-nodelay
topology subnet
max-clients 2048
max-routes-per-client 2048
tcp-queue-limit 8192
txqueuelen 4096
bcast-buffers 8192
rcvbuf 2097152
sndbuf 2097152
verb 1
# log-append /var/log/openvpn/server.log
# push "block-outside-dns"
verify-x509-name "CN=BAZINGA"
EOF
cat <<-EOF > /etc/openvpn/server/udp.244.conf
port 554
proto udp
explicit-exit-notify 1
tls-server
mode server
user openvpn
group openvpn
ca /etc/vpnweb/ca-cert.pem
cert /etc/openvpn/vpn-cert.pem
key /etc/openvpn/vpn-key.pem
dh /etc/openvpn/dh.pem
auth SHA256
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
tls-version-min 1.2
dev tun
duplicate-cn
keepalive 10 30
local 192.168.221.244
mute-replay-warnings
# push "dhcp-option DNS 10.144.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 4.2.2.1"
push "dhcp-option DNS 4.2.2.2"
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"
script-security 1
server-ipv6 2001:db8:123::/64
server 10.144.0.0 255.255.248.0
topology subnet
max-clients 2048
max-routes-per-client 2048
txqueuelen 4096
bcast-buffers 8192
rcvbuf 2097152
sndbuf 2097152
verb 1
# log-append /var/log/openvpn/server.log
# push "block-outside-dns"
verify-x509-name "CN=BAZINGA"
EOF
cat <<-EOF > /etc/openvpn/server/tcp.245.conf
port 443
proto tcp
explicit-exit-notify 0
tls-server
mode server
user openvpn
group openvpn
ca /etc/vpnweb/ca-cert.pem
cert /etc/openvpn/vpn-cert.pem
key /etc/openvpn/vpn-key.pem
dh /etc/openvpn/dh.pem
auth SHA256
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
tls-version-min 1.2
dev tun
duplicate-cn
keepalive 10 30
local 192.168.221.245
mute-replay-warnings
# push "dhcp-option DNS 10.245.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 4.2.2.1"
push "dhcp-option DNS 4.2.2.2"
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"
script-security 1
server-ipv6 2001:db8:123::/64
server 10.245.0.0 255.255.248.0
tcp-nodelay
topology subnet
max-clients 2048
max-routes-per-client 2048
tcp-queue-limit 8192
txqueuelen 4096
bcast-buffers 8192
rcvbuf 2097152
sndbuf 2097152
verb 1
# log-append /var/log/openvpn/server.log
# push "block-outside-dns"
verify-x509-name "CN=BAZINGA"
EOF
cat <<-EOF > /etc/openvpn/server/udp.245.conf
port 554
proto udp
explicit-exit-notify 1
tls-server
mode server
user openvpn
group openvpn
ca /etc/vpnweb/ca-cert.pem
cert /etc/openvpn/vpn-cert.pem
key /etc/openvpn/vpn-key.pem
dh /etc/openvpn/dh.pem
auth SHA256
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
tls-version-min 1.2
dev tun
duplicate-cn
keepalive 10 30
local 192.168.221.245
mute-replay-warnings
# push "dhcp-option DNS 10.145.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 4.2.2.1"
push "dhcp-option DNS 4.2.2.2"
push "redirect-gateway def1 bypass-dhcp"
push "route-ipv6 2000::/3"
script-security 1
server-ipv6 2001:db8:123::/64
server 10.145.0.0 255.255.248.0
topology subnet
max-clients 2048
max-routes-per-client 2048
txqueuelen 4096
bcast-buffers 8192
rcvbuf 2097152
sndbuf 2097152
verb 1
# log-append /var/log/openvpn/server.log
# push "block-outside-dns"
verify-x509-name "CN=BAZINGA"
EOF
# Enable packet forwarding support.
cat <<-EOF > /etc/sysctl.d/10-forwarding.conf
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.disable_ipv6 = 0
EOF
sed -i '/all.disable_ipv6/d' /etc/sysctl.conf && sysctl --quiet net.ipv6.conf.all.disable_ipv6=0
sysctl --quiet -p < /etc/sysctl.d/10-forwarding.conf
# Increase the system limits so TOR can make better use the hardware.
cat <<-EOF > /etc/security/limits.d/50-global.conf
* soft memlock 16467224
* hard memlock 16467224
* soft nproc 65536
* hard nproc 65536
* soft nofile 1048576
* hard nofile 1048576
* soft stack unlimited
* hard stack unlimited
EOF
chmod 644 /etc/security/limits.d/50-global.conf
chcon "unconfined_u:object_r:etc_t:s0" /etc/security/limits.d/50-global.conf
# Override the file descriptor limit for the systemd service description.
[ ! -d /etc/systemd/system/[email protected]/ ] && mkdir --parents /etc/systemd/system/[email protected]/
cat <<-EOF > /etc/systemd/system/[email protected]/override.conf
[Service]
LimitNOFILE=65535
EOF
cat <<-EOF > $HOME/my-openvpn.te
module my-openvpn 1.0;
require {
type rtsp_port_t;
type openvpn_t;
class udp_socket name_bind;
}
#============= openvpn_t ==============
allow openvpn_t rtsp_port_t:udp_socket name_bind;
EOF
checkmodule -M -m -o $HOME/my-openvpn.mod $HOME/my-openvpn.te
semodule_package -o $HOME/my-openvpn.pp -m $HOME/my-openvpn.mod
semodule -X 300 -i $HOME/my-openvpn.pp
rm --force $HOME/my-openvpn.mod $HOME/my-openvpn.pp $HOME/my-openvpn.te
systemctl --quiet daemon-reload
systemctl --quiet enable [email protected] && systemctl start [email protected]
systemctl --quiet enable [email protected] && systemctl start [email protected]
systemctl --quiet enable [email protected] && systemctl start [email protected]
systemctl --quiet enable [email protected] && systemctl start [email protected]
systemctl --quiet enable [email protected] && systemctl start [email protected]
systemctl --quiet enable [email protected] && systemctl start [email protected]
systemctl --quiet enable [email protected] && systemctl start [email protected]
systemctl --quiet enable [email protected] && systemctl start [email protected]
cat <<-EOF > /etc/dnsmasq.d/interfaces.conf
interface=tun0
interface=tun1
interface=tun2
interface=tun3
interface=tun4
interface=tun5
interface=tun6
interface=tun7
bind-interfaces
EOF
systemctl --quiet enable dnsmasq.service && systemctl --quiet start dnsmasq.service
# Fix the permissions on the interface config files to avoid errors below.
chown -R root:root /etc/sysconfig/network-scripts/
chmod 644 /etc/sysconfig/network-scripts/ifcfg-*
chcon "system_u:object_r:net_conf_t:s0" /etc/sysconfig/network-scripts/ifcfg-*
# Firewall rules.
DEVICE=$(ip route | awk '/^default via/ {print $5}')
firewall-cmd --add-port=53/udp 1>/dev/null && firewall-cmd --add-port=53/udp --permanent 1>/dev/null
firewall-cmd --add-port=53/tcp 1>/dev/null && firewall-cmd --add-port=53/tcp --permanent 1>/dev/null
firewall-cmd --add-port=443/tcp 1>/dev/null && firewall-cmd --add-port=443/tcp --permanent 1>/dev/null
firewall-cmd --add-port=554/udp 1>/dev/null && firewall-cmd --add-port=554/udp --permanent 1>/dev/null
firewall-cmd --zone=trusted --add-interface=tun0 1>/dev/null && firewall-cmd --permanent --zone=trusted --add-interface=tun0 1>/dev/null
firewall-cmd --zone=trusted --add-interface=tun1 1>/dev/null && firewall-cmd --permanent --zone=trusted --add-interface=tun1 1>/dev/null
firewall-cmd --zone=trusted --add-interface=tun2 1>/dev/null && firewall-cmd --permanent --zone=trusted --add-interface=tun2 1>/dev/null
firewall-cmd --zone=trusted --add-interface=tun3 1>/dev/null && firewall-cmd --permanent --zone=trusted --add-interface=tun3 1>/dev/null
firewall-cmd --zone=trusted --add-interface=tun4 1>/dev/null && firewall-cmd --permanent --zone=trusted --add-interface=tun4 1>/dev/null
firewall-cmd --zone=trusted --add-interface=tun5 1>/dev/null && firewall-cmd --permanent --zone=trusted --add-interface=tun5 1>/dev/null
firewall-cmd --zone=trusted --add-interface=tun6 1>/dev/null && firewall-cmd --permanent --zone=trusted --add-interface=tun6 1>/dev/null
firewall-cmd --zone=trusted --add-interface=tun7 1>/dev/null && firewall-cmd --permanent --zone=trusted --add-interface=tun7 1>/dev/null
firewall-cmd --add-masquerade 1>/dev/null && firewall-cmd --add-masquerade --permanent 1>/dev/null
firewall-cmd --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.142.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.143.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.144.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.145.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.242.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.243.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.244.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.245.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.142.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.144.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.143.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.145.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.242.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.243.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.244.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s 10.245.0.0/21 -o $DEVICE -j MASQUERADE 1>/dev/null
dnf -q -y remove checkpolicy gnutls-utils 1>/dev/null