OpenWRT - WAN-LAN 方向で DNS ポートをブロックできません。 (53)

OpenWRT - WAN-LAN 方向で DNS ポートをブロックできません。 (53)

OpenWRT BarrierBreakerを含むTP-Link WDR4300ルーター(vargalexバージョン1.1.7)があります。

私はLAN外のルータにアクセスするためにRaspberry(SMB, PMA, Plex, etcDDNSduckdns.org)を使用しています(ルータでVPNを設定しようとしましたが、正しい設定が見つかりませんでした)。私のサービスは次のポートを使用しています。139, 445, 8080, 8081, 8877, 56565しかし、なぜ53dnsmasq)ポートが開いていWANてブロックすることはできません。

netstat出力:

netstat -an

ネットワーク統計-an

netstat -pln

netstat -pln

nslookup出力:

> server <myremoteaddress>.duckdns.org
Default Server:  remoteconnection.duckdns.org
Address:  <myipaddress>

> google.com.
Server:  <myremoteaddress>.duckdns.org
Address:  <myipaddress>

Non-authoritative answer:
Name:    google.com
Addresses:  xxxx:yyyy:400d:zzzz::200e
          ***.***.72.20
          ***.***.72.34
          ***.***.72.45
          ***.***.72.24
          ***.***.72.49
          ***.***.72.44
          ***.***.72.39
          ***.***.72.25
          ***.***.72.30
          ***.***.72.54
          ***.***.72.40
          ***.***.72.29
          ***.***.72.50
          ***.***.72.59
          ***.***.72.55
          ***.***.72.35

Google DNS()を使用しています8.8.8.8, 8.8.4.4

ruleポートをブロックするためにいくつか追加しようとしましたが、53成功しませんでした。

firewall設定()にルールを追加し、/etc/config/firewall必要なポートに接続しました。

config rule
    option src 'wan'
    option name 'block_port_53'
    option dest_port '53'
    option target 'REJECT'
    option proto 'all'

config rule
    option target 'ACCEPT'
    option proto 'tcp udp'
    option dest_port '53'
    option name 'Guest DNS'
    option src 'guest'
    option enabled '0'

config rule
    option src 'wan'
    option dest 'lan'
    option name 'restrict_dns_53_lan'
    option dest_port '53'
    option target 'REJECT'

config rule
    option src 'wan'
    option dest_port '53'
    option name 'restrict_dns_forward'
    option target 'REJECT'
    option proto 'tcp udp'
    option dest 'lan'

Guest DNSGuest WiFi現在は無効になっており、()に使用されますGuest DNS zone

私は何が間違っていましたか?

ポートをブロックする主な理由は、中国のボットが私のルーターを53再バインドしようとするためです。DNSSystem Log

Jul  4 20:12:53 dnsmasq[2524]: possible DNS-rebind attack detected: 9406151-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:53 dnsmasq[2524]: possible DNS-rebind attack detected: 9406163-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:53 dnsmasq[2524]: possible DNS-rebind attack detected: 9406153-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:54 dnsmasq[2524]: possible DNS-rebind attack detected: 9406166-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:54 dnsmasq[2524]: possible DNS-rebind attack detected: 9406154-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:54 dnsmasq[2524]: possible DNS-rebind attack detected: 9406157-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:54 dnsmasq[2524]: possible DNS-rebind attack detected: 9406156-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:54 dnsmasq[2524]: possible DNS-rebind attack detected: 9406148-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:54 dnsmasq[2524]: possible DNS-rebind attack detected: 9406149-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:54 dnsmasq[2524]: possible DNS-rebind attack detected: 9406155-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:54 dnsmasq[2524]: possible DNS-rebind attack detected: 9406160-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:55 dnsmasq[2524]: possible DNS-rebind attack detected: 9406164-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:55 dnsmasq[2524]: possible DNS-rebind attack detected: 9406158-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:55 dnsmasq[2524]: possible DNS-rebind attack detected: 9406150-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:55 dnsmasq[2524]: possible DNS-rebind attack detected: 9406161-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:55 dnsmasq[2524]: possible DNS-rebind attack detected: 9406147-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:55 dnsmasq[2524]: possible DNS-rebind attack detected: 9406152-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.myxns.cn
Jul  4 20:12:56 dnsmasq[2524]: possible DNS-rebind attack detected: 9406162-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:57 dnsmasq[2524]: possible DNS-rebind attack detected: 9406159-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:12:58 dnsmasq[2524]: possible DNS-rebind attack detected: 9406165-0-1896986649-4159633587.ns.113-17-184-25-ns.dns-spider.ffdns.net
Jul  4 20:15:24 dnsmasq[2524]: possible DNS-rebind attack detected: 4376755-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.ffdns.net
Jul  4 20:15:24 dnsmasq[2524]: possible DNS-rebind attack detected: 4376759-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.ffdns.net
Jul  4 20:15:24 dnsmasq[2524]: possible DNS-rebind attack detected: 4376746-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.myxns.cn
Jul  4 20:15:24 dnsmasq[2524]: possible DNS-rebind attack detected: 4376741-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.myxns.cn
Jul  4 20:15:24 dnsmasq[2524]: possible DNS-rebind attack detected: 4376750-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.myxns.cn
Jul  4 20:15:26 dnsmasq[2524]: possible DNS-rebind attack detected: 4376756-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.ffdns.net
Jul  4 20:15:26 dnsmasq[2524]: possible DNS-rebind attack detected: 4376752-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.ffdns.net
Jul  4 20:15:26 dnsmasq[2524]: possible DNS-rebind attack detected: 4376760-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.ffdns.net
Jul  4 20:15:26 dnsmasq[2524]: possible DNS-rebind attack detected: 4376754-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.ffdns.net
Jul  4 20:15:26 dnsmasq[2524]: possible DNS-rebind attack detected: 4376758-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.ffdns.net
Jul  4 20:15:26 dnsmasq[2524]: possible DNS-rebind attack detected: 4376753-0-3084195388-824858262.ns.183-213-22-60-ns.dns-spider.ffdns.net

私はそれらを削除するのを助けてください。

ベストアンサー1

試してみましたoption proto 'tcpudp'か?ポート番号を指定するときのマニュアルとiptablesの動作方法によれば、これが必要であることがわかります。 tcpudp実際にはデフォルトです。したがってall、どちらかを使用したくない場合があります(DNSは通常の操作で両方のプロトコルを使用できるため、使用tcp udpしたくありません)。udp

[openwrt] 指定された宛先ポートまたはポート範囲の着信トラフィックを一致させます。関連プロトタイプが指定された場合

[iptables] これらの拡張は、「--protocol tcp」が指定されている場合に使用できます。次のオプションを提供します。 ... --destination-port

おすすめ記事