我一直在尝试使用直接插入 Netgear 路由器的以太网电缆让 Beaglebone Black 连接到互联网。我尝试了很多事情,但到目前为止没有任何效果。
以下是一些相关输出。
系统控制
# Yesterday, internet not working
● networking.service loaded failed failed Raise network interfaces
# Today after reflashing beaglebone, internet still not working
networking.service loaded active exited Raise network interfaces
IP地址
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
link/can
3: can1: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
link/can
4: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether a0:f6:fd:8a:ec:7e brd ff:ff:ff:ff:ff:ff
inet 192.168.0.10/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.0.123/24 brd 192.168.0.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 2600:8806:502:b00:a2f6:fdff:fe8a:ec7e/64 scope global mngtmpaddr dynamic
valid_lft 86390sec preferred_lft 86390sec
inet6 fe80::a2f6:fdff:fe8a:ec7e/64 scope link
valid_lft forever preferred_lft forever
ip路由
default via 192.168.0.1 dev eth0
68.105.28.11 via 192.168.0.1 dev eth0
68.105.28.12 via 192.168.0.1 dev eth0
68.105.29.11 via 192.168.0.1 dev eth0
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.10
192.168.0.1 dev eth0 scope link
192.168.6.0/30 dev usb1 proto kernel scope link src 192.168.6.2 linkdown
192.168.7.0/30 dev usb0 proto kernel scope link src 192.168.7.2 linkdown
212.227.81.55 via 192.168.0.1 dev eth0
托管 google.com
;; connection timed out; no servers could be reached
ping www.google.com
ping: www.google.com: Temporary failure in name resolution
ping 192.168.0.1(路由器)
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
--- 192.168.0.1 ping statistics ---
9 packets transmitted, 0 received, 100% packet loss, time 8199ms
ping 192.168.0.39(我的电脑,通过以太网连接到同一路由器)
PING 192.168.0.39 (192.168.0.39) 56(84) bytes of data.
64 bytes from 192.168.0.39: icmp_seq=1 ttl=64 time=0.432 ms
64 bytes from 192.168.0.39: icmp_seq=2 ttl=64 time=0.324 ms
64 bytes from 192.168.0.39: icmp_seq=3 ttl=64 time=0.389 ms
64 bytes from 192.168.0.39: icmp_seq=4 ttl=64 time=0.387 ms
--- 192.168.0.39 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 0.324/0.383/0.432/0.038 ms
我不知道如何解决这个问题。昨天当我开始写这个问题时它开始工作,然后它开始神秘地工作。我今天早上重新启动后,它又不起作用了。
答案1
转到/etc/network/interfaces
然后添加:
auto eth0
iface eth0 inet static
address 192.168.0.100 # or whatever static IP you want
netmask 255.255.255.0
gateway 192.168.0.1
重新启动后,Beaglebone 可以成功 ping Google。