网口测试

1、测试网络

用普通网线连接开发板的以太网口。先查看开发板有无 ip,

1.使用脚本测试

进入目录 /yz_test/ethernet,执行test_ethernet.sh脚本

cd /yz_test/ethernet

./test_ethernet.sh
2.使用ifconfig,命令如下:
ifconfig

在开发板中ping地址 有数据证明网络是连用的

ping www.baidu.com

2、静态ip设置

进入/etc/network目录

cd /etc/network

编辑interface文件

vi interfaces

修改ip地址

source-directory /etc/network/interfaces.d
auto eth0
iface eth0 inet static
#静态ip地址
    address 192.168.2.22
#掩码
    netmask 255.255.255.0
#网关
    gateway 192.168.2.1 

作者:lzx  创建时间:2025-02-08 18:35
最后编辑:lzx  更新时间:2025-06-13 17:37