Parcourir la source

Document firehol_level1 RFC1918 gotcha in blocklist defaults

The default [defense.blocklist] uses firehol_level1.netset, which
includes bogon networks and therefore all RFC1918 ranges. Clients
connecting from a LAN address (e.g. a phone on the home Wi-Fi when
mtg runs at home) are silently rejected with "ip was blacklisted"
and routed to the fronting domain. This is a recurring source of
confusion (see issue #466 for the latest example).

Add a warning next to the urls list in example.config.toml and a
Troubleshooting section in README.md covering the symptom, the
cause, and three resolution paths (disable blocklist, swap for a
narrower list, or use hairpin NAT).

Docs only, no code changes.
pull/467/head
dolonet il y a 3 semaines
Parent
révision
602f85d24d
2 fichiers modifiés avec 54 ajouts et 0 suppressions
  1. 43
    0
      README.md
  2. 11
    0
      example.config.toml

+ 43
- 0
README.md Voir le fichier

@@ -514,6 +514,49 @@ This is not very necessary. Keep in mind these rules:
514 514
    you can enable `drs` setting.
515 515
 9. **If you are not sure, touch nothing!**
516 516
 
517
+## Troubleshooting
518
+
519
+### `ip was blacklisted` for clients on the same LAN
520
+
521
+If you run mtg at home and a client on the same LAN (for example, your
522
+phone on the home Wi-Fi) cannot connect, check the proxy logs for a
523
+message like:
524
+
525
+```json
526
+{"level":"info","ip":"10.0.1.1","logger":"proxy","message":"ip was blacklisted"}
527
+```
528
+
529
+The reason is that the default blocklist (`firehol_level1.netset`)
530
+includes bogon networks, which covers all RFC1918 ranges
531
+(`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`). Any client
532
+connecting from such an address is rejected by the blocklist and
533
+silently routed to the fronting domain.
534
+
535
+There are three ways to resolve it:
536
+
537
+1. Disable the blocklist entirely in `config.toml`:
538
+
539
+   ```toml
540
+   [defense.blocklist]
541
+   enabled = false
542
+   ```
543
+
544
+   Simplest option if the proxy is used only by you and people you trust.
545
+
546
+2. Keep the blocklist but swap `firehol_level1` for a narrower list that
547
+   does not include bogons, for example `firehol_abusers_1d`:
548
+
549
+   ```toml
550
+   [defense.blocklist]
551
+   enabled = true
552
+   urls = ["https://iplists.firehol.org/files/firehol_abusers_1d.netset"]
553
+   ```
554
+
555
+3. Connect to the proxy through a public IP or domain name with hairpin
556
+   NAT (`MASQUERADE`) on your router. mtg will then see the client with
557
+   its public address and the blocklist will not match. This is more
558
+   work to set up but preserves full blocklist protection.
559
+
517 560
 ## Metrics
518 561
 
519 562
 Out of the box, mtg works with

+ 11
- 0
example.config.toml Voir le fichier

@@ -316,6 +316,17 @@ download-concurrency = 2
316 316
 # A list of URLs in FireHOL format (https://iplists.firehol.org/)
317 317
 # You can provider links here (starts with https:// or http://) or
318 318
 # path to a local file, but in this case it should be absolute.
319
+#
320
+# NOTE: the default list below (firehol_level1.netset) includes bogon
321
+# networks, and therefore RFC1918 ranges as well (10.0.0.0/8,
322
+# 172.16.0.0/12, 192.168.0.0/16). If you run mtg on a home/LAN network
323
+# and connect from a client on the same LAN, that client will be
324
+# rejected with "ip was blacklisted" and silently routed to the fronting
325
+# domain. If you see this, you can either disable this section
326
+# (enabled = false), replace firehol_level1 with a narrower list that
327
+# does not include bogons (e.g. firehol_abusers_1d), or connect via
328
+# a public IP/domain with hairpin NAT on your router. See README for
329
+# details.
319 330
 urls = [
320 331
     "https://iplists.firehol.org/files/firehol_level1.netset",
321 332
     # "/local.file"

Chargement…
Annuler
Enregistrer