客户端
- 按以太网连接的slave进行设置
adb shell mount -o remount,rw /
adb push .\script\enablephy /etc/init.d/enablephy
adb push .\script\disablelandhcp /etc/init.d/disablelandhcp
adb push .\script\start_emac_le-slave /etc/init.d/start_emac_le
adb push .\script\configeth0-slave.sh /etc/init.d/configeth0.sh
adb shell chmod 777 /etc/init.d/enablephy
adb shell chmod 777 /etc/init.d/disablelandhcp
adb shell chmod 777 /etc/init.d/start_emac_le
adb shell chmod 777 /etc/init.d/configeth0.sh
adb shell chmod 777 /usr/sbin/iperf
adb shell ln -sv /etc/init.d/configeth0.sh /etc/rc5.d/S99configeth0.sh
adb shell sync
configeth0.sh内容
/etc/init.d/enablephy
sleep 1
/etc/init.d/start_qti_le stop
/etc/init.d/start_emac_le start
sleep 1
echo 0x1 0x0065 > /sys/class/net/eth0/device/phy_regnum
echo 0xd 0x1 > /sys/class/net/eth0/device/phy_regnum
echo 0xe 0x0834 > /sys/class/net/eth0/device/phy_regnum
echo 0xd 0x4001 > /sys/class/net/eth0/device/phy_regnum
echo 0xe 0x8000 > /sys/class/net/eth0/device/phy_regnum
/etc/init.d/disablelandhcp
ifconfig bridge0 down
brctl delbr bridge0
ifconfig eth0 192.168.28.25 netmask 255.255.255.0
- 然后更新ip,设置网关为服务器的eth0
route
add default gw 192.168.28.1
ifconfig
eth0 192.168.28.10:24 netmask 255.255.255.0
- 设置DNS服务器
echo
'nameserver 114.114.114.114' >> /etc/resolv.conf
服务器
- 开启内核路由转发
vi /etc/sysctl.conf
#改:#net.ipv4.ip_forward = 0
#为: net.ipv4.ip_forward = 1
sysctl -p
- 按以太网连接的master进行设置,然后更新ip
ifconfig eth0 192.168.28.1
netmask 255.255.255.0
- 确保eth0的网关为公网,或default网关为公网
route
- 检查iptables规则,按需要增删
3329

被折叠的 条评论
为什么被折叠?



