AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 913173
Accepted
Jan Richter
Jan Richter
Asked: 2018-05-22 16:17:41 +0800 CST2018-05-22 16:17:41 +0800 CST 2018-05-22 16:17:41 +0800 CST

随机无法访问的虚拟机

  • 772

我有一个在 Google Cloud Platform ( n1-standard-2in australia-southeast1-b) 中运行的计算引擎 VM。

该实例正在运行一个 Web 服务器,具有外部和内部静态 IP,使用default网络和子网,并分配​​有一个域。

在随机的一段时间后,机器变得无法访问。到目前为止,我要找到原因,但是当我尝试时tcptraceroute,结果如下:

健康

$ tcptraceroute my.domain.nz 443
Selected device wlp2s0, address 192.168.100.204, port 38543 for outgoing packets
Tracing the path to my.domain.nz (35.189.255.255) on TCP port 443 (https), 30 hops max
 1  192.168.100.1  2.982 ms  1.719 ms  1.884 ms
 2  192.168.1.254  2.540 ms  1.991 ms  2.091 ms
 3  * * *
 4  * * *
 5  ae8-10.akbr6.global-gateway.net.nz (122.56.116.5)  4.685 ms  3.459 ms  3.439 ms
 6  ae7-2.akbr7.global-gateway.net.nz (122.56.119.53)  3.908 ms  2.855 ms  2.693 ms
 7  xe5-0-4.sgbr3.global-gateway.net.nz (122.56.127.186)  29.059 ms  30.652 ms  28.932 ms
 8  ae2-10.sgbr4.global-gateway.net.nz (202.50.232.246)  27.784 ms  27.875 ms  35.276 ms
 9  google-gsw.sgbr4.global-gateway.net.nz (202.50.237.198)  30.394 ms  28.655 ms  28.791 ms
10  108.170.247.33  29.646 ms  29.712 ms  29.606 ms
11  209.85.242.142  29.048 ms  28.481 ms  28.239 ms
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  my.domain.nz (35.189.255.255) [open]  31.312 ms  29.198 ms  29.871 ms

不良

$ tcptraceroute my.domain.nz 443
Selected device wlp2s0, address 192.168.100.204, port 41597 for outgoing packets
Tracing the path to my.domain.nz (35.189.255.255) on TCP port 443 (https), 30 hops max
 1  192.168.100.1  4.428 ms  1.306 ms  1.813 ms
 2  192.168.1.254  2.654 ms  1.908 ms  2.545 ms
 3  * * *
 4  * * *
 5  ae8-10.akbr6.global-gateway.net.nz (122.56.116.5)  102.289 ms  3.407 ms  3.176 ms
 6  ae7-2.akbr7.global-gateway.net.nz (122.56.119.53)  4.630 ms  3.817 ms  3.299 ms
 7  xe5-0-2.sgbr3.global-gateway.net.nz (122.56.127.178)  119.213 ms  27.778 ms  144.073 ms
 8  ae2-10.sgbr4.global-gateway.net.nz (202.50.232.246)  28.512 ms  29.801 ms  144.985 ms
 9  google-gsw.sgbr4.global-gateway.net.nz (202.50.237.198)  29.008 ms  132.171 ms  29.510 ms
10  108.170.247.65  28.283 ms  28.180 ms  27.605 ms
11  209.85.242.190  27.815 ms  27.783 ms  27.681 ms
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *
Destination not reached

我怀疑我们的本地网络有问题,但是如果我从 GCP 控制台重新启动 VM,我们可以再次访问它。

如果我尝试从我的移动网络访问该网站,它可以工作。来自任何远程服务器的 SSH 和 ping/curl 也可以。

不太确定如何进一步调试它,也不知道有什么问题。

有任何想法吗?

networking
  • 1 1 个回答
  • 534 Views

1 个回答

  • Voted
  1. Best Answer
    Jan Richter
    2018-07-26T20:22:28+08:002018-07-26T20:22:28+08:00

    责怪sshguard!

    经过进一步调查,我们发现如果办公室的同事尝试使用无效的 SSH 密钥推送到服务器(VM 是 git 服务器),就会出现问题。

    来自 Google Cloud Slack 社区的briansneddon的进一步调试和帮助我使用以下命令发现了问题:

    sudo /sbin/iptables -L -v -n

    Chain INPUT (policy ACCEPT 33560 packets, 35M bytes)
     pkts bytes target     prot opt in     out     source               destination         
    72689   68M sshguard   all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
     pkts bytes target     prot opt in     out     source               destination         
    Chain OUTPUT (policy ACCEPT 32966 packets, 36M bytes)
     pkts bytes target     prot opt in     out     source               destination         
    Chain sshguard (1 references)
     pkts bytes target     prot opt in     out     source               destination         
     3259  263K DROP       all  --  *      *       123.123.123.123      0.0.0.0/0  
    

    您可以看到 IP123.123.123.123正在被丢弃sshguard。

    解决方案

    1. 通过运行删除活动块sudo /sbin/iptables -F sshguard。
    2. 将 IP 添加到/etc/sshguard/whitelist
    • 0

相关问题

  • 谁能指出我的 802.11n 范围扩展器?

  • 我怎样才能得到一个网站的IP地址?

  • 在一个 LAN 中使用两台 DHCP 服务器

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve