重启后,Eth0 通过 DHCP 开启

重启后,Eth0 通过 DHCP 开启

我有一台带 IPMI 的 SUPERMICRO SYS-5015A-EHF-D525,重启时出现了一个奇怪的问题。我正在运行 Ubuntu 12.04.2 LTS 服务器。

用于活动的“主要”网络接口是 eth1。它被设置为静态地址 10.10.35.70(参见下面的代码)。

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

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth1
#iface eth1 inet dhcp

auto eth1
iface eth1 inet static
        address 10.10.35.70
        netmask 255.255.255.0
        gateway 10.10.35.1
        dns-nameservers 208.67.222.222 208.67.220.220

IPMI 接口共享 eth0。我以为它被禁用了,但重启后它就像是为 dhcp 设置的,并获取 IP 地址。IPMI 接口设置为使用 10.10.35.71,但在 Ubuntu 中没有设置。重启后 ifconfig 的输出:

~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:25:90:c8:0b:98
          inet addr:10.10.35.100  Bcast:10.10.35.255  Mask:255.255.255.0
          inet6 addr: fe80::225:90ff:fec8:b98/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1032849 errors:0 dropped:1 overruns:0 frame:0
          TX packets:427403 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:194936769 (194.9 MB)  TX bytes:62104825 (62.1 MB)
          Interrupt:16 Memory:fe9e0000-fea00000

eth1      Link encap:Ethernet  HWaddr 00:25:90:c8:0b:99
          inet addr:10.10.35.70  Bcast:10.10.35.255  Mask:255.255.255.0
          inet6 addr: fe80::225:90ff:fec8:b99/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4089738 errors:0 dropped:1400 overruns:0 frame:0
          TX packets:1561324 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3533629321 (3.5 GB)  TX bytes:149875516 (149.8 MB)
          Interrupt:17 Memory:feae0000-feb00000

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:16436  Metric:1
          RX packets:7628905 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7628905 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1978672469 (1.9 GB)  TX bytes:1978672469 (1.9 GB)

当系统重新启动时,双 IP 地址在某些情况下会导致路由和连接问题。我可以运行,sudo ifconfig eth0 down但我想确定一种方法来阻止 eth0 首先获取 IP 地址。

答案1

/etc/network/interfaces在该行中添加一个针对您的 eth0 卡的节,这将停止网络管理器执行其操作。

iface eth0 inet manual

相关内容