DOGCOM router K2 (7620A) for DRCOM campus network-Xi'an Petroleum University

Preface

Duodian (DGCOM) is really a bit stretched. In order to log in to multiple devices and share hotspots, K2 routers are used. There are ready-made ones on the Internet (Xiaomi mini, and yk1 firmware). I originally planned to use ancient python to simulate post login, but It may fail, and secondly, it is very performance-intensive, and the router may get stuck, so I finally adopted dogcom from github.

First of all, you need to be able to flash the machine, use breed, use WinSCP, finalshell and other software, as well as ls, cat, vi, wget, chmod and other commands. Please study by yourself first, learn to flash the machine, learn to use breed, and then flash the firmware (the main content of this article is Take OPENWRT and Laomaozi as examples, other firmwares are basically similar).
start

Take Router K2 (7620a) as an example.
The test environment is Xi'an Petroleum University, version 6.0.0D Dodian (DRCOM) openwrt firmware.
Use openwrt to install Dogcom (how to flash your own machine, Baidu by yourself)

Document preparation:

  1. Packet capture: Install Wireshark packet capture software (self-made Baidu) on the computer , and connect the computer directly to the school network port with a network cable, not through a router. Open the client, enter the account and password, do not log in yet, open Wireshark, click Ethernet , then click Start , then log in to the client , click the red button in the upper left corner after a short time (10~30s) , click File→Save As . dr.pcapng

  2. Open the online configuration generator https://drcoms.github.io/drcom-generic/ . After opening, select the corresponding version in the upper left corner of the page, then click Open to select the dr.pcapng file generated by your packet capture . Wait for a while, and the page The configuration content will automatically appear in the blank part below (if it is not displayed, please check whether the client version is selected correctly or capture the packet again), then click Save to download the configuration file drcom.conf, and save it for later use. This ends the package capture for version p. For version d , you still need to open the configuration file with a text editor and enter your password in the quotes of password='' and save it.
    client

  3. Prepare the files to be uploaded: Download the binary file attachment you need, unzip the binary program file and rename it to dogcom and keep it for later use. The next operation requires the use of a router. Turn off the drcom client on the computer, connect the router WAN to the school network port, and connect the router LAN to the computer.

  4. Upload files: Log in to WinSCP and upload the dogcom binary program file and drcom.conf configuration file to a directory on the router that is writable and will not be lost after restarting. This article takes the /usr directory as an example (openwrt/lede/Pandora/mtk series official firmware can use this directory). If you use another directory, please replace all /usr in the following with the corresponding directory you use.
    It has been guessed that some of the available directories for firmware are as follows:

  • Available directories for padavan and phoenix: /etc/storage (you need to execute "mtd_storage.sh save" to save)
    K2P B1 Broadcom version official modification and official firmware: /tmp/media/data
    Merlin firmware: /jffs
    Original ASUSWRT: /jffs
    K3 Official and official changes: /tmp/media/nand or /opt
  1. Grant execution permission to dogcom : Enter the /usr directory (or other directory) of the router in WinSCP, right-click the dogcom file, properties, enter 0777 in the octal table , and confirm.

  2. Check whether it is available (version d): Use finalshell to log in to the router (do not use WinSCP to enter commands), enter the command line, enter the following commands, and test. (Note: During testing, you need to turn off the drcom client on your computer) dogcom -m dhcp -c /usr/drcom.conf -v
    Check whether you can access the Internet (note, do not close putty or xshell at this time). The log can be displayed through this command. If you cannot access the Internet, you can judge what went wrong based on the above error message.
    After you can access the Internet normally , add startup items: Please study the method of adding startup items to the router firmware you are using. Here we take the official firmware of the openwrt/lede/Pandora/mtk series as an example. Open /etc/rc.local under WinSCP and paste the following command in the line above exit 0 ( note that if dogcom is not the installed ipk, please add the execution of dogcom yourself. Path )
    dogcom -m dhcp -c /usr/drcom.conf -d -e
    Restart the router and enjoy the wireless network. This ends the tutorial for version D (please check my main reference 2 for version P)

dogcom for k2 link https://caiyun.139.com/m/i?0I5CJDR8LSplJ extraction code: bPXW

Main reference 2P version tutorial
5. Grant execution permission to dogcom: Enter the /usr directory (or other directory) of the router in WinSCP, right-click the dogcom file, properties, enter 0777 in the octal table, and confirm.

6. Download the file pppoe-dialer (p version):

https://github.com/mchome/PPPoE-Dialer/releases/download/v1.2/pppoe-dialer.exe

Open pppoe-dialer, enter your username and password, and check whether the dialing test is successful. If successful, run the dogcom-win version below to check whether it is running normally. If it is normal, proceed to the next step. If pppoe-dialer fails to dial, close this tutorial. It may be an escape character problem.

7. Log out and close pppoe-dialer and dogcom, enter the router web management interface, set the WAN port to pppoe, and configure the account password. Configure startup. Here we take the openwrt/lede/Pandora/mtk series official firmware as an example. Open /etc/rc.local under WinSCP and enter the following command on the line above exit 0:

/usr/dogcom -m pppoe -c /usr/drcom.conf -e -d

Modify and put it in /usr/bin/pppoe.sh, and give execution permission ( chmod +x /usr/bin/pppoe.sh) and add in front /etc/rc.localofexit 0

sleep 15
pppoe.sh

please download thispppoe.sh

https://raw.githubusercontent.com/drcoms/drcom-generic/master/custom/pppoe.sh

Restart your router and enjoy wireless networking.
Some FAQs and notes (updated from time to time):

  1. The online configuration generator https://drcoms.github.io/drcom-generic/
    cannot be opened. Click the link on the left and use https. If it still cannot be opened, it means it is blocked. It is known that Guangdong Mobile cannot be opened.

  2. Segmentation fault is prompted after running: The reason for this error is that there is a problem with the content of the configuration file. Please check whether the configuration file has redundant content or any items are empty.
    Open drcom.conf and check whether the file contains illegal content, such as whether there is anything before server='******', whether the parameters are complete, and whether the d and p versions are selected correctly.

  3. When capturing packets, the computer must be directly connected to the school's network port, do not use a router! (Okay, there are still people who don’t understand, so please unplug the power cord and network cable of the router when capturing packets!)

  4. When testing whether you can connect to the Internet on the router, you must first turn off the drcom client on the computer! Connect the wan port of the router to the school network port, connect the computer to the lan port of the router, and then try those networking commands.

  5. If your school's network is unstable or disconnected at night, please use the -e parameter so that dogcom will automatically and continuously try to reconnect after the network is disconnected (please update dogcom to version v1.4.3 or higher to use this parameter).

  6. A syntax error is prompted when running. Please check if you are using the wrong binary.

  7. When running, it prompts Failed to receive
    data: Resource temporarily unavailable. Please check whether the network cable is plugged in properly and whether the server can be pinged successfully.

  8. When running, it prompts Failed to bind socket: Address already in
    use. There is already another dogcom or other program occupying the port. Please first confirm that no other drcom client is running, such as the drcom client on your computer, or the python client. If you have entered the dogcom networking command multiple times, please execute killall
    dogcom first, or restart the router and then execute killall dogcom, and then run dogcom.

  9. When running, it prompts Failed to read config
    file. Check whether the configuration file path is correct, whether the configuration file exists, and whether the configuration file name is correct. 10. Permission
    denied is prompted when running. Please check if dogcom has granted 0777 permission.

main reference

https://github.com/mchome/openwrt-dogcom
https://www.right.com.cn/forum/thread-215978-1-1.html

Guess you like

Origin blog.csdn.net/qq_21499251/article/details/121457048