ZTE B860A 有线(itv dhcp) + wifi(互联网) 双线自动切换脚本
本帖最后由 NadOo 于 2016-11-8 15:30 编辑ZTE B860A 有线(itv dhcp) + wifi(互联网) 双线自动切换脚本
本脚本适合:1. 中兴B860A;
2. 当地itv采用dhcp方式连接;
3. 机顶盒支持有线和wifi同时保持连接(同时连接时,有线和无线都有IP,但只有一个生效);
如果你是pppoe方式连接itv,参考:https://www.znds.com/tv-579100-1-1.html
~~~~~
周末研究了一下,结合网上已有资源修改,已实现双线自动切换,成都电信B860A上测试通过,分享出来供大家参考:
1. 盒子有线连接iTV,无线连接互联网wifi;通过ttl或adb、telnet、ssh等方式,获取root身份的shell,详情参考论坛其它帖子;
2. 安装当贝市场或其它桌面程序,可通过U盘的方式,将apk文件拷贝之/data/app;#四川电信B860A v1.0版本,U盘挂载于/storage/external_storage/sda4
3. 以读写权限重新挂载/system目录,并创建netchange.sh
重新挂载目录:mount -o rw,remount /system创建netchange.sh并打开vi编辑器:vi /system/bin/netchange.sh编辑netchange.sh,先敲键盘i键,然后粘贴如下脚本:#!/system/bin/sh
# ZTE B860A netchange.sh
# eth0: iTV cable, wlan0: Wifi internet
# Author: http://github.com/nadoo
# Date: 2016-10-24
# mount -o rw,remount /system
# vi /system/bin/netchange.sh
# chmod 0755 /system/bin/netchange.sh
# echo "/system/bin/netchange.sh &" >> /system/bin/init.zte.post_boot.sh
# disable upgrade
pm block com.ztestb.upgrade
# wait for wlan or itv link up
while [ "$(getprop net.zte.eth.netstate)" != "CONNECTED" ] && [ "$(getprop net.zte.wifi.netstate)" != "CONNECTED" ]
do
sleep 1
done
# 0:web 1:itv
itv=1
while [ 1 ]
do
# check whether itv is current window
check_app=$( dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' | grep -E com.zte.browser | busybox wc -l )
# gateway and dns
web_if="wlan0"
web_gw=$(getprop dhcp.wlan0.gateway)
web_dns=$(getprop dhcp.wlan0.dns1)
itv_if="eth0"
itv_gw=$(getprop dhcp.eth0.gateway)
itv_dns=$(getprop dhcp.eth0.dns1)
if [ $check_app != 0 ] && [ $itv != 1 ]; then
echo "=itv started..."
if [ $itv_gw = "" ]; then
echo "=please connect itv..."
else
itv=1
ip route del
ip route del
ip route add default via $itv_gw
ip route add $itv_dns via $itv_gw
ndc resolver flushdefaultif
ndc resolver setifdns $itv_if "" $itv_dns
ndc resolver setdefaultif $itv_if
sleep 1
echo "=switched to $itv_if..."
echo "=gateway:$itv_gw dns:$itv_dns"
fi
elif [ $check_app = 0 ] && [ $itv = 1 ]; then
echo "=itv stopped..."
if [ $web_gw = "" ]; then
echo "=please connect wifi..."
else
itv=0
ip route del
ip route del
ip route add default via $web_gw
ip route add $itv_dns via $itv_gw
ndc resolver flushdefaultif
ndc resolver setifdns $web_if "" $web_dns
ndc resolver setdefaultif $web_if
sleep 1
echo "=switched to $web_if..."
echo "=gateway:$web_gw dns:$web_dns"
fi
fi
sleep 1
done保存脚本并退出,接连按下:ESC,:wq,回车
为脚本增加可执行权限:chmod 0755 /system/bin/netchange.sh使脚本随机自启动:
在/system/bin/init.zte.post_boot.sh文件最后一行,加入:/system/bin/netchange.sh &
4. 重新启动盒子,按下遥控器"主页"或"应用"键,即可进入桌面Launcher,将当贝桌面设置为默认桌面,然后将系统自带应用的"互动电视"放置到桌面首页;
之后进入"互动电视",则自动切换到有线,退出"互动电视",则自动切换到wifi(互联网)上网,第三方apk可正常使用;
其它:解除四川电信禁止安装apk的限制,方法(其它地区如果没有限制apk安装,则应该不需要做这一步):用机顶盒配置工具StbCfgTool,连接盒子成功后,先在基本配置栏读取配置,再在特征配置-国家-省份-运营商处修改为:中国通用市场!然后在基本配置栏写入配置,重起盒子即可(如果报错不能写入,将此栏MLD版本号改为1就可以了!)关于解除四川电信安装apk的限制,可以参考byron_zhj的详细操作说明:
https://www.znds.com/tv-567820-1-1.html
cashwl 发表于 2016-10-31 04:21
经760EV3测试无效
我已经改用单线多vlan方式了,有线比无线快多了,脚本差不多.
因为各地环境不一样,你可以:
1. 连接iTV的网线,断开wifi,分别执行以下命令,贴出结果:
ip addr
ip route
getprop | grep dhcp
getprop | grep eth
getprop | grep ppp
2. 连接iTV的网线,同时连接wifi,分别执行以下命令,贴出结果:
ip addr
ip route
getprop | grep dhcp
getprop | grep eth
getprop | grep ppp doityou 发表于 2016-10-21 12:47
我的iptv是pppoe的,可能问题出在这,可是我不会改。
130|root@n200:/ # ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1452 qdisc pfifo_fast state DOWN qlen 1000
link/ether 74:97:81:29:d5:94 brd ff:ff:ff:ff:ff:ff
3: tunl0: <NOARP> mtu 0 qdisc noop state DOWN
link/ipip 0.0.0.0 brd 0.0.0.0
4: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
link/sit 0.0.0.0 brd 0.0.0.0
5: ip6tnl0: <NOARP> mtu 1452 qdisc noop state DOWN
link/tunnel6 :: brd ::
9: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1452 qdisc mq state UP qlen 1000
link/ether 34:c3:d2:4c:2b:55 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.103/24 brd 192.168.10.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::36c3:d2ff:fe4c:2b55/64 scope link
valid_lft forever preferred_lft forever
10: p2p0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1452 qdisc mq state DOWN qlen 1000
link/ether 36:c3:d2:4c:2b:55 brd ff:ff:ff:ff:ff:ff
root@n200:/ # init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:11530
init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:11930
init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:12326
QA9:A;SVN:74E;POC:17F;STS:0;BOOT:0;INIT:0;READ:0;CHECK:0;PASS:0;
no sdio debug board detected
TE : 1279059
BT : 11:31:49 Jun2 2016
NO PMU:use DCDC
##### VDDEE voltage = 0x044c
CPU clock is 792MHz
BOARD type: 0x06
CPU type: M8M2
DDR info: 1GB(auto) @ 792MHz(1T)+Scramb EN
DDR channel: DDR 0 + DDR 1
DDR init use : 14682 us
HHH
Boot From SDIO C
0x0000008d
ucl decompress...pass
0x12345678
Boot from internal device 1st tSD/fSD on SDIO C
TE : 1519491
System Started
U-boot-svn61849(m8_k200_v1@) (Jun 02 2016 - 11:31:34)
clr h-ram
DRAM:1 GiB
relocation Offset is: 2fe94000
show partition table:
part: 0, name : conf, size : 400000
part: 1, name : logo, size : 1000000
part: 2, name : recovery, size : 1400000
part: 3, name : misc, size : 400000
part: 4, name : boot, size : 1400000
part: 5, name : cache, size : 30000000
part: 6, name : system, size : 30000000
part: 7, name : data, size : 79000000
part: 8, name : , size : 0
part: 9, name : , size : 0
part: 10, name : , size : 0
part: 11, name : , size : 0
part: 12, name : , size : 0
part: 13, name : , size : 0
part: 14, name : , size : 0
part: 15, name : , size : 0
aml_card_type=0x200
MMC: add mmc dev_num=0, port=1, if_type=6
add mmc dev_num=1, port=2, if_type=6
SDIO Port B: 0, SDIO Port C: 1
board_type 6
register usb cfg = 3ff6bf40
register usb cfg = 3ff6f838
enter emmc boot
Emmckey: Access range is illegal!
SDIO Port C:1, if_type=6, initialized OK!
end of part_table, index 8.
Partition table get from SPL is :
name offset size flag
===================================================================================
0: bootloader 0 400000 0
1: reserved 800000 1000000 0
2: env 1c00000 400000 0
3: conf 2400000 400000 1
4: logo 2c00000 1000000 1
5: recovery 4000000 1400000 1
6: misc 5800000 400000 1
7: boot 6000000 1400000 1
8: cache 7800000 30000000 2
9: system 37c00000 30000000 1
10: data 68000000 79000000 4
mmc read lba=0x4000, blocks=0x1
mmc read lba=0x4001, blocks=0x1
mmc_read_partition_tbl: mmc read partition OK!
eMMC/TSD partition table have been checked OK!
i=0,register --- emmc_key
device_boot_flag=2
EMMC BOOT: not init nand
do not init nand : cause boot_device_flag without nand
MMC BOOT, emmc_env_relocate_spec : env_relocate_spec 74
set_storage_device_flag: store 2
vpu driver detect cpu type: m8m2
vpu clk_level = 7
set vpu clk: 364000000Hz, readback: 364000000Hz(0x700)
mode = 11vic = 31
set HDMI vic: 31
config HPLL
config HPLL done
reconfig packet setting done
Err imgread(L129):Fmt unsupported!genFmt 0x0 != 0x3
Net: Meson_Ethernet
init suspend firmware done. (ret:0)
cvbs trimming.1.v5: 0xa0, 0x0
hdcp init_hdcp_ram...
reboot_mode=charging
Hit Enter key to stop autoboot -- :0
exit abortboot: 0
: ====== Logo_disp ======
: before read_logo_data
: draw_logo 1475
: draw_logo 1477
: enter the set_logoParam
:Id FileName Type No Addr Size
: before the get_logo_source PAL_LOGO_PICTURE
:<0> LogoPic(480i) 0 1 0x11000288 541225
:<1> LogoPic(576i) 0 2 0x110844b4 114717
:<2> LogoPic(720p) 0 3 0x110a04d4 47966
:<3> LogoPic(1080i_p) 0 2 0x110ac034 90410
: draw_logo 1520
before thedecompressToRGB
Start to decode the LOGO jpeg ...
: before the decompress_jpeg_rgb
: Call decompress_pic_rgb565(id=3,addr=110ac034,size=90410,maxw=1920,maxh=1080,Bpp=3) ...
: after the decompress_jpeg_rgb
: Success in decoding LOGO src file: (w=1920,h=1080,Bpp=3,data=0x3f2b0aa8)
: all LOGO's resource (Exc. logoThread) are released
Logo_disp ret: 0
not found mac in efuse
do_bootsys to boot NORM
head magic=55667788
cmdT = mmc read boot 11ffffa0 0 704e00;bootm 12000000
hdcp init_hdcp_ram...
## ANDROID Format IMAGE
## Booting kernel from Legacy Image at 12000000 ...
Image Name: Linux-3.10.33
Image Type: ARM Linux Kernel Image (lzo compressed)
Data Size: 6265692 Bytes = 6 MiB
Load Address: 00208000
Entry Point:00208000
Verifying Checksum ... OK
Ramdisk start addr = 0x125fa800, len = 0xe2a7a
Multi dtb tool version: v2 .
Multi dtb detected, support 7 dtbs.
aml_dt soc: m8m2 platform: n200c variant: sdio
dtb 0 soc: m8m2 plat: n200 vari: 1G
dtb 1 soc: m8m2 plat: n200 vari: 2gsdhc
dtb 2 soc: m8m2 plat: n200 vari: 2gsdio
dtb 3 soc: m8m2 plat: n200 vari: sdhc
dtb 4 soc: m8m2 plat: n200 vari: sdio
dtb 5 soc: m8m2 plat: n200c vari: sdhc
dtb 6 soc: m8m2 plat: n200c vari: sdio
Find match dtb: 6
Flat device tree start addr = 0x126ff000, len = 0x5493 magic=0xedfe0dd0
Uncompressing Kernel Image ... OK
uboot time: 3496746 us.
EFUSE machid is not set.
Using machid 0xf81 from environment
From device tree /memory/ node aml_reserved_end property, for relocate ramdisk and fdt, relocate_addr: 0x50ec001
Loading Ramdisk to 05009000, end 050eba7a ... OK
Loading Device Tree to 05000000, end 05008492 ... OK
Starting kernel ...
[ 0.146593@0] ram_console: failed to create proc entry
[ 0.422709@0] aml_keys: version 0 can not be init c0af4ff0
[ 0.814615@2] aml_keys: version 0 can not be init c0af4ff0
[ 0.814671@2] aml_keys: version 0 can not be init c0af4ff0
[ 0.857440@1] ###check hw reset function is already enabled here
[ 0.982232@2] init: failed to [ 1.864826@3] init: mount none to target failed
[ 1.920828@3] init: mount none to target failed
[ 1.925179@3] init: property 'ro.serialno' doesn't exist while expanding '${ro.serialno}'
[ 1.927871@3] init: cannot expand '${ro.serialno}' while writing to '/sys/class/android_usb/android0/iSerial'
[ 1.938182@3] init: mount adb to target failed
[ 2.227246@3] aml_keys: version 0 can not be init c0af4ff0
[ 2.274944@1] init: mount ext4 to target failed
[ 2.287346@1] init: open /data/local/bootanimation.zip failed
[ 2.293218@1] init: ## ProductID: strlen (32)!
[ 2.293250@1] init: StbTypeID :(334)
[ 2.299775@1] init: load_stbconfig_set_properties --> marketCode = 1, operatorsCode = 1init: myinit: company=, vcisvraddr =vcisvrport = , bootdir = :
[ [ 2.339035@1] init: cannot find '/sbin/cp7601.sh', disabling 'zte-7601-cp'
[ 2.340957@1] init: cannot find '/system/bin/IptvServ', disabling 'IptvServ'
[ 2.347504@1] init: cannot find '/system/bin/ys_service', disabling 'ys-service'
[ 2.355133@1] init: cannot find '/system/bin/init.toltech.sh', disabling 'toltech_devices'
[ 2.364366@1] init: cannot find '/system/bin/ztepropertyd', disabling 'ztepropertyd'
[ 2.423907@1] init: cannot expand '${ro.usb.vendor.string}' while writing to '/sys/class/android_usb/android0/f_mass_storage/vendor_string'
[ 2.431030@1] init: property 'ro.usb.product.string' doesn't exist while expanding '${ro.usb.product.string}'
[ 2.440734@1] init: cannot expand '${ro.usb.product.string}' while writing to '/sys/class/android_usb/android0/f_mass_storage/product_string'
[ 2.497772@1] init: property 'sys.powerctl' doesn't exist while expanding '${sys.powerctl}'
[ 2.501213@1] init: powerctl: cannot expand '${sys.powerctl}'
[ 2.506979@1] init: property 'sys.sysctl.extra_free_kbytes' doesn't exist while expanding '${sys.sysctl.extra_free_kbytes}'
[ 2.518034@1] init: cannot expand '${sys.sysctl.extra_free_kbytes}' while writing to '/proc/sys/vm/extra_free_kbytes'
root@n200:/ # [ 2.689255@0] ztebsp: set_display_mod->store_free_scale_axis 0 0 0 1279 719
[ 2.690829@0] ztebsp: set_display_mod->store_window_axis 0 33 18 1885 1060
[ 9.933159@1] ztebsp: system_server->store_window_axis 0 33 18 1885 1060
[ 10.051588@0] ztebsp: system_server->set_vout_window osd0=>x:33 ,y:18,w:1920,h:1080
[ 10.051588@0]osd1=> x:33,y:18,w:18,h:18
[ 11.877206@0] init: untracked pid 970 exited
[ 11.895718@1] init: untracked pid 971 exited
[ 13.141119@2] init: untracked pid 1187 exited
[ 13.679442@2] init: cannot find '/system/bin/preinstall.sh', disabling 'preinstall'
[ 13.845124@1] init: no such service 'wififix'
[ 15.815505@0] init: untracked pid 1063 exited
[ 17.208497@1] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 17.217613@1] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 17.235906@1] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:1684
[ 20.175452@2] init: untracked pid 1951 exited
[ 22.856081@2] init: untracked pid 2345 exited
[ 23.576411@2] init: untracked pid 2347 exited
[ 27.370031@2] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 27.381035@1] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 27.389020@0] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:2827
[ 28.285508@0] init: untracked pid 2893 exited
[ 31.375148@0] init: untracked pid 3056 exited
[ 37.691146@2] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 37.699242@2] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 37.707388@3] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:3456
[ 39.615531@1] init: untracked pid 3554 exited
[ 47.376325@0] init: untracked pid 3983 exited
[ 47.769972@0] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 47.778458@0] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 47.790740@0] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:4005
[ 50.405438@0] init: untracked pid 4131 exited
[ 57.910245@0] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 57.917270@0] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 57.925572@0] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:4488
[ 58.475999@1] init: untracked pid 4517 exited
[ 66.465753@1] init: untracked pid 4852 exited
[ 68.061021@0] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 68.089450@0] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 68.100525@0] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:4923
[ 69.485216@0] init: untracked pid 4990 exited
[ 77.515356@0] init: untracked pid 5311 exited
[ 78.141339@0] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 78.148588@0] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 78.160107@0] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:5345
[ 85.608720@0] init: untracked pid 5633 exited
[ 88.254676@0] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 88.261623@0] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 88.270404@0] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:5754
[ 88.667809@1] init: untracked pid 5761 exited
[ 96.684980@1] init: untracked pid 6066 exited
[ 98.418150@0] init: sys_prop: permission denied uid:10023gid:10023 name:persist.service.adb.enable
[ 98.425683@0] init: sys_prop: permission denied uid:10023gid:10023 name:service.adb.tcp.port
[ 98.467319@0] init: sys_prop: Unable to start service ctl uid:10023 gid:10023 pid:6159
sleep .......
step 1
enter ddr_self_refresh
CPU off...
CPU off done
CEC M8:uboot: P_AO_DEBUG_REG0:
00000000
n200C_pwm_set_vddEE_voltage
## VDDEE voltage = 0x035c
##### duty_high = 0x001c
##### P_PWM_PWM_D value = 001c0000
suspend stay 24M...
----------------------------------------
请问我家的无线网卡和有线网卡分别是哪个? 本帖最后由 NadOo 于 2016-10-24 01:14 编辑
我的环境是:ZTE B860A v1.0 成都电信,iTV采用DHCP方式连接;凭猜测加入了pppoe方式的支持,还请大家测试反馈;
怎么脚本都被自动切的只剩下一行了.. 编辑了几次,没办法直接显示超过2行的代码,不知道是不是权限不够,不折腾了. {znds6}{znds6}{znds6}这个厉害 正需要这个呢! 感谢楼主的分享!
强烈支持楼主ing…… 感谢分享! {znds11}高手啊!赞 高手高手 佩服佩服 这个脚本是在之前其它网友的脚本基础上改进的,不需要手动填写网关、DNS,都是自动获取的。只是有个
itv_app=8 这个参数,需要大家自己根据情况修改,四川电信目前设置为8就可以了。 当贝的程序做的不错,论坛怎么这么难用... NadOo 发表于 2016-10-17 15:15
这个脚本是在之前其它网友的脚本基础上改进的,不需要手动填写网关、DNS,都是自动获取的。只是有个
itv_ap ...
大大,湖南电信目前设置为多少啊 大神,你QQ多少,wifi双网自动切换,有点事请教 拼头小子 发表于 2016-10-17 16:02
大大,湖南电信目前设置为多少啊
通过遥控器打开iptv,在shell中执行
dumpsys window w | grep -E com.zte.browser | grep / | busybox wc -l
会得到一个数字。多试几次,取最小的那个 四川电信860A,软件版本80113P007,可以自由安装app,但又不能修改权限;008、008可以改权限了,但又限制安装,用STB能解除四川电信禁止安装apk的限制吗?不能吧
chendaxia666 发表于 2016-10-17 16:26
四川电信860A,软件版本80113P007,可以自由安装app,但又不能修改权限;008、008可以改权限了,但又限制安 ...
我的是自动升级的最新系统版本,通过那个配置工具,把省份改成通用市场,然后重新写入配置,重启后就OK了。 当贝市场安装apk没有问题。没改之前,安装到最后提示 不允许安装。 zxz690501 发表于 2016-10-17 18:51
真好用的!!!
兄弟测试可以用吗?太好了!你是什么地区的版本? 3070596906 发表于 2016-10-17 21:15
请问江西电信多少合适,我用8不能有线,无线切换,我是1.1的合子!
通过遥控器打开iptv,在shell中执行
dumpsys window w | grep -E com.zte.browser | grep / | busybox wc -l
会得到一个数字。多试几次,取最小的那个 能不能详细点啊 楼主,对于小白来说不知道从哪里下手啊? 比如首先要运行什么软件 输代码啊? 拼头小子 发表于 2016-10-17 16:14
大神,你QQ多少,wifi双网自动切换,有点事请教
老乡 我也湖南的 你弄好了吗? 双网交换?弄好了教教我啊 经760EV3测试无效 本帖最后由 cashwl 于 2016-11-3 12:00 编辑
NadOo 发表于 2016-10-31 17:08
我已经改用单线多vlan方式了,有线比无线快多了,脚本差不多.
因为各地环境不一样,你可以:
好的,感谢大神。最近一直在弄这个!希望能在你的指导下实现双网自动切换。给个QQ 吧 大神我最近一直在弄这个 买了TTL线测试几个教程了。。希望可以解决感谢 我的Q是 16871252 本帖最后由 cashwl 于 2016-11-3 10:58 编辑
111111 本帖最后由 cashwl 于 2016-11-3 11:07 编辑
22222 连接iTV的网线,断开wifi时,
root@zx296702_asic:/ # ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1452 qdisc pfifo_fast state UP qlen 1000
link/ether 90:d8:f3:67:96:4e brd ff:ff:ff:ff:ff:ff
inet 192.168.1.12/24 brd 192.168.1.255 scope global eth0
inet6 fe80::92d8:f3ff:fe67:964e/64 scope link
valid_lft forever preferred_lft forever
3: tunl0: <NOARP> mtu 1480 qdisc noop state DOWN
link/ipip 0.0.0.0 brd 0.0.0.0
4: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
link/sit 0.0.0.0 brd 0.0.0.0
5: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 3c:33:00:45:d6:78 brd ff:ff:ff:ff:ff:ff
6: p2p0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1452 qdisc mq state DORMANT qlen 1000
link/ether 3e:33:00:45:d6:78 brd ff:ff:ff:ff:ff:ff
7: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1452 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp
inet 10.126.58.241 peer 10.126.32.1/32 scope global ppp0
root@zx296702_asic:/ # ip route
default via 10.126.32.1 dev ppp0
10.126.32.1 dev ppp0scope link
10.126.32.1 dev ppp0proto kernelscope linksrc 10.126.58.241
192.168.1.0/24 dev eth0proto kernelscope linksrc 192.168.1.12
root@zx296702_asic:/ # getprop | grep dhcp
:
:
:
:
:
:
:
:
:
:
:
:
:
: []
:
root@zx296702_asic:/ # getprop | grep eth
:
:
:
:
:
:
:
:
root@zx296702_asic:/ # getprop | grep ppp
:
: []
本帖最后由 cashwl 于 2016-11-3 10:52 编辑
我手动关闭有线开WIFI 的时候 提示
[ 1654.391000] RTL871X: rtw_set_802_11_connect(wlan0)fw_state=0x00000008
[ 1654.461000] RTL871X: start auth
[ 1654.466000] RTL871X: auth success, start assoc
[ 1654.470000] RTL871X: assoc success
[ 1654.906000] RTL871X: recv eapol packet
[ 1654.911000] RTL871X: send eapol packet
[ 1655.917000] RTL871X: recv eapol packet
[ 1655.918000] RTL871X: send eapol packet
[ 1655.920000] RTL871X: set pairwise key camid:4, addr:e0:05:c5:ca:28:9a, kid:0, type:AES
[ 1655.957000] RTL871X: set group key camid:5, addr:e0:05:c5:ca:28:9a, kid:2, type:AES
手动关闭WIFI连接有线 提示
[ 1963.789000] RTL871X: module exit start
[ 1963.800000] RTL871X: rtw_ndev_uninit(wlan0)
[ 1963.837000] RTL871X: rtw_ndev_uninit(p2p0)
[ 1963.860000] RTL871X: rtw_cmd_thread: DriverStopped(1) SurpriseRemoved(0) break at line 478
[ 1963.869000] RTL871X: rtw_dev_unload: driver not in IPS
[ 1964.096000] RTL871X: module exit success
连接iTV的网线,同时连接wifi
root@zx296702_asic:/ # ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1452 qdisc pfifo_fast state UP qlen 1000
link/ether 90:d8:f3:67:96:4e brd ff:ff:ff:ff:ff:ff
inet6 fe80::92d8:f3ff:fe67:964e/64 scope link
valid_lft forever preferred_lft forever
3: tunl0: <NOARP> mtu 1480 qdisc noop state DOWN
link/ipip 0.0.0.0 brd 0.0.0.0
4: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
link/sit 0.0.0.0 brd 0.0.0.0
11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 3c:33:00:45:d6:78 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.103/24 brd 255.255.255.255 scope global wlan0
inet6 fe80::3e33:ff:fe45:d678/64 scope link
valid_lft forever preferred_lft forever
12: p2p0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1452 qdisc mq state DORMANT qlen 1000
link/ether 3e:33:00:45:d6:78 brd ff:ff:ff:ff:ff:ff
root@zx296702_asic:/ #ip route]
Object "route]" is unknown, try "ip help".
1|root@zx296702_asic:/ #ip route
default via 192.168.1.1 dev wlan0
192.168.1.0/24 dev wlan0scope link
192.168.1.0/24 dev wlan0proto kernelscope linksrc 192.168.1.103
192.168.1.1 dev wlan0scope link
root@zx296702_asic:/ # getprop | grep dhcp
:
:
:
:
:
:
:
:
:
:
:
:
:
: []
:
root@zx296702_asic:/ # getprop | grep eth
:
:
:
:
:
:
:
:
root@zx296702_asic:/ # getprop | grep ppp
:
: []
我想请教下楼主另外的教程是 编辑 vi /system/bin/netchang.sh 您的是 vi /system/bin/netchange.sh这个没影响吧?