forked from samrocketman/home
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiptables.rules
553 lines (476 loc) · 21.9 KB
/
iptables.rules
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
#Created by Sam Gleske
#Sat Jul 9 12:17:02 PDT 2016
#My personal linux gaming desktop firewall
#Ubuntu 16.04 LTS
#Linux 4.4.0-28-generic x86_64
#iptables v1.6.0
#Latest environment
#Ubuntu 18.04.3 LTS
#Linux 5.3.0-23-generic x86_64
#iptables v1.6.1
*nat
:PREROUTING ACCEPT [3:296]
:INPUT ACCEPT [2:227]
:OUTPUT ACCEPT [44:3277]
:POSTROUTING ACCEPT [44:3277]
:DOCKER - [0:0]
:DOCKER-ISOLATION-STAGE-1 - [0:0]
:DOCKER-ISOLATION-STAGE-2 - [0:0]
:DOCKER-USER - [0:0]
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
-A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE
-A POSTROUTING -s 172.17.0.2/32 -d 172.17.0.2/32 -p tcp -m tcp --dport 22 -j MASQUERADE
-A DOCKER -i docker0 -j RETURN
-A DOCKER ! -i docker0 -p tcp -m tcp --dport 32768 -j DNAT --to-destination 172.17.0.2:22
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:OUTPUT_deny - [0:0]
:OUTPUT_allow - [0:0]
:DOCKER - [0:0]
:DOCKER-ISOLATION - [0:0]
:DOCKER-USER - [0:0]
:DOCKER-ISOLATION-STAGE-1 - [0:0]
:DOCKER-ISOLATION-STAGE-2 - [0:0]
:DISCORD_NETWORKS - [0:0]
:DISCORD_NETWORKS_allow - [0:0]
:GOOGLE_NETWORKS - [0:0]
:GOOGLE_NETWORKS_allow - [0:0]
:VALVE_NETWORKS - [0:0]
:VALVE_NETWORKS_allow - [0:0]
:BLIZZARD_NETWORKS - [0:0]
:BLIZZARD_NETWORKS_allow - [0:0]
:TWITCH_NETWORKS - [0:0]
:TWITCH_NETWORKS_allow - [0:0]
:IRC_NETWORKS - [0:0]
:IRC_NETWORKS_allow - [0:0]
:US_NETWORKS - [0:0]
:US_NETWORKS_allow - [0:0]
:INTERNAL - [0:0]
:INTERNAL_allow - [0:0]
:PUBLIC_deny - [0:0]
:PUBLIC_allow - [0:0]
:WORLD_allow - [0:0]
:LOGGING - [0:0]
#INPUT Chain
-A INPUT -j PUBLIC_deny
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -i lo -j ACCEPT
#docker
-A INPUT -s 172.17.0.0/16 -j ACCEPT
-A INPUT -j INTERNAL
-A INPUT -j WORLD_allow
-A INPUT -j US_NETWORKS
-A INPUT -j PUBLIC_allow
-A INPUT -j LOGGING
-A INPUT -j REJECT --reject-with icmp-host-prohibited
#OUTPUT Chain
-A OUTPUT -j OUTPUT_deny
-A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -j OUTPUT_allow
-A OUTPUT -j DISCORD_NETWORKS
-A OUTPUT -j GOOGLE_NETWORKS
-A OUTPUT -j VALVE_NETWORKS
-A OUTPUT -j IRC_NETWORKS
-A OUTPUT -j BLIZZARD_NETWORKS
-A OUTPUT -j LOGGING
-A OUTPUT -j REJECT --reject-with icmp-host-prohibited
#FORWARD Chain
-A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
#docker
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-ISOLATION-STAGE-1
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -o docker0 -j DOCKER
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
-A FORWARD -o docker0 -j DOCKER
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
#end docker
-A FORWARD -j LOGGING
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
#LOGGING Chain
#-A LOGGING -m limit --limit 2/min -j LOG --log-prefix "iptables DROP: " --log-level 4
#-A LOGGING -j LOG --log-prefix "iptables DROP: " --log-level 4
-A LOGGING -s 172.0.0.0/8 -d 172.0.0.0/8 -j RETURN
-A LOGGING -m limit --limit 1/second -j LOG --log-prefix "iptables DROP: " --log-level 4
#docker related chains
-A DOCKER -d 172.17.0.2/32 ! -i docker0 -o docker0 -p tcp -m tcp --dport 22 -j ACCEPT
-A DOCKER-ISOLATION -j RETURN
# Self-hosted Rust server
-A WORLD_allow -p udp -m udp --dport 28015 -j ACCEPT
-A WORLD_allow -p tcp -m tcp --dport 8000 -j ACCEPT
########################################################################
# GLESKE INTERNAL NETWORKS
-A INTERNAL -s 192.168.10.0/24 -g INTERNAL_allow
-A INTERNAL -s 192.168.86.0/24 -g INTERNAL_allow
#VPN
#-A INTERNAL -s 10.9.8.0/24 -g INTERNAL_allow
#icmp
-A INTERNAL_allow -p icmp -j ACCEPT
#synergy
-A INTERNAL_allow -p tcp -m state --state NEW -m tcp --dport 24800 -j ACCEPT
#ssh
-A INTERNAL_allow -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
#Herd deployments via bittorrent
#-A INTERNAL_allow -p tcp -m state --state NEW -m multiport --dport 10000:11000 -j ACCEPT
#accept traceroutes
-A INTERNAL_allow -p udp -m state --state NEW -m udp --dport 33434:33523 -j ACCEPT
#Starbound
-A INTERNAL_allow -p tcp -m state --state NEW -m tcp --dport 21025 -j ACCEPT
#Windward game
-A INTERNAL_allow -p tcp -m state --state NEW -m tcp --dport 5127 -j ACCEPT
#python -m SimpleHTTPServer
-A INTERNAL_allow -p tcp -m state --state NEW -m tcp --dport 8000 -j ACCEPT
#magicite
-A INTERNAL_allow -p tcp -m state --state NEW -m tcp --dport 7777 -j ACCEPT
-A INTERNAL_allow -p udp -m state --state NEW -m udp --dport 7777 -j ACCEPT
# END GLESKE INTERNAL NETWORKS
########################################################################
########################################################################
# PUBLIC INTERNET RULES
#DENY CONNECTIONS
# Dropping these because... they were attempting sketchy attack probing
-A PUBLIC_deny -s 37.1.0.0/16 -j DROP
-A PUBLIC_deny -s 196.245.0.0/16 -j DROP
-A PUBLIC_deny -s 192.241.0.0/16 -j DROP
-A PUBLIC_deny -s 180.149.0.0/16 -j DROP
-A PUBLIC_deny -s 2.57.0.0/16 -j DROP
#MALWARE
-A PUBLIC_deny -s 192.168.10.1 -p tcp -m state --state NEW -m tcp --dport 22 -j DROP
-A PUBLIC_deny -s 224.0.0.251 -j DROP
-A PUBLIC_deny -d 224.0.0.251 -j DROP
-A PUBLIC_deny -d 192.168.10.255 -j DROP
-A PUBLIC_deny -p udp --sport 17500 --dport 17500 -j DROP
#drop local broadcast
-A PUBLIC_deny -d 255.255.255.255 -j DROP
#ALLOW CONNECTIONS
#ssh from everyone in the United States
-A PUBLIC_allow -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
#Terraria
#-A PUBLIC_allow -p tcp -m state --state NEW -m tcp --dport 7777 -j ACCEPT
#Starbound
#-A PUBLIC_allow -p tcp -m state --state NEW -m tcp --dport 21025 -j ACCEPT
#-A PUBLIC_allow -p udp -m state --state NEW -m udp --dport 21025 -j ACCEPT
# END PUBLIC INTERNET RULES
########################################################################
########################################################################
# OUTBOUND RULES
#OUTBOUND block
#MALWARE
-A OUTPUT_deny -d 212.7.208.65 -j DROP
-A OUTPUT_deny -d 224.0.0.251 -j DROP
#OUTBOUND allow
#allow all internal network outbound communications
-A OUTPUT_allow -d 192.168.10.0/24 -j ACCEPT
#allow broadcase
-A OUTPUT_allow -d 255.255.255.255 -j ACCEPT
#linksys
-A OUTPUT_allow -d 192.168.1.1 -j ACCEPT
-A OUTPUT_allow -d 10.9.8.0/24 -j ACCEPT
# docker using RFC1918 space
-A OUTPUT_allow -d 172.16.0.0/12 -j ACCEPT
# Voice chat
-A OUTPUT_allow -p udp -j ACCEPT
-A OUTPUT_allow -p tcp -j ACCEPT
#Allow Google network for XMPP chatting
-A OUTPUT_allow -d 173.194.0.0/16 -p tcp -m tcp --dport 5222 -j ACCEPT
#-A OUTPUT_allow -d 192.168.100.1 -j ACCEPT
#allow ping only to public servers
-A OUTPUT_allow -p icmp -m state --state NEW -m icmp --icmp-type 8 -j ACCEPT
#Google Public DNS
-A OUTPUT_allow -p udp -d 8.8.8.8 -m state --state NEW -m udp --dport 53 -j ACCEPT
-A OUTPUT_allow -p tcp -d 8.8.8.8 -m state --state NEW -m tcp --dport 53 -j ACCEPT
-A OUTPUT_allow -p udp -d 8.8.4.4 -m state --state NEW -m udp --dport 53 -j ACCEPT
-A OUTPUT_allow -p tcp -d 8.8.4.4 -m state --state NEW -m tcp --dport 53 -j ACCEPT
#Allow NTP
-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 123 -j ACCEPT
-A OUTPUT_allow -p udp -m state --state NEW -m udp --dport 123 -j ACCEPT
#smtps outbound
-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 587 -j ACCEPT
#system updates and web traffic
-A OUTPUT_allow -p tcp -m state --state NEW -m multiport --dport 21,80,443 -j ACCEPT
#accept traceroutes
-A OUTPUT_allow -p udp -m state --state NEW -m udp --dport 33434:33523 -j ACCEPT
#irc networks (TLS only)
#-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 6697 -j ACCEPT
#allow outbound ssh
-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
#allow outbound DNS
-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT
-A OUTPUT_allow -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
#Terraria
-A OUTPUT_allow -d 23.243.71.225 -p tcp -m state --state NEW -m tcp --dport 7777 -j ACCEPT
-A OUTPUT_allow -d 23.243.71.225 -p tcp -m state --state NEW -m tcp --dport 24 -j ACCEPT
#Rust game
-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 28016 -j ACCEPT
-A OUTPUT_allow -p udp -m multiport --dports 17500,28015,28016,28026,28215,28231,28315 -j ACCEPT
#play.deadlock.com:1333 rust server
-A OUTPUT_allow -d 86.18.105.216 -p udp -m udp --dport 1333 -j ACCEPT
#twitch streaming
-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 1935 -j ACCEPT
# GPG hkp keyserver protocol
-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 11371 -j ACCEPT
-A OUTPUT_allow -p udp -m udp --dport 11371 -j ACCEPT
# starbound
-A OUTPUT_allow -p tcp -m state --state NEW -m tcp --dport 21025 -j ACCEPT
# END OUTBOUND RULES
########################################################################
#
########################################################################
# TWITCH NETWORKS RULES
# For streaming games
# networks
# https://search.arin.net/rdap/?query=JUSTI-19&searchFilter=entity
-A TWITCH_NETWORKS -d 192.108.239.0/24 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 192.16.64.0/21 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 199.9.248.0/21 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 23.160.0.0/24 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 52.223.216.0/21 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 52.223.224.0/20 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 52.223.240.0/20 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 99.181.64.0/18 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 99.181.88.0/21 -g TWITCH_NETWORKS_allow
-A TWITCH_NETWORKS -d 99.181.96.0/19 -g TWITCH_NETWORKS_allow
# allowed ports
-A TWITCH_NETWORKS_allow -p tcp -m multiport --dport 1935 -j ACCEPT
# END TWITCH NETWORKS RULES
########################################################################
########################################################################
# BLIZZARD NETWORKS RULES
# For Battle.net games
# This is to limit TCP and UDP client communications only to Blizzard
# networks.
# Resources:
# * List of Blizzard Entertainment, Inc. networks http://ipinfo.io/AS57976
# * Battle.net client ports https://us.battle.net/support/en/article/300479
#Misc rules discovered via firewall monitoring
-A OUTPUT_allow -d 12.129.0.0/16 -p tcp -m multiport --dports 1119,3724 -j ACCEPT
#-A OUTPUT_allow -d 24.105.0.0/16 -p tcp -m tcp --dport 1119 -j ACCEPT
-A OUTPUT_allow -d 69.164.0.0/16 -p tcp -m multiport --dports 1119 -j ACCEPT
#local LAN broadcasts
-A OUTPUT_allow -p udp -d 255.255.255.255 -m state --state NEW -m udp --dport 6120 -j ACCEPT
#United States IP Blocks for Blizzard Entertainment, Inc.
-A BLIZZARD_NETWORKS -d 24.105.0.0/21 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.8.0/21 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.16.0/22 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.20.0/22 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.25.0/24 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.26.0/23 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.28.0/24 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.29.0/24 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.32.0/21 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.40.0/21 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.52.0/22 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.57.0/24 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.60.0/24 -g BLIZZARD_NETWORKS_allow
-A BLIZZARD_NETWORKS -d 24.105.61.0/24 -g BLIZZARD_NETWORKS_allow
#allowed blizzard ports
#battle.net client
-A BLIZZARD_NETWORKS_allow -p tcp -m multiport --dport 1119,1120,3724,4000,6112,6113,6114 -j ACCEPT
-A BLIZZARD_NETWORKS_allow -p udp -m multiport --dport 1119,1120,3724,4000,6112,6113,6114 -j ACCEPT
#diablo 3
-A BLIZZARD_NETWORKS_allow -p tcp -m multiport --dport 80 -j ACCEPT
-A BLIZZARD_NETWORKS_allow -p udp -m multiport --dport 6120 -j ACCEPT
# END BLIZZARD NETWORKS RULES
########################################################################
########################################################################
# DISCORD NETWORKS RULES
# For Voice chat
-A DISCORD_NETWORKS -d 138.128.141.39 -g DISCORD_NETWORKS_allow
# UDP port 54619
-A DISCORD_NETWORKS_allow -p udp -m udp --dport 54619 -j ACCEPT
# END DISCORD NETWORKS RULES
########################################################################
########################################################################
# VALVE NETWORKS RULES
# For Steam PC Games
# Why? Steam requires one to open a lot of outbound and inbound ports.
# However, I only want to open those ports to trusted networks. Namely between
# Valve and I and my local networks. This helps prevent any rogue networks
# redirecting my Steam Client traffic, maliciously or otherwise.
# Resources:
# * List of Valve Corporation networks http://ipinfo.io/AS32590
# * Valve client ports https://support.steampowered.com/kb_article.php?ref=8571-GLVN-8711
#United States IP Blocks for Valve Corporation
-A VALVE_NETWORKS -d 72.165.61.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 103.10.124.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 103.10.125.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.239.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.240.0/23 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.242.0/23 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.244.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.245.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.246.0/23 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.248.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.249.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.252.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 155.133.254.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 162.254.192.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 162.254.193.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 162.254.194.0/23 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 162.254.195.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 162.254.196.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 162.254.197.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 162.254.198.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 162.254.199.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 192.69.96.0/22 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 205.185.194.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 205.196.6.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 208.64.200.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 208.64.201.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 208.64.202.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 208.64.203.0/24 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 208.78.164.0/22 -g VALVE_NETWORKS_allow
-A VALVE_NETWORKS -d 216.58.193.0/22 -g VALVE_NETWORKS_allow
#ALLOW OUTBOUND PORTS ONLY FOR VALVE CORPORATION
#Steam Client
-A VALVE_NETWORKS_allow -p tcp -m multiport --dport 27000:27050 -j ACCEPT
-A VALVE_NETWORKS_allow -p udp -m multiport --dport 27000:27050,4380 -j ACCEPT
#Steamworks P2P Networking and Steam Voice Chat
-A VALVE_NETWORKS_allow -p udp -m multiport --dport 3478,4379,4380 -j ACCEPT
#ALLOW INBOUND PORTS (INTERNAL NETWORKS ONLY)
#In-Home Streaming
-A INTERNAL_allow -p tcp -m state --state NEW -m multiport --dports 27036,27037 -j ACCEPT
-A INTERNAL_allow -p udp -m state --state NEW -m multiport --dports 27031,27036 -j ACCEPT
# END VALVE NETWORKS RULES
########################################################################
########################################################################
# IRC NETWORKS RULES
#irc.freenode.net
-A IRC_NETWORKS -d 139.162.227.51 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 149.56.134.238 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 185.30.166.37 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 193.10.255.100 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 204.225.96.251 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 38.229.70.22 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 64.86.243.181 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 91.217.189.42 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 94.125.182.252 -g IRC_NETWORKS_allow
#irc.gimp.org
-A IRC_NETWORKS -d 130.239.18.215 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 158.69.32.35 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 51.15.53.172 -g IRC_NETWORKS_allow
-A IRC_NETWORKS -d 83.98.201.47 -g IRC_NETWORKS_allow
-A IRC_NETWORKS_allow -p tcp -m tcp --dport 6697 -j ACCEPT
# END IRC NETWORKS RULES
########################################################################
########################################################################
# GOOGLE NETWORKS RULES
# Google Media IP Address Ranges
# https://support.google.com/a/answer/1279090
# Google hangouts network
-A GOOGLE_NETWORKS -d 74.125.250.0/24 -g GOOGLE_NETWORKS_allow
# Google hangouts outbound ports
-A GOOGLE_NETWORKS_allow -p tcp -m tcp --dport 443 -j ACCEPT
-A GOOGLE_NETWORKS_allow -p udp -m multiport --dport 19302:19309,443 -j ACCEPT
# END GOOGLE NETWORKS RULES
########################################################################
########################################################################
# US REGION NETWORKS (ARIN)
# https://en.wikipedia.org/wiki/List_of_assigned_/8_IPv4_address_blocks
-A US_NETWORKS -s 3.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 8.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 9.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 13.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 15.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 16.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 18.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 20.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 23.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 24.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 32.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 34.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 35.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 40.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 45.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 47.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 50.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 52.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 54.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 63.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 64.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 65.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 66.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 67.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 68.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 69.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 70.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 71.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 72.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 73.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 74.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 75.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 76.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 96.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 97.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 98.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 99.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 100.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 104.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 107.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 108.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 128.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 129.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 130.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 131.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 132.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 134.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 135.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 136.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 137.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 138.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 139.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 140.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 142.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 143.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 144.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 146.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 147.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 148.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 149.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 152.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 155.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 156.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 157.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 158.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 159.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 160.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 161.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 162.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 164.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 165.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 166.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 167.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 168.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 169.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 170.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 172.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 173.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 174.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 184.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 192.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 198.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 199.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 204.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 205.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 206.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 207.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 208.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 209.0.0.0/8 -g US_NETWORKS_allow
-A US_NETWORKS -s 216.0.0.0/8 -g US_NETWORKS_allow
# reject all traffic not originating from US regional networks.
-A US_NETWORKS -j DROP
# Whitelist all US networks. This doesn't mean the firewall will ultimately
# allow it. It just means that address will not be automatically blocked as a
# matter of regional policy.
-A US_NETWORKS_allow -j RETURN
# END US REGION NETWORKS
########################################################################
COMMIT