默认使用IP:
电脑:192.168.1.192
Ubuntu主机:192.168.1.191
开发板:192.168.1.190
子网掩码:255.255.255.0
特别注意这里:开发板与Ubuntu ping通的前提是使用桥接并且是静态static方式,采用动态dhcp方式无法ping通。确认三者能互ping,即同一网段。
打开Ubuntu上网配置文件vim /etc/network/interfaces:
auto eth0
iface eth0 inet static
address 192.168.1.191
gateway 192.168.1.254
netmask 255.255.255.0
设置成上面方式。
重启网卡:
ifdown eth0 ifdup eth0
基于Ubuntu16.04 NFS挂载远程开发板目录:
条件:1、开发板内核支持nfs,可以通过cat /proc/filesystems查看是否存在nodev nfs项,有则说明支持。
2、主机Ubuntu安装了NFS服务,安装步骤:
1)
sudo apt-get install nfs-kernel-server
2)
sudo vi /etc/export
添加配置:/home/nfsroot *(rw,sync,no_root_squash) /home/nfsroot 为刚刚建的目录,此项为添加共享文件的路径。
3)重启NFS服务
service nfs-kernel-server restart
完成上面就可以在开发板使用SecureCRT来挂载:
挂载命令:
mount -t nfs -o nolock 192.168.1.191:/home/nfsroot/ /tmp/nfsroot/
命令说明:IP为目标主机Ubuntu16.04的IP,/home/nfsroot/为Ubuntu的NFS共享目录 /tmp/nfsroot/是开发板要挂载远程目录的挂载点
此时在开发板下ls命令就可以看到Ubuntu下/home/nfsroot的内容了,实现文件共享。