Warm tip: This article is reproduced from serverfault.com, please click

linux-Ubuntu 14.04中缺少网络回送设备

(Network loopback device missing in Ubuntu 14.04)

发布于 2021-03-19 08:26:07

我想通过JTAG对FPGA进行编程,而xmd脚本会连接到127.0.0.1:3121来执行此操作。这很好地工作了几个月。重新启动后,此连接突然不复存在了,我也无法再ping 127.0.0.1或localhost(仍解析为127.0.0.1)。ifconfig缺少“ lo”。我有两个网卡eth4和eth5的条目,但是没有lo。全部输出在问题的末尾。与其他计算机之间的连接正常。如何重新运行?

我尝试手动启动它,但没有任何改变:

> ifup lo
ifup: interface lo already configured

> ifup --force lo  
(no output)

这也不起作用:

> route add -host 127.0.0.1 dev lo  
SIOCADDRT: No such device

一些诊断输出:

> route -n  
Kernel IP routing table  
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  
0.0.0.0         192.168.153.1   0.0.0.0         UG    0      0        0 eth5  
192.168.10.0    0.0.0.0         255.255.255.0   U     1      0        0 eth4  
192.168.153.0   0.0.0.0         255.255.255.0   U     1      0        0 eth5  

> cat /var/run/network/ifstate  
lo=lo

> cat /etc/network/interfaces  
# interfaces(5) file used by ifup(8) and ifdown(8)  
auto lo  
iface lo inet loopback

> iptables -L  
Chain INPUT (policy ACCEPT)  
target     prot opt source               destination           

Chain FORWARD (policy ACCEPT)  
target     prot opt source               destination           

Chain OUTPUT (policy ACCEPT)  
target     prot opt source               destination

我没有/etc/iptables.conf

我也试着sudo rm -rf /var/run/network/*这个问题我所做的apt-get updateapt-get upgrade没变化。

> ifconfig 127.0.0.1 lo  
lo: Unknown host  
ifconfig: `--help' gives usage information.

ifconfig的输出:

eth4      Link encap:Ethernet  HWaddr 00:24:e8:45:8f:10    
          inet addr:192.168.10.2  Bcast:192.168.10.255  Mask:255.255.255.0  
          inet6 addr: fe80::224:e8ff:fe45:8f10/64 Scope:Link  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1  
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0  
          TX packets:67 errors:0 dropped:0 overruns:0 carrier:0  
          collisions:0 txqueuelen:1000   
          RX bytes:0 (0.0 B)  TX bytes:10916 (10.9 KB)  
          Interrupt:21 Memory:f7fe0000-f8000000   

eth5      Link encap:Ethernet  HWaddr d8:eb:97:71:be:e5    
          inet addr:192.168.153.124  Bcast:192.168.153.255  Mask:255.255.255.0  
          inet6 addr: fe80::daeb:97ff:fe71:bee5/64 Scope:Link  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1  
          RX packets:35392 errors:0 dropped:0 overruns:0 frame:0  
          TX packets:28754 errors:0 dropped:0 overruns:0 carrier:0  
          collisions:0 txqueuelen:1000   
          RX bytes:20734790 (20.7 MB)  TX bytes:4354467 (4.3 MB) 

编辑:

> ip link  
1: ttyUSB0: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default  
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00  
2: eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000  
link/ether d8:eb:97:71:be:e5 brd ff:ff:ff:ff:ff:ff  
3: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000  
link/ether 00:24:e8:45:8f:10 brd ff:ff:ff:ff:ff:ff 
Questioner
Martin
Viewed
33
5,197 2019-01-24 17:34:17

丹尼斯:我已经在/ etc / network / interfaces中有这两行,并且ifup lo已经尝试过了。这样做时,我说“接口已配置”,如果添加,则什么也没有--force

Ginnungagap有一个正确的想法。我可以将ttyUSB0从“ DOWN”带到“ UNKNOWN”:

> sudo ip link set ttyUSB0 up

现在的输出是

1: ttyUSB0: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

现在它可以再次工作,可以对FPGA进行ping和编程。

非常感谢你。