ip6tablesは-dターゲットを受け入れませんが、iptablesは受け入れます。

ip6tablesは-dターゲットを受け入れませんが、iptablesは受け入れます。

IPv6アドレスが私のサーバーの特定のIPに接続することを許可しようとしていますが、他のIPには接続しないようにします。以下はip6tablesには適用されませんが、通常のiptablesには適用されます。しかし、-d xx.xx.xx.77ip6tablesコマンドからそれを削除すると、そのIP6アドレスが私が望んでいないボックスのすべてのIPに接続できるようになります。

ip6tables -I INPUT -d xx.xx.xx.77 -i enp2s0f0 -p tcp -m multiport --dports http,https -s 2400:cb00::/32 -j ACCEPT
ip6tables v1.6.0: host/network `xx.xx.xx.77' not found

man ip6tables-dとについて、次のように表示します-s

   [!] -s, --source address[/mask][,...]
          Source  specification.  Address  can  be  either a network name, a hostname, a network IP address (with /mask), or a plain IP address. Hostnames will be resolved once only, before the rule is submitted to the kernel.  Please note that
          specifying any name to be resolved with a remote query such as DNS is a really bad idea.  The mask can be either an ipv4 network mask (for iptables) or a plain number, specifying the number of 1's at the left side of the network mask.
          Thus, an iptables mask of 24 is equivalent to 255.255.255.0.  A "!" argument before the address specification inverts the sense of the address. The flag --src is an alias for this option.  Multiple addresses can be specified, but this
          will expand to multiple rules (when adding with -A), or will cause multiple rules to be deleted (with -D).

   [!] -d, --destination address[/mask][,...]
          Destination specification.  See the description of the -s (source) flag for a detailed description of the syntax.  The flag --dst is an alias for this option.

ベストアンサー1

IPv6 は IPv4 に接続できません。 ip6tablesでは、すべてがipv6でなければなりません。

おすすめ記事