我的伺服器上的匿名 IP 路由

我的伺服器上的匿名 IP 路由

在我的伺服器上輸入“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。等等。

相關內容