Beaglebone black eth0没有获得静态ip配置

时间:2015-01-12 13:41:45

标签: networking beagleboneblack

我有一个接口eth0,我添加到bridge(br-lan)。

然后我想将eth0的IP提供给br-lan并将eth0带到没有IP的状态。

我做了以下步骤但是在一段时间之后,eth0获得了另一个与br-lan不同但在同一子网内的DHCP IP。

# brctl addbr br-lan
# brctl addif br-lan eth0
# ifconfig br-lan up
# ifconfig
br-lan    Link encap:Ethernet  HWaddr d0:39:72:54:c5:93  
      inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
      inet6 addr: fd00:aaaa::d239:72ff:fe54:c593/64 Scope:Global
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:545 errors:0 dropped:0 overruns:0 frame:0
      TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:44350 (43.3 KiB)  TX bytes:6125 (5.9 KiB)

eth0  Link encap:Ethernet  HWaddr d0:39:72:54:c5:93  
      inet addr:192.168.11.175  Bcast:192.168.11.255  Mask:255.255.255.0
      inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:27 errors:0 dropped:0 overruns:0 frame:0
      TX packets:306 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:5145 (5.0 KiB)  TX bytes:37372 (36.4 KiB)
      Interrupt:40

root@beaglebone:~# ifconfig eth0 0.0.0.0
root@beaglebone:~# ifconfig 
br-lan    Link encap:Ethernet  HWaddr d0:39:72:54:c5:93  
      inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
      inet6 addr: fd00:aaaa::d239:72ff:fe54:c593/64 Scope:Global
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:545 errors:0 dropped:0 overruns:0 frame:0
      TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:44350 (43.3 KiB)  TX bytes:6125 (5.9 KiB)

eth0  Link encap:Ethernet  HWaddr d0:39:72:54:c5:93  
      inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:35 errors:0 dropped:0 overruns:0 frame:0
      TX packets:313 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:6048 (5.9 KiB)  TX bytes:37792 (36.9 KiB)
      Interrupt:40

root@beaglebone:~# dhclient br-lan
root@beaglebone:~# ifconfig 
br-lan    Link encap:Ethernet  HWaddr d0:39:72:54:c5:93  
      inet addr: 192.168.11.192  Bcast:192.168.11.255  Mask:255.255.255.0
      inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
      inet6 addr: fd00:aaaa::d239:72ff:fe54:c593/64 Scope:Global
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:548 errors:0 dropped:0 overruns:0 frame:0
      TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:45134 (44.0 KiB)  TX bytes:9094 (8.8 KiB)

 eth0      Link encap:Ethernet  HWaddr d0:39:72:54:c5:93  
      inet addr:192.168.11.175  Bcast:192.168.11.255  Mask:255.255.255.0
      inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:499 errors:0 dropped:0 overruns:0 frame:0
      TX packets:794 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:42497 (41.5 KiB)  TX bytes:74010 (72.2 KiB)
      Interrupt:40

有没有人知道为什么eth0会找回不同的IP?

我的/ etc / network / interfaces没有配置eth0 DHCP。事实上即使我添加以下行,eth0仍然获得192.168.11.X IP" dhclient br-lan"

 auto eth0
 iface eth0 inet static
   address 192.168.0.102
   netmask 255.255.255.0
  network 192.168.0.0
  gateway 192.168.0.1

如何让eth0网络获取DHCP IP并坚持使用无IP

我在Beaglebone上运行Debian 7.4

1 个答案:

答案 0 :(得分:1)

显然wicd正在重新连接eth0。以下步骤解决了自动重新连接eth0的问题

  1. 在/etc/wicd/manager-settings.conf中更改“auto_reconnect = True”为“auto_reconnect = False”

  2. /etc/init.d/wicd restart