在我的服务器上输入“route -n”后,我发现了这些行
1.0.104.156 - 255.255.255.255 !H - - - -
1.9.22.84 - 255.255.255.255 !H - - - -
1.9.27.129 - 255.255.255.255 !H - - - -
1.9.63.206 - 255.255.255.255 !H - - - -
1.9.116.134 - 255.255.255.255 !H - - - -
1.9.123.225 - 255.255.255.255 !H - - - -
到
223.203.194.5 - 255.255.255.255 !H - - - -
223.203.218.68 - 255.255.255.255 !H - - - -
223.203.218.91 - 255.255.255.255 !H - - - -
223.206.106.124 - 255.255.255.255 !H - - - -
223.222.241.34 - 255.255.255.255 !H - - - -
223.224.126.254 - 255.255.255.255 !H - - - -
223.239.223.254 - 255.255.255.255 !H - - - -
223.255.162.34 - 255.255.255.255 !H - - - -
223.255.165.226 - 255.255.255.255 !H - - - -
223.255.183.202 - 255.255.255.255 !H - - - -
总计:42727 行
这可能来自哪里以及如何知道?
答案1
希望这可以有所帮助,这里是 IPTABLES 规则集的副本,它应该相当安全,但仍然允许访问标准和一些非标准服务:
*filter
# Reject some specifics (picked up from logs & fail2ban)
# -A INPUT -s 213.239.213.102 -j LOG --log-prefix "iptables DROP: " --log-level 7
# -A INPUT -s 213.239.213.102 -j REJECT
# -A INPUT -s 208.76.245.135 -j LOG --log-prefix "iptables DROP: " --log-level 7
# -A INPUT -s 208.76.245.135 -j REJECT
-A INPUT -s 78.189.110.91 -j LOG --log-prefix "iptables DROP: " --log-level 7
-A INPUT -s 78.189.110.91 -j REJECT
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
# This is best:
#-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# But the extension might not be available so may need to use this:
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
# You can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT
# Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# Allow non-standard http(s) connections for Node.js etc
-A INPUT -p tcp --dport 5050:5151 -j ACCEPT
# Allows SSH connections (on non-standard port <1024)
-A INPUT -p tcp -m state --state NEW --dport 444 -j ACCEPT
# Allows mail connections
-A INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 25 -j ACCEPT
-A INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 465 -j ACCEPT
-A INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 585 -j ACCEPT
-A INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 993 -j ACCEPT
-A INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 995 -j ACCEPT
# Allow ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
# log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables DENY: " --log-level 7
# Reject all other inbound - default deny unless explicitly allowed policy
-A INPUT -j REJECT
-A FORWARD -j REJECT
COMMIT
# ----------------------------------------------------
# NAT Rules
# ----------------------------------------------------
*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
*mangle
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed
请注意,此版本不会阻止出站,但最好这样做。此外,如果您不需要您的服务器访问/来自某些网络,只需阻止它们 1.9。。等等。至少暂时如此。