Ubuntu 16.04 重建 Squid 源包后出现错误:无法启动提升网络接口

Ubuntu 16.04 重建 Squid 源包后出现错误:无法启动提升网络接口

我在虚拟托管的 Ubuntu 16.04 服务器上运行。这是一个 IPv4 -> IPv6 设置,我从提供商处获得了 IPv6 WAN 地址。

我这样配置了我的 /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
iface lo inet loopback

# The primary network interface
auto enp1s0
iface enp1s0 inet dhcp

iface enp1s0 inet6 static
    address xxxx:bc8:247b:100::/56
    accept_ra 1

iface enp1s0 inet6 static
    address xxxx:bc8:247b:100::/64
    accept_ra 1

似乎最后一部分导致了错误:“无法启动 Raise 网络接口。”这是在尝试“sudo systemctl restart networking”之后发生的。

iface enp1s0 inet6 static
    address xxxx:bc8:247b:100::/64
    accept_ra 1

这仅在我通过源重建 squid 包后才会发生: https://www.metahackers.pro/spoof-http-header-using-squid-proxy

因为在我重建 squid 之前,上述配置确实有效,我甚至配置了 100 多个额外的 IPv6,并且全部有效,可以从外部 ping 通。+ 我能够将它们用作代理。我重建 squid 以启用“--enable-http-violations”,从而能够创建精英代理。重建后,一切正常,然后 8-10 小时后,我的所有 IPv6 突然都不再工作,我收到了上面解释的错误消息。

这是我的 ifconfig:

enp1s0    Link encap:Ethernet  HWaddr 00:08:a2:0b:49:70
          inet addr:xx.xx.169.13  Bcast:xx.xx.169.255  Mask:255.255.255.0
          inet6 addr: xxxx:bc8:247b:100::1/56 Scope:Global
          inet6 addr: fe80::208:a2ff:fe0b:4970/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29809 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11124 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2718587 (2.7 MB)  TX bytes:1780201 (1.7 MB)
          Memory:dfe00000-dfe7ffff

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:624 errors:0 dropped:0 overruns:0 frame:0
          TX packets:624 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:60301 (60.3 KB)  TX bytes:60301 (60.3 KB)

完整错误信息:

● 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 Tue 2019-01-08 09:48:56 CET; 8s ago
     Docs: man:interfaces(5)
  Process: 2595 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=0/SUCCESS)
  Process: 3176 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 3170 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --
 Main PID: 3176 (code=exited, status=1/FAILURE)

Jan 08 09:48:56 sd-126671 dhclient[3185]: DHCPACK of xx.xx.169.13 from xx.xx.169.1
Jan 08 09:48:56 sd-126671 ifup[3176]: DHCPACK of xx.xx.169.13 from xx.xx.169.1
Jan 08 09:48:56 sd-126671 ifup[3176]: RTNETLINK answers: File exists
Jan 08 09:48:56 sd-126671 ifup[3176]: bound to xx.xx.169.13 -- renewal in 2147483648 seconds.
Jan 08 09:48:56 sd-126671 ifup[3176]: RTNETLINK answers: File exists
Jan 08 09:48:56 sd-126671 ifup[3176]: Failed to bring up enp1s0.
Jan 08 09:48:56 sd-126671 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jan 08 09:48:56 sd-126671 systemd[1]: Failed to start Raise network interfaces.
Jan 08 09:48:56 sd-126671 systemd[1]: networking.service: Unit entered failed state.
Jan 08 09:48:56 sd-126671 systemd[1]: networking.service: Failed with result 'exit-code'.

我该怎么做才能解决这个问题以及我做错了什么?

答案1

squid 软件包的重建不是问题的根源。Squid 或 squid 软件包的重建不会影响网络配置。

错误消息RTNETLINK answers: File exists表明,默认网关配置可能存在问题(1或者2)。因为/etc/network/interface有 3 个条目enp1s0,其中 2 个accept_ra启用了该选项。在手册页,但路由器通告可能会尝试添加另一个默认网关。

答案2

删除以下内容后:

iface enp1s0 inet6 static
address xxxx:bc8:247b:100::/56
accept_ra 1

问题解决了。别问我为什么,但看起来子网 56 和 64 不喜欢在接口文件中在一起。哈哈

我的所有 IPv6 均已启动并且运行良好!

相关内容