丢失了与Ubuntu服务器终端的网络接口

时间:2017-11-26 21:24:17

标签: terminal ubuntu-14.04 ifconfig

尝试在Ubuntu上运行Minecraft服务器。我只有终端,没有GNOME。不知何故,我失去了网络。 func reverse(_ x : Int) -> Int { var stringConversion = String(x) var negativeCharacter = false var finalreversedString = String() let signedInt = 2147483647 //Max for Int 32 let unSignedInt = -2147483647 // Min for Int 32 if stringConversion.contains("-"){ stringConversion.removeFirst() negativeCharacter = true } var reversedString = String(stringConversion.reversed()) if reversedString.first == "0" { reversedString.removeFirst() } if negativeCharacter { finalreversedString = "-\(reversedString)" } else { finalreversedString = reversedString } return (x == 0 || Int(finalreversedString)! > signedInt || Int(finalreversedString)! < unSignedInt) ? 0 : Int(finalreversedString)! } 仅显示环回。

ifconfig 所示:

/etc/udev/rules.d/70-persistent-net.rules

# PCI device 0x8086:0x1050 (e100) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:f1:85:4f:f2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" 所示:

/etc/network/interfaces

当我运行auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp 时 我明白了:

sudo ifup eth0

1 个答案:

答案 0 :(得分:0)

您是否尝试重新启动并在内核消息中查找接口?

这些来自几年前我对CentOS的说明(我意识到你说过Ubuntu)(但70-persistent-net.rules部分让我觉得这可能会有所帮助):

  1. 编辑/ etc / sysconfig / network-scripts / ifcfg-eth0。删除HWADDR行
  2. rm /etc/udev/rules.d/70-persistent-net.rules
  3. 重新启动
  4. 参考:http://joshbolling.com/2012/04/29/force-centos-6-to-re-detect-network-devices/