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
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1098235
Accepted
c3maw
c3maw
Asked: 2018-12-04 12:46:13 +0800 CST2018-12-04 12:46:13 +0800 CST 2018-12-04 12:46:13 +0800 CST

启动后绑定接口关闭

  • 772

我刚刚在专用硬件上完成了 Ubuntu Server 18.04 的全新安装。登录后,绑定的网络接口没有从 DHCP 分配 IP。如果我运行sudo dhclient绑定的接口会获得一个 IP,并且一切似乎都可以正常工作。重新启动后,我回到了非工作网络。

如果我执行sudo ip address show,我可以看到我的界面已关闭。sudo ip link bond0 up接口出现后没有IP 。

我已经看过这个问题了:Ubuntu 18.04 ethernet not configure automatically这个问题没有解决我的问题。问题包括ifup哪些在我的系统上不可用。接受的答案包括/etc/network/interfaces18.04 不可用的答案。

我看过这个问题:Ubuntu Server 18.04 waiting for Network at startup 虽然网络正常,它专门调用无线,这不是我的情况,也没有可接受的答案。

有这个问题:Ubuntu server 18.04 - No IP address with Netplan这是一个没有答案的零信誉问题。有一条评论建议捕获数据包并提交错误报告。我已经使用tcpdumpDHCP 流量运行数据包捕获,我得到的唯一数据是接口丢弃的 10 个数据包(我假设这不是 DCHP 流量)。

我没有发现任何其他似乎相关的现有问题。

所以我的问题是双重的:

  1. 这是一个错误吗?
  2. 安装后是否需要手动设置网络接口?

编辑:附加信息

lshw:

  *-network:0
       description: Ethernet interface
       product: 82576 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:05:00.0
       logical name: enp5s0f0
       version: 01
       serial: 3e:e4:cf:e3:41:b2
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.4.0-k duplex=full firmware=1.2.3 latency=0 link=yes multicast=yes port=twisted pair slave=yes speed=1Gbit/s
       resources: irq:25 memory:c0000000-c001ffff memory:c0020000-c003ffff ioport:ef80(size=32) memory:c00c0000-c00c3fff memory:c0040000-c005ffff memory:c00c4000-c00e3fff memory:c00e4000-c0103fff
  *-network:1
       description: Ethernet interface
       product: 82576 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0.1
       bus info: pci@0000:05:00.1
       logical name: enp5s0f1
       version: 01
       serial: 3e:e4:cf:e3:41:b2
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.4.0-k duplex=full firmware=1.2.3 latency=0 link=yes multicast=yes port=twisted pair slave=yes speed=1Gbit/s
       resources: irq:35 memory:c0060000-c007ffff memory:c0080000-c009ffff ioport:ef40(size=32) memory:c0104000-c0107fff memory:c00a0000-c00bffff memory:c0108000-c0127fff memory:c0128000-c0147fff
  *-network DISABLED
       description: Ethernet interface
       physical id: 1
       logical name: bond0
       serial: 3e:e4:cf:e3:41:b2
       size: 1Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=bonding driverversion=3.7.1 duplex=full firmware=2 link=no master=yes multicast=yes speed=1Gbit/s

/etc/netplan/*.yaml:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    bonds:
        bond0:
            addresses: []
            interfaces:
            - enp5s0f0
            - enp5s0f1
            parameters:
                mode: active-backup
    ethernets:
        enp5s0f0:
            addresses: []
            dhcp4: false
            dhcp6: false
        enp5s0f1:
            addresses: []
            dhcp4: false
            dhcp6: false
    version: 2
networking boot dhcp ethernet network-bonding
  • 1 1 个回答
  • 1639 Views

1 个回答

  • Voted
  1. Best Answer
    heynnema
    2018-12-04T16:02:47+08:002018-12-04T16:02:47+08:00

    我的理解是,在 Ubuntu Server上,您必须手动配置 netplan,以匹配您的实际物理和 DHCP/地址网络环境。

    尝试这个...

    注意:保持缩进为 2 个空格。

    注意:如果需要固定IP ,dhcp4: true可以改成。(仅示例地址)。addresses: [10.1.1.100/24]gateway4: 10.1.1.1

    network:
      version: 2
      renderer: networkd
        bonds:
          bond0:
            addresses: []
            dhcp4: true
            interfaces:
              - enp5s0f0
              - enp5s0f1
            parameters:
              mode: active-backup
        ethernets:
          enp5s0f0:
            addresses: []
            dhcp4: false
            dhcp6: false
          enp5s0f1:
            addresses: []
            dhcp4: false
            dhcp6: false
    

    在terminal...

    sudo netplan -debug generate# 生成配置文件

    sudo netplan apply# 应用新配置

    reboot# 重启系统并确认网络运行

    后注:有关更多netplan 示例,请参见此处,或有关 netplan 参考资料,请参见此处。

    • 0

相关问题

  • 如何通过 Windows 网络共享文件?

  • 更改 Wubi 的启动顺序

  • 面板小程序以文本形式显示当前网络流量?

  • 如何在 Ubuntu 启动时显示或隐藏启动消息?

  • 如何避免启动时出现“S to Skip”消息?

Sidebar

Stats

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

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve