我想configurationip6tables只允许SSH连接到特定的范围。 在iptables中,命令是:
iptables -A OUTPUT -p tcp --dport 22 -m iprange --dst-range 192.168.178.0-192.168.178.254
但根据手册页选项-mIPrange似乎已经消失。 什么才是实现这种行为的正确命令? 一如既往的帮助将不胜感激:)
我刚刚检查了CentOS 6和Debian 7上的ip6tables手册页,它们都包含iprange :
iprange This matches on a given arbitrary range of IP addresses. [!] --src-range from[-to] Match source IP in the specified range. [!] --dst-range from[-to] Match destination IP in the specified range.
ArchLinux上的iptables-extensions手册页也指出iprange应该存在。
CentOS 6盒子的快速testing表明它可以工作:
www1 $ sudo ip6tables -A OUTPUT -p tcp --dport ssh -m iprange --dst-range 2001:db8::1-2001:db8::ff -j LOG [sudo] password for fukawi2: www1 $ sudo ip6tables -nvL OUTPUT Chain OUTPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 LOG tcp * * ::/0 ::/0 tcp dpt:22 destination IP range 2001:db8::1-2001:db8::ff LOG flags 0 level 4
你看过你的实际手册页,而不是在线的吗?