标签:ifconfig accept 网关 -o forward sysctl efault ifconf route add
板子端:
ifconfig usb0 192.168.224.101
route add default gw 192.168.224.100
#设置默认网关
ubuntu端
#eth1为对应板子的网卡 eth0为本地上网的网卡
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo ifconfig eth1 192.168.224.100
ubuntu作为中间设备,开发板设备ping通手机设备,若手机设备ping通开发板,则需配ubuntu作为网关网关
标签:ifconfig accept 网关 -o forward sysctl efault ifconf route add
原文地址:https://www.cnblogs.com/jest549/p/13217385.html