Ping 可以工作,但 wget、curl 和 apt 不行...请禁用防火墙以确保问题不在这里

Ping 可以工作,但 wget、curl 和 apt 不行...请禁用防火墙以确保问题不在这里

因此,正如消息中所说,目前根本没有运行防火墙,但 curl/wget 不起作用,而 ping 起作用(此外,我通过 SSH 连接到机器,apache2 可以工作,因此它可以在端口 80 上接收请求)。这是一个古老的谜团!以下是一些希望有用的信息...

我确信这不是防火墙问题(防火墙已完全禁用)

我的 /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
auto lo inet loopback

# The primary network interface
#auto eno2
#iface eno2 inet static

auto eno1
iface eno1 inet manual
bond-master bond0

auto eno2
iface eno2 inet manual
bond-master bond0
bond-primary eno2

auto bond0
iface bond0 inet static
bond-mode active-backup
bond-miimon 100
bond-slaves none

重启网络失败

systemctl restart networking.service
Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.

这是我得到的错误

systemctl status networking.service
â networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/networking.service.d
           ââ50-insserv.conf-$network.conf
   Active: failed (Result: exit-code) since Mon 2021-02-08 13:23:08 EST; 13s ago
     Docs: man:interfaces(5)
  Process: 28918 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 28913 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=exited, status=0/S
 Main PID: 28918 (code=exited, status=1/FAILURE)

Feb 08 13:23:08 ubuntu systemd[1]: Starting Raise network interfaces...
Feb 08 13:23:08 ubuntu sh[28913]: Unknown interface inet
Feb 08 13:23:08 ubuntu sh[28913]: Unknown interface loopback
Feb 08 13:23:08 ubuntu ifup[28918]: Unknown interface inet
Feb 08 13:23:08 ubuntu ifup[28918]: Unknown interface loopback
Feb 08 13:23:08 ubuntu systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Feb 08 13:23:08 ubuntu systemd[1]: Failed to start Raise network interfaces.
Feb 08 13:23:08 ubuntu systemd[1]: networking.service: Unit entered failed state.
Feb 08 13:23:08 ubuntu systemd[1]: networking.service: Failed with result 'exit-code'.

更新

感谢@JohnRonald,我更新了 iface 行并成功重新启动网络,但并没有解决 curl/wget 问题。

这是 curl 错误@raj

--2021-02-08 14:56:03-- (try: 6) 
reddit.com Connecting to www.reddit.com (www.reddit.com)|151.101.1.140|:80... failed: Connection timed out. 
Connecting to www.reddit.com (www.reddit.com)|151.101.65.140|:80... failed: Connection timed out. 
Connecting to www.reddit.com (www.reddit.com)|151.101.129.140|:80..

有任何想法吗?

答案1

这是我的运行配置:

自动 eno1
iface eno1 inet 手动
bond-master bond0

自动 eno2
iface eno2 inet 手动
bond-master bond0

自动 bond0
iface bond0 inet 手动
bond-模式 4
bond-miimon 100
bond-xmit_hash_policy layer3+4
bond-lacp-rate 1
bond-从属 eno1 eno2

相关内容