Mmx233 / BitSrunLoginGo

深澜校园网登录程序 Go 语言版,适用于Windows、Linux、路由器等。提供对 Docker、Go Module、OpenWrt 的支持
GNU Affero General Public License v3.0
303 stars 27 forks source link

多线多号多拨问题 #23

Closed Dream-Rainy closed 1 year ago

Dream-Rainy commented 1 year ago

手头上有两个账号,路由器将一个lan口转为了wan口,插了两条线,今天尝试用openwrt和mwan3进行负载均衡,做到了带宽叠加的效果。 但是我在尝试用多网卡模式进行验证的时候发现,我们学校的深澜好像获取的是请求端的ip,和params中写的ip无关,于是就会有如下问题。 2023-05-30 07:33:04 [DEBU] 有效匹配网卡: [{eth1.3 10.111.16.9:0}] 2023-05-30 07:33:04 [INFO] 使用网卡: eth1.3 2023-05-30 07:33:04 [INFO] 正在获取登录状态 2023-05-30 07:33:04 [DEBU] HTTP GET http://202.201.252.10/cgi-bin/rad_user_info 2023-05-30 07:33:04 [DEBU] jQuery1685431984621869468({"ServerFlag":4294967040,"add_time":1685258888,"all_bytes":25648214940,"billing_name":"中国联通-cucc","bytes_in":21936525994,"bytes_out":3711688946,"checkout_date":0,"domain":"cucc","error":"ok","group_id":"19","keepalive_time":1685431984,"online_device_total":"1","online_ip":"10.111.15.224","online_ip6":"2001:250:1800:1960::8f8","package_id":"0","products_id":"19","products_name":"中国联通-cucc-50元/100M","real_name":"","remain_bytes":0,"remain_seconds":0,"sum_bytes":208603980192,"sum_seconds":2549617,"sysver":"1.01.20210607","user_balance":0,"user_charge":0,"user_mac":"","user_name":"","wallet_balance":0}) 2023-05-30 07:33:04 [DEBU] 认证客户端 ip: 10.111.16.9 2023-05-30 07:33:04 [INFO] 已登录~ 这个网卡绑定的是另一个中国移动的账号,但是请求的结果依旧是wan1的中国联通。 能否使用指定的网卡和验证网页进行通讯?

Mmx233 commented 1 year ago

https://github.com/Mmx233/BitSrunLoginGo/blob/5f4492ac782e848f478b8ecd72a8fec1bbc61b4e/internal/controllers/login.go#L17

https://github.com/Mmx233/BitSrunLoginGo/blob/5f4492ac782e848f478b8ecd72a8fec1bbc61b4e/tools/http.go#L39-L52

程序已经尝试指定不同的网口。或许是我的调用方法有问题,我研究研究

Dream-Rainy commented 1 year ago

我的不同wan口的跃点数不同,因为这是mwan3要求的,但是好像go语言指定的本地ip最后也会受到系统路由表的影响,走跃点少的网口。 我可能需要对openwrt中的路由表进行修改,我研究研究

Dream-Rainy commented 1 year ago

我用mwan3的负载均衡暂时实现了特定的连接走特定的网口。 QQ截图20230531005138

Mmx233 commented 1 year ago

我用mwan3的负载均衡暂时实现了特定的连接走特定的网口。 QQ截图20230531005138

我已经找到了在 Linux 下可靠地分流到网卡的方法,这几天会更新项目。到时候可能还是要麻烦你测试一下

Mmx233 commented 1 year ago

请注意 use-dhcp-ip 和 ip flag 已经弃用,只能使用 interfaces 指定网卡

bitsrun_linux_s390x.zip bitsrun_linux_386.zip bitsrun_linux_amd64.zip bitsrun_linux_arm.zip bitsrun_linux_arm64.zip bitsrun_linux_mips.zip bitsrun_linux_mips_softfloat.zip bitsrun_linux_mips64.zip bitsrun_linux_mips64_softfloat.zip bitsrun_linux_mips64le.zip bitsrun_linux_mips64le_softfloat.zip bitsrun_linux_mipsle.zip bitsrun_linux_mipsle_softfloat.zip bitsrun_linux_ppc64.zip bitsrun_linux_ppc64le.zip bitsrun_linux_riscv64.zip

Dream-Rainy commented 1 year ago

感谢,现在可以通过指定的网口对验证网页进行通讯了

Mmx233 commented 1 year ago

已经发布了 release:https://github.com/Mmx233/BitSrunLoginGo/releases/tag/v1.3.8 其中包含一些问题修复,建议更新