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 / 问题 / 584722
Accepted
Riccardo Magrini
Riccardo Magrini
Asked: 2015-02-13 07:34:50 +0800 CST2015-02-13 07:34:50 +0800 CST 2015-02-13 07:34:50 +0800 CST

在虚拟 ubuntu 14.04 服务器上设置两个网络接口的问题[关闭]

  • 772
关闭。这个问题跑题了。它目前不接受答案。

这描述了一个无法重现的问题,该问题似乎自行消失或仅与非常特定的时间段相关。这是题外话,因为它不太可能帮助未来的读者。

7 年前关闭。

改进这个问题

我必须分配给 VM(ubuntu 14.04,使用 virt-manager 安装在虚拟环境中)。在 virt-manager 上我已经创建了 2 个这样的 vnetwork

在此处输入图像描述

这是分配了 2 个 vnet 的 VM

在此处输入图像描述

而接口文件是这样配置的

sudo nano /etc/network/interfaces

# The PUBLIC first network interface
auto eth0
iface eth0 inet static
        address 1.1.1.254
        netmask 255.255.255.0
        network 1.1.1.0
        broadcast 1.1.1.255
        gateway 1.1.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 1.1.1.1
# The PRIVATE second network interface
auto eth1
iface eth0 inet static
        address 1.1.10.254
        netmask 255.255.255.0
        network 1.1.10.0
        broadcast 1.1.10.255
        gateway 1.1.10.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 1.1.10.1

而命令 ifconfig -a 显示了所有界面

eth0      Link encap:Ethernet  HWaddr 52:54:00:36:50:3d  
          inet addr:1.1.1.254  Bcast:1.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe36:503d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:765 errors:0 dropped:3 overruns:0 frame:0
          TX packets:716 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:240028 (240.0 KB)  TX bytes:242849 (242.8 KB)

eth1      Link encap:Ethernet  HWaddr 52:54:00:9c:81:b5  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

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:22278 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22278 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:7130945 (7.1 MB)  TX bytes:7130945 (7.1 MB)

virbr0    Link encap:Ethernet  HWaddr fe:3c:72:75:26:f8  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

我还运行了 lshw -c network,界面结果为 disable

  *-network:0             
       description: Ethernet interface
       product: Virtio network device
       vendor: Red Hat, Inc
       physical id: 3
       bus info: pci@0000:00:03.0
       logical name: eth0
       version: 00
       serial: 52:54:00:36:50:3d
       width: 32 bits
       clock: 33MHz
       capabilities: msix bus_master cap_list rom ethernet physical
       configuration: broadcast=yes driver=virtio_net driverversion=1.0.0 ip=1.1.1.254 latency=0 link=yes multicast=yes
       resources: irq:11 ioport:c020(size=32) memory:fc096000-fc096fff memory:fc000000-fc03ffff
  *-network:1 DISABLED
       description: Ethernet interface
       product: Virtio network device
       vendor: Red Hat, Inc
       physical id: 4
       bus info: pci@0000:00:04.0
       logical name: eth1
       version: 00
       serial: 52:54:00:9c:81:b5
       width: 32 bits
       clock: 33MHz
       capabilities: msix bus_master cap_list rom ethernet physical
       configuration: broadcast=yes driver=virtio_net driverversion=1.0.0 latency=0 link=no multicast=yes
       resources: irq:11 ioport:c040(size=32) memory:fc097000-fc097fff memory:fc040000-fc07ffff

为什么 eth1 接口没有通过文件接收 IP 地址,而手动是?

server virt-manager
  • 0 0 个回答
  • 592 Views

0 个回答

  • Voted
  1. Best Answer
    Riccardo Magrini
    2015-02-13T08:05:49+08:002015-02-13T08:05:49+08:00

    哎呀,我太不专心了……这是错误

    auto eth1
    iface eth0 inet static
    

    我错了 iface

    • 1

相关问题

  • 使用 dpkg 手动安装软件包是否会阻止未来的升级路径?

  • 如何从命令行刻录双层 dvd iso

  • 如果在服务器机器上运行 Ubuntu 桌面版,性能损失是多少?

  • 将桌面版剥离为服务器版的最简单方法是什么?

  • 如何与无头服务器进行图形交互?

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