嵌入式爱好者

5G分享流量给有线

2020-9-29 11:25| 发布者: xhh| 查看: 900| 评论: 0

类目: LS1012A/LS1043A/LS1046A系列产品  >  Ubuntu     文档编号: 417

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

5.      保存 iptables 配置:

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.       此时电脑可以正常上网



已解决

未解决

只是看看

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-11-22 17:36

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部