我想通过 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 update
。apt-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
答案1
丹尼斯:我有以下两句台词/etc/网络/接口已经并ifup lo
已尝试过。当我这样做时,我显示“接口 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
现在它又能工作了,既能ping 也能对 FPGA 进行编程。
非常感谢。
答案2
尝试将以下行添加到 /etc/network/interfaces:
auto lo
iface lo inet loopback
然后做
ifup lo