以太网配置

客户端

  1. 按以太网连接的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
  1. 然后更新ip,设置网关为服务器的eth0
route
add default gw 192.168.28.1

ifconfig
eth0 192.168.28.10:24 netmask 255.255.255.0

  1. 设置DNS服务器
echo
'nameserver 114.114.114.114' >> /etc/resolv.conf

服务器

  1. 开启内核路由转发
vi /etc/sysctl.conf

#改:#net.ipv4.ip_forward = 0

#为: net.ipv4.ip_forward = 1

sysctl -p

  1. 按以太网连接的master进行设置,然后更新ip
ifconfig eth0 192.168.28.1
netmask 255.255.255.0
  1. 确保eth0的网关为公网,或default网关为公网
route
  1. 检查iptables规则,按需要增删
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值