【问题标题】:Docker container not using NordLayer VPN while connecting to internetDocker 容器在连接到 Internet 时未使用 NordLayer VPN
【发布时间】:2022-01-11 12:54:42
【问题描述】:

我希望我的本地 docker 容器连接到我的 MongoDB Atlas。但似乎当我连接到 NordLayer VPN 时,容器没有使用我们在 Atlas 上保留并列入白名单的 Nord 静态 IP。

如果我从容器中执行“curl https://ipinfo.io/ip"”,它会显示一些随机公共 IP,如果我在 google 上执行“我的 IP 是什么?”那么它会显示 Nord 的静态 IP,这表明容器不是使用 VPN 上网,但常规浏览使用 VPN IP。

我已经阅读并实施了许多帖子,但到目前为止没有任何东西对我有用。

版本:Ubuntu 20.04.3 LTS

尝试连接时出现以下错误: 连接错误:MongooseServerSelectionError:无法连接到 MongoDB Atlas 集群中的任何服务器。一个常见原因是您尝试从未列入白名单的 IP 访问数据库。确保您当前的 IP 地址在 Atlas 集群的 IP 白名单中:https://docs.atlas.mongodb.com/security-whitelist/

仅供参考:- 相同的设置适用于 Mac

【问题讨论】:

  • 在不知道 API 返回的随机 IP 地址的情况下很难进行故障排除。
  • $ nordlayer settings set 选择要更改的设置: 1:VPN 协议 2:自动连接 3:始终连接到 4:ThreatBlock 选择 [数字]:1 VPN 协议 1 的可用值:自动 2: IKEv2/IPSec 3:OpenVPN TCP 4:OpenVPN UDP 选择[编号]:4
  • 您可能想尝试使用选项--net=host 运行您的容器,请参阅docs.docker.com/network/host
  • 在 NordLayer 上进行协议更改后,该问题已得到解决。我已列出解决问题所需的步骤。

标签: docker ubuntu docker-networking docker-network


【解决方案1】:

更改 Nordlayer 协议 tp OpenVPN UDP 后问题解决

$ nordlayer 设置设置

Select setting to change:
  1: VPN Protocol 
  2: Auto-connect 
  3: Always connect to 
  4: ThreatBlock 

Select [number]: 1 

Available values for VPN Protocol 
  1: Automatic 
  2: IKEv2/IPSec 
  3: OpenVPN TCP 
  4: OpenVPN UDP 

选择[数字]:4

【讨论】:

    猜你喜欢
    • 2017-05-19
    • 2021-12-08
    • 2023-03-23
    • 2019-08-11
    • 1970-01-01
    • 2021-02-08
    • 2021-07-18
    • 2017-04-19
    • 2016-11-24
    相关资源
    最近更新 更多