“以太网口测试”的版本间的差异
(未显示同一用户的8个中间版本) | |||
第18行: | 第18行: | ||
orangepi@orangepi:~$ '''ifconfig'''<br> | orangepi@orangepi:~$ '''ifconfig'''<br> | ||
Command 'ifconfig' is available in the following places<br> | Command 'ifconfig' is available in the following places<br> | ||
− | + | <span></span> */sbin/ifconfig<br> | |
− | + | <span></span> */usr/sbin/ifconfig<br> | |
The command could not be located because '/sbin:/usr/sbin' is not included in the PATH environment variable.<br> | The command could not be located because '/sbin:/usr/sbin' is not included in the PATH environment variable.<br> | ||
This is most likely caused by the lack of administrative privileges associated with your user account.<br> | This is most likely caused by the lack of administrative privileges associated with your user account.<br> | ||
第30行: | 第30行: | ||
2. 在调试串口终端输入 '''ip addr show eth0''' 命令来查看 IP 地址<br> | 2. 在调试串口终端输入 '''ip addr show eth0''' 命令来查看 IP 地址<br> | ||
3. 如果没有调试串口,也没有 '''HDMI''' 显示器,还可以通过路由器的管理界面来查看开发板网口的 '''IP''' 地址。不过这种方法经常有人会无法正常看到开发板的 '''IP''' 地址。如果看不到,调试方法如下所示:<br> | 3. 如果没有调试串口,也没有 '''HDMI''' 显示器,还可以通过路由器的管理界面来查看开发板网口的 '''IP''' 地址。不过这种方法经常有人会无法正常看到开发板的 '''IP''' 地址。如果看不到,调试方法如下所示:<br> | ||
− | A) 首先检查 '''Linux''' 系统是否已经正常启动,如果开发板的绿灯在闪烁了,一般是正常启动了,如果只亮红灯,说明系统都没正常启动;<br> | + | '''A)''' 首先检查 '''Linux''' 系统是否已经正常启动,如果开发板的绿灯在闪烁了,一般是正常启动了,如果只亮红灯,说明系统都没正常启动;<br> |
− | B) 检查网线有没有插紧,或者换根网线试下;<br> | + | '''B)''' 检查网线有没有插紧,或者换根网线试下;<br> |
− | C) 换个路由器试下(路由器的问题有遇到过很多,比如路由器无法正常分配'''IP''' 地址,或者已正常分配 '''IP''' 地址但在路由器中看不到);<br> | + | '''C)''' 换个路由器试下(路由器的问题有遇到过很多,比如路由器无法正常分配'''IP''' 地址,或者已正常分配 '''IP''' 地址但在路由器中看不到);<br> |
− | D) 如果没有路由器可换就只能连接 '''HDMI''' 显示器或者使用调试串口来查看 '''IP'''地址。<br> | + | '''D)''' 如果没有路由器可换就只能连接 '''HDMI''' 显示器或者使用调试串口来查看 '''IP'''地址。<br><br> |
− | |||
另外需要注意的是开发板 '''DHCP''' 自动分配 '''IP''' 地址是不需要任何设置的。<br> | 另外需要注意的是开发板 '''DHCP''' 自动分配 '''IP''' 地址是不需要任何设置的。<br> | ||
|} | |} | ||
第41行: | 第40行: | ||
|- | |- | ||
|orangepi@orangepi:~$ '''ping www.baidu.com -I eth0'''<br> | |orangepi@orangepi:~$ '''ping www.baidu.com -I eth0'''<br> | ||
− | PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data. 64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms<br> | + | PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data. <br> |
+ | 64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=56 time=6.74 ms<br> | ||
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms<br> | 64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=56 time=6.80 ms<br> | ||
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms<br> | 64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=56 time=6.26 ms<br> | ||
第47行: | 第47行: | ||
^C<br> | ^C<br> | ||
--- www.a.shifen.com ping statistics ---<br> | --- www.a.shifen.com ping statistics ---<br> | ||
− | 4 packets transmitted, 4 received, 0% packet loss, time 3002ms | + | 4 packets transmitted, 4 received, 0% packet loss, time 3002ms<br> |
+ | rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms | ||
|}<br> | |}<br> |
2023年4月24日 (一) 19:42的最新版本
1) 首先将网线的一端插入开发板的以太网接口,网线的另一端接入路由器,并确保网络是畅通的
2) 系统启动后会通过 DHCP 自动给以太网卡分配 IP 地址,不需要其他任何配置
3) 在开发板的 Linux 系统中查看 IP 地址的命令如下所示
orangepi@orangepi:~$ ip addr show eth0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
|
当使用 ifconfig 查看 IP 地址时,如果提示下面的信息,是因为没有加 sudo 导致的,正确的命令是:sudo ifconfig orangepi@orangepi:~$ ifconfig |
开发板启动后查看 IP 地址有三种方法: 1. 接 HDMI 显示器,然后登录系统使用 ip addr show eth0 命令查看 IP 地址 |
4) 测试网络连通性的命令如下,ping 命令可以通过 Ctrl+C 快捷键来中断运行
orangepi@orangepi:~$ ping www.baidu.com -I eth0 PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data. |