1.
设置自动 dhcpd root@localhost:~# systemctl enable
isc-dhcp-server.service Synchronizing state of
isc-dhcp-server.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing:
/lib/systemd/systemd-sysv-install enable isc-dhcp-server 2.
设置静态 IP:(设置的IP网口为连接电脑的网口) root@localhost:~# vi
/etc/systemd/network/fm1-mac6.network [Match] Name=fm1-mac6 KernelCommandLine=!root=/dev/nfs [Network] Address=192.168.2.1/24 3.
设置 NAT 打开转发: root@localhost:~# vi /etc/sysctl.conf 4. 设置转发: root@localhost:~# iptables -t nat -A
POSTROUTING -o enx001e101f0000 -j MASQUERADE root@localhost:~# netfilter-persistent save run-parts: executing
/usr/share/netfilter-persistent/plugins.d/15-ip4tables save run-parts: executing
/usr/share/netfilter-persistent/plugins.d/25-ip6tables save root@localhost:~# netfilter-persistent reload run-parts: executing
/usr/share/netfilter-persistent/plugins.d/15-ip4tables start run-parts: executing
/usr/share/netfilter-persistent/plugins.d/25-ip6tables start 6. 重启开发板,参考2.9节 5G模块测试,配置使5G模块可以正常上网,然后用网线把板子和电脑连接(电脑设置为DHCP) 7. 此时电脑可以正常上网 |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-22 17:36
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.