我试图允许 IPv6 地址连接到我的服务器上的某个 IP,但不允许连接到其他 IP。以下内容不适用于 ip6tables,但它确实适用于普通 iptables。然而,当我-d xx.xx.xx.77
从 ip6tables 命令中删除它时,它会起作用,这将允许该 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