【问题标题】:ifup eth0 on every boot [closed]每次启动时 ifup eth0 [关闭]
【发布时间】:2013-01-11 23:21:09
【问题描述】:

04 默认内核不支持网卡。 所以,我将内核升级到 3.2 并且它支持它。 但是,每次我重启机器时,都需要sudo ifup eth0 来调出它。

如何修改一些配置以自动调出 eht0? (不写/etc/rc.local,因为我在/etc/fstab上挂载NFS,它需要比rc.local先挂载)。

【问题讨论】:

  • 请运行"> cat /etc/network/interfaces" 并在此处发布。
  • 哎呀,也许我忘记了 auto eth0,非常感谢 :)

标签: linux ubuntu-11.04


【解决方案1】:

在 Ubuntu 中,您必须编辑 /etc/network/interfaces 并为系统上的每个网络接口设置默认配置数据。

auto 和您的接口名称放在接口配置之前的单独一行中,以便在启动时显示它。

示例: 当你的配置是这样的时候

iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

你必须把它改成这个

auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

Network card configuration

【讨论】:

【解决方案2】:

你可以 eidt /etc/sysconfig/network-scripts/ifcfg-eth0 文件。 带有文件内容的 serach ONBOOT。 并将ONBOOT=no 更改为ONBOOT=yes

【讨论】:

  • 小心,这个问题被标记为 Ubuntu-11.04。您的方法适用于类似 Red Hat 的发行版
  • 谢谢,它可以在 Centos 7 上运行
猜你喜欢
  • 2018-05-09
  • 1970-01-01
  • 2013-08-14
  • 1970-01-01
  • 2013-04-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-03
相关资源
最近更新 更多