connection - 如何将主机 PC 连接到 ZedBoard 并共享主机 PC 互联网访问?
问题描述
我尝试使用我的主机 PC 连接到一个 digilent ZedBoard,我可以使用 UART 进行连接,但我无法通过 ssh 进入开发板或进一步使用我的主机 PC 互联网连接通过 ZedBoard 访问互联网。
- Zedboard 正在运行:
Xillinux distribution for Zynq-7000 EPP
- 主机 PC 正在运行:
Ubuntu 16.04
我应该如何设置?
解决方案
我们将完成使用UART和以太网端口与digilent Zedboard 通信的步骤。
使用 UART 端口
将主机 (USB) 连接到 zedboard 的 UART 端口 (micro USB) 并在主机上执行:
# Install minicom
apt update && apt install minicom
minicom –D /dev/ttyACM0 –b 115200 -8 -o
恭喜,您已连接到 zedboard * 如需 minicom 帮助:CTRL+a z
* 退出 minicomCTRL+a x
使用开发板的以太网端口连接
使用主机系统上的以太网端口或以太网到 USB 适配器将 zedboard 连接到主机。默认情况下,zedboard 的操作系统将 eth0 配置为具有以下静态 IP:192.168.1.10
在主机上配置:
- 网络连接>(选择zedboard的连接接口)>编辑> IPv4设置:
- 更改
Method
为Manual
- 将地址编辑为:
192.168.1.1
- 将网络掩码编辑为:
255.255.255.0
使用主机上的菜单断开并连接到您刚刚配置的接口。
- 通过以下方式连接到电路板:
ssh root@192.168.1.10
与 zedboard 共享您的 PC 互联网
网络连接 >(选择连接接口)> 编辑 > IPv4 设置:* 更改Method
为Share to other computers
使用主机上的菜单断开连接并连接到刚刚配置的接口执行ip addr
并确认正在共享的连接接口的ip
10.42.0.1
在我的机器上(这在你的机器上可能不同)
使用 minicom 连接到板(见上文)。
在 ZedBoard 中:
- 编辑文件
/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.42.0.10
netmask 255.255.255.0
gateway 10.42.0.1
/etc/resolv.conf
并通过编辑文件来修复您的 DNS 解析器
nameserver 10.42.0.1
执行命令更改 zedboard 的配置
ifdown eth0; ifup eth0
瞧!此时应该能够在以下位置 ping 您的主机:
root@localhost:~# ping 10.42.0.1
PING 10.42.0.1 (10.42.0.1) 56(84) bytes of data.
64 bytes from 10.42.0.1: icmp_req=1 ttl=64 time=0.424 ms
64 bytes from 10.42.0.1: icmp_req=2 ttl=64 time=0.498 ms
8.8.8.8
通过您的主机连接ping 一个 Internet 托管网站:
root@localhost:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=53 time=6.93 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=53 time=6.89 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=53 time=7.22 ms
如果您已/etc/resolv.conf
正确设置,您还可以使用完整域名访问互联网:
root@localhost:~# ping www.google.com
PING www.google.com (172.217.10.132) 56(84) bytes of data.
64 bytes from lga34s16-in-f4.1e100.net (172.217.10.132): icmp_req=1 ttl=53 time=7.02 ms
64 bytes from lga34s16-in-f4.1e100.net (172.217.10.132): icmp_req=2 ttl=53 time=7.20 ms
补充说明
要记住的文件
/etc/network/interfaces describes the network interfaces
/etc/hostname configures the nameserver credentials
/etc/hosts resolves IP addresses to hostnames
/etc/resolv.conf configure your DNS resolver
推荐阅读
- vba - 如何创建循环以从 Excel 上传到 PostgresSQL 表
- php - 如何根据用户角色隐藏具有给定属性的 WooCommerce 产品?
- javascript - Javascript/Jquery,提交前回调,更改属性值
- python - Creating a column with conditions over multiple rows
- ruby - 特定页面上带有 Jekyll 404 的 Github 页面
- asp.net - ASP NET Identity 为什么要加密规范化的用户名而不是用户名?
- c++ - 找不到 -lglfw3 的库
- javascript - 获取 select 的值并将其绑定到对象
- bash - 内存在 Kubernetes pod 上超时累积,导致 JVM 无法启动
- r - 在 R 中的函数内使用 unnest_tokens() 会导致错误