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
    • 最新
    • 标签
主页 / user-955195

codlord's questions

Martin Hope
codlord
Asked: 2024-09-19 19:48:37 +0800 CST

通过 DrayTek Lan-to-Lan IPsec 隧道上传失败(其他一切正常)

  • 5
悬赏将在 5 天后到期。回答此问题的人员有资格获得+50声誉悬赏。codlord 正在寻找来自信誉良好的来源的答案:
我想解决这个问题,我不知道为什么当前的 IPSec 隧道不能像标准网络那样工作,我希望我只需要在某处更改一些配置。

寻求关于调整/测试哪些设置和/或如何进一步诊断此问题的建议,因为我不是网络专家并且路由器等上有数百个设置。

我在两个站点之间设置了 DrayTek Lan-to-Lan VPN IPsec 隧道,主要用于管理远程站点的安全性(CCTV/警报/门等)。

一切基本正常。从本地站点 (192.168.1.X),我可以看到远程站点 (172.19.0.X) 上的所有设备,可以连接到设备 Web 界面,可以传输摄像头信息、控制设备等。

然而,有一件事是行不通的,那就是设备的远程固件升级。例如,涉及 75MB 上传的相机固件升级总是会失败。

如果我在路由器上打开一个端口,我可以使用相同的固件文件通过互联网远程更新摄像头,所以我知道那边一切正常,它只是无法通过 IPsec 隧道工作,我想解决这个问题。

通过测试从同一本地站点到远程站点的大型 ftp 上传,我已确认这是一个一般的“上传”问题 - 它们通过 VPN 失败(停顿)。

本地网站:

WAN: Fibre Internet 
DrayTek Vigor2926
DrayTek Lan to Lan accepts Dial-In:
IPsec Tunnel (IKEv1/IKEv2)
Pre-Shared Key / Medium (AH) AES

远程站点:

WAN: 3G/4G LTE Modem
DrayTek Vigor2865
DrayTek Lan to Lan Dial-Out:
IPsec Tunnel IKEv2
Pre-Shared Key / Poposal Encryption Auto
IKE Phase 2 Settings: ESP (High) AES256 
Proposal Authentication: All

编辑1-路由器上的MTU设置:

下的本地站点 WANInternet Access -> Static or Dynamic IP设置为1500。 下的远程站点 WANInternet Access -> 3G/4G/5G Modem(DHCP mode)设置为1500(根据那里的文字,这是默认值)。

编辑 2-来自 ping 测试的 MTU 值:

我在这里找到了一个 ping 测试脚本,我用它来找到最大 MTU 大小,如下所示:

  • 通过 VPN 从本地站点到远程站点:1500
  • 通过 WAN 从本地站点到远程站点:1500
  • 从我家通过 WAN 到本地站点:1492
  • 从我家通过 WAN 到远程站点:1492

编辑 3 - 这似乎是一个 MTU 问题,但我仍然不完全理解:

如果我暂时将本地站点上的网络适配器的 MTU 更改1500为较低的值,例如:

sudo ifconfig enp6s0 mtu 1360

然后,通过 VPN 进行测试 FTP 上传。但我认为这是一种黑客式的解决方法,而不是解决方案。

我仔细查看了路由器设置,发现下面VPN and Remote Access -> IPsec General Setup有一个设置,其VPN TCP maximum segment size (MSS)值IPsec (IKEv1/IKEv2)可以在512 and 1381和之间,默认为1360。我想也许这就是答案,将设置更改为非常低的值(512)确实会影响 ping 测试(它返回的最大 MTU 值为1044),但这仍然不会影响通过 VPN 进行上传。

我不明白为什么 ping 测试显示最大 MTU 是 1500,但我必须更改网络适配器 MTU 设置才能使上传正常工作,而且似乎 DrayTek 路由器上的设置没有任何更改允许上传通过它自己的 IPSec VPN 工作。

networking
  • 1 个回答
  • 53 Views
Martin Hope
codlord
Asked: 2024-02-01 02:16:39 +0800 CST

由于网络服务器迁移到 StackCP,Prometheus Blackbox http_2xx 返回 403

  • 5
赏金将在 5 天后到期。此问题的答案有资格获得+100声誉奖励。 codlord正在从信誉良好的来源寻找答案:
寻找要么发现为什么我会收到此错误以便修复它,要么通过某种方式调整 Prometheus 以使其再次工作,例如在检查中添加 http 标头或用户代理或其他内容。如果 wget/curl 工作,应该可以让 Prometheus 工作。

我正在使用 Prometheus Blackbox Exporter http_2xx 检查监控各种 Web 服务器。然后,Web 托管提供商从 cPanel 迁移到 Stack CP。

从那时起,所有 http_2xx 都只返回 403(禁止)错误,我无法弄清楚为什么,因为我可以成功运行来自同一个 Prometheus 服务器/IP 的命令wget。curl我似乎无法使用其他命令重新创建 403 错误。

任何人都可以提出任何建议,为什么会出现这种情况或如何进一步调试?

我检查了 StackCP 配置,似乎没有任何内容会禁止这些监控检查。

我在 Web 服务器日志中看不到任何有关 403 错误的信息。

blackbox.yml配置开始:

modules:
  http_2xx:
    prober: http
    timeout: 10s
    http:
      method: GET

我也尝试过这个,认为这可能是 SSL/证书问题,但这没有什么区别:

modules:
  http_2xx:
    prober: http
    timeout: 10s
    http:
      method: GET
      tls_config:
        insecure_skip_verify: true

以及普罗米修斯服务器的系统日志摘录:

Jan 31 18:08:00 Overwatch prometheus-blackbox-exporter[3362305]: ts=2024-01-31T18:08:00.356Z caller=main.go:180 module=http_2xx target=https://southcoastgroup.co.uk level=debug msg="Beginning probe" probe=http timeout_seconds=9.5
Jan 31 18:08:00 Overwatch prometheus-blackbox-exporter[3362305]: ts=2024-01-31T18:08:00.356Z caller=main.go:180 module=http_2xx target=https://southcoastgroup.co.uk level=debug msg="Resolving target address" ip_protocol=ip6
Jan 31 18:08:00 Overwatch prometheus-blackbox-exporter[3362305]: ts=2024-01-31T18:08:00.371Z caller=main.go:180 module=http_2xx target=https://southcoastgroup.co.uk level=debug msg="Resolving target address" ip_protocol=ip4
Jan 31 18:08:00 Overwatch prometheus-blackbox-exporter[3362305]: ts=2024-01-31T18:08:00.371Z caller=main.go:180 module=http_2xx target=https://southcoastgroup.co.uk level=debug msg="Resolved target address" ip=185.151.30.208
Jan 31 18:08:00 Overwatch prometheus-blackbox-exporter[3362305]: ts=2024-01-31T18:08:00.371Z caller=main.go:180 module=http_2xx target=https://southcoastgroup.co.uk level=debug msg="Making HTTP request" url=https://185.151.30.208 host=southcoastgroup.co.uk
Jan 31 18:08:00 Overwatch prometheus-blackbox-exporter[3362305]: ts=2024-01-31T18:08:00.406Z caller=main.go:180 module=http_2xx target=https://southcoastgroup.co.uk level=debug msg="Received HTTP response" status_code=403
Jan 31 18:08:00 Overwatch prometheus-blackbox-exporter[3362305]: ts=2024-01-31T18:08:00.406Z caller=main.go:180 module=http_2xx target=https://southcoastgroup.co.uk level=debug msg="Invalid HTTP response status code, wanted 2xx" status_code=403

Ubuntu 22.04.3 LTS / prometheus,版本 2.31.2+ds1 / blackbox_exporter,版本 0.19.0

按照@AlexD的建议编辑1,尽管输出对我来说意义不大。在 中strace,我可以看到它连接到网络服务器(185.151.30.208),但我看不到任何 403 错误或任何明显的问题原因。

tcpdump:

12:38:35.206371 IP (tos 0x0, ttl 64, id 10246, offset 0, flags [DF], proto TCP (6), length 60)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [S], cksum 0x9a70 (incorrect -> 0xce3d), seq 709527684, win 64240, options [mss 1460,sackOK,TS val 1145455779 ecr 0,nop,wscale 7], length 0

12:38:35.212490 IP (tos 0x0, ttl 64, id 10247, offset 0, flags [DF], proto TCP (6), length 52)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [.], cksum 0x9a68 (incorrect -> 0xd0f0), ack 1090810164, win 502, options [nop,nop,TS val 1145455785 ecr 1774061831], length 0

12:38:35.213068 IP (tos 0x0, ttl 64, id 10248, offset 0, flags [DF], proto TCP (6), length 351)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [P.], cksum 0x9b93 (incorrect -> 0x362b), seq 0:299, ack 1, win 502, options [nop,nop,TS val 1145455786 ecr 1774061831], length 299

12:38:35.219896 IP (tos 0x0, ttl 64, id 10249, offset 0, flags [DF], proto TCP (6), length 52)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [.], cksum 0x9a68 (incorrect -> 0xc71e), ack 2207, win 496, options [nop,nop,TS val 1145455792 ecr 1774061839], length 0

12:38:35.221063 IP (tos 0x0, ttl 64, id 10250, offset 0, flags [DF], proto TCP (6), length 116)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [P.], cksum 0x9aa8 (incorrect -> 0x5ff2), seq 299:363, ack 2207, win 501, options [nop,nop,TS val 1145455794 ecr 1774061839], length 64

12:38:35.221177 IP (tos 0x0, ttl 64, id 10251, offset 0, flags [DF], proto TCP (6), length 138)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [P.], cksum 0x9abe (incorrect -> 0xe1f8), seq 363:449, ack 2207, win 501, options [nop,nop,TS val 1145455794 ecr 1774061839], length 86

12:38:35.221291 IP (tos 0x0, ttl 64, id 10252, offset 0, flags [DF], proto TCP (6), length 125)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [P.], cksum 0x9ab1 (incorrect -> 0xdb93), seq 449:522, ack 2207, win 501, options [nop,nop,TS val 1145455794 ecr 1774061839], length 73

12:38:35.227011 IP (tos 0x0, ttl 64, id 10253, offset 0, flags [DF], proto TCP (6), length 52)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [.], cksum 0x9a68 (incorrect -> 0xc543), ack 2439, win 501, options [nop,nop,TS val 1145455800 ecr 1774061846], length 0

12:38:35.227070 IP (tos 0x0, ttl 64, id 10254, offset 0, flags [DF], proto TCP (6), length 83)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [P.], cksum 0x9a87 (incorrect -> 0x9012), seq 522:553, ack 2439, win 501, options [nop,nop,TS val 1145455800 ecr 1774061846], length 31

12:38:35.229169 IP (tos 0x0, ttl 64, id 10255, offset 0, flags [DF], proto TCP (6), length 76)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [P.], cksum 0x9a80 (incorrect -> 0xa0f1), seq 553:577, ack 2614, win 501, options [nop,nop,TS val 1145455802 ecr 1774061848], length 24

12:38:35.229208 IP (tos 0x0, ttl 64, id 10256, offset 0, flags [DF], proto TCP (6), length 52)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [F.], cksum 0x9a68 (incorrect -> 0xc458), seq 577, ack 2614, win 501, options [nop,nop,TS val 1145455802 ecr 1774061848], length 0

12:38:35.234976 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [R], cksum 0xb7b6 (correct), seq 709528262, win 0, length 0

12:38:35.235003 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [R], cksum 0xb7b6 (correct), seq 709528262, win 0, length 0

12:38:35.235026 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.50.42780 > 185.151.30.208.443: Flags [R], cksum 0xb7b5 (correct), seq 709528263, win 0, length 0

摘录自sudo strace -f -o file -p 3043635:

3043960 futex(0xc000046d48, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>

3043636 <... nanosleep resumed>NULL)    = 0

3043960 <... futex resumed>)            = 1

3043638 <... futex resumed>)            = 0

3043636 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>

3043638 futex(0xc000046d48, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>

3043960 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP <unfinished ...>

3043636 <... nanosleep resumed>NULL)    = 0

3043960 <... socket resumed>)           = 8

3043636 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>

3043960 connect(8, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("185.151.30.208")}, 16) = -1 EINPROGRESS (Operation now in progress)

3043636 <... nanosleep resumed>NULL)    = 0

3043960 epoll_ctl(5, EPOLL_CTL_ADD, 8, {events=EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, data={u32=2636876800, u64=140362168110080}} <unfinished ...>

3043636 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>

3043960 <... epoll_ctl resumed>)        = 0

3043960 write(7, "\0", 1)               = 1

3043636 <... nanosleep resumed>NULL)    = 0

3043958 <... epoll_pwait resumed>[{events=EPOLLIN, data={u32=15774768, u64=15774768}}], 128, 9499, NULL, 2321375387197960) = 1

3043960 futex(0xc000046d48, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>

3043636 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>

3043960 <... futex resumed>)            = 1

3043958 read(6,  <unfinished ...>

3043638 <... futex resumed>)            = 0

3043960 futex(0xc000081148, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>

3043958 <... read resumed>"\0", 16)     = 1

3043638 futex(0xc000046d48, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>

3043636 <... nanosleep resumed>NULL)    = 0

3043958 epoll_pwait(5,  <unfinished ...>

3043636 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>

3043958 <... epoll_pwait resumed>[], 128, 0, NULL, 2321375387197960) = 0

3043958 epoll_pwait(5,  <unfinished ...>

3043636 <... nanosleep resumed>NULL)    = 0

3043636 futex(0xedd178, FUTEX_WAIT_PRIVATE, 0, {tv_sec=9, tv_nsec=463217921} <unfinished ...>

3043958 <... epoll_pwait resumed>[{events=EPOLLOUT, data={u32=2636876800, u64=140362168110080}}], 128, 9463, NULL, 2321375387197773) = 1

3043958 futex(0xedd178, FUTEX_WAKE_PRIVATE, 1) = 1

3043958 getsockopt(8, SOL_SOCKET, SO_ERROR,  <unfinished ...>

3043636 <... futex resumed>)            = 0

3043958 <... getsockopt resumed>[0], [4]) = 0

3043636 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>

3043958 getpeername(8, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("185.151.30.208")}, [112 => 16]) = 0

3043636 <... nanosleep resumed>NULL)    = 0

3043958 futex(0xc000046d48, FUTEX_WAKE_PRIVATE, 1) = 1

3043638 <... futex resumed>)            = 0

3043636 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>

3043958 getsockname(8,  <unfinished ...>

3043638 epoll_pwait(5,  <unfinished ...>

@DazWilkin 注意到的编辑 2openssl命令在我的服务器上出现错误(Verify return code: 21 (unable to verify the first certificate)。在检查了网站后,https://www.ssllabs.com证书路径中似乎有额外的下载,并且我的服务器上丢失了几个中间证书。所以我修复了该问题现在这些openssl命令可以正常工作,没有任何证书错误。

但是,Blackbox http_2xx 仍然返回 403

ubuntu
  • 1 个回答
  • 64 Views
Martin Hope
codlord
Asked: 2022-02-16 23:46:21 +0800 CST

Ubiquiti UniFi PoE 交换机在采用之前可以作为非网管交换机使用吗?

  • 1

我知道一些托管交换机可以直接用作非托管交换机,但我有一个带有 UniFi US-16-150W PoE 交换机的站点,没有人知道它是如何设置的或密码/控制器信息。

我的问题是:有谁知道我是否将交换机恢复出厂设置,是否可以在不采用和不使用 UniFi 控制器软件等的情况下将其用作非托管 PoE 交换机?

我查看了手册,但不清楚开关是否可以开箱即用(在采用之前)。我想在恢复出厂设置之前知道答案!

谢谢

networking
  • 0 个回答
  • 386 Views

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