当前位置:网站首页>Raspberry pie 3B logs into the wired end of Ruijie campus network through mentohust, creates WiFi (open hotspot) for other devices, and realizes self startup at the same time
Raspberry pie 3B logs into the wired end of Ruijie campus network through mentohust, creates WiFi (open hotspot) for other devices, and realizes self startup at the same time
2022-04-23 03:36:00 【Yi Lanjun】
Implementation process :
- 0、 Write it at the front ( This content has nothing to do with the task , Only when I write code, I find that I need to use it many times sudo, So I wrote to use sudo You don't have to enter a password every time. Solution ):
- 1、 Brief introduction to the task :
- 2、 adopt mentohust Log in to the wired end of Ruijie campus network , And implement mentohust Boot from boot
- 3、 Raspberry pie install hotspot sharing program create_ap, And realize automatic startup
0、 Write it at the front ( This content has nothing to do with the task , Only when I write code, I find that I need to use it many times sudo, So I wrote to use sudo You don't have to enter a password every time. Solution ):
1. Open file
sudo vim /etc/sudoers
2. modify /etc/sudoers The last line of the document
take
%sudo ALL=(ALL:ALL) ALL
It is amended as follows
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
1、 Brief introduction to the task :
Raspberry Pi( Chinese name “ Raspberry pie ”), It's a microcomputer the size of a credit card , Its system is based on Linux. In order to improve the Internet environment of the school dormitory ( The campus network login system leads to the inability to use the router multi device general network ), Visit the campus network through raspberry pie, log in to the system, and 24 Hour boot sharing hotspot to achieve 24 More than hours of device Internet access .
2、 adopt mentohust Log in to the wired end of Ruijie campus network , And implement mentohust Boot from boot
stay linux Using campus network under the environment of , Like Ruijie's classmates , It's still a headache for surfing the Internet . Ruijie's own linux It seems that the client has not been updated for a long time , It doesn't work very well . We recommend you to use the... Developed by Huazhong University of science and technology mentohust, Good online reputation , Bloggers can use it after testing and configuring it , Here is a brief introduction mentohust Installation and use .
- download mentohust file , Here is the use of git clone Command download ;
sudo git clone https://github.com/hyrathb/mentohust
- After downloading, enter mentohust Folder , And install ;
1. Get into mentohust Folder cd mentohust 2. The following libraries are necessary to run , It is recommended to install one by one sudo apt-get install build-essential sudo apt-get install autopoint sudo apt-get install automake sudo apt-get install autoconf sudo apt-get install gettext-base gettext liblocale-gettext-perl 3. next sh autogen.sh 4. Then configure ./configure --prefix=/usr sudo make sudo make install Compilation and installation sudo chmod u+s /usr/bin/mentohust 5. Then install and run mentohust Required libraries sudo apt-get install libpcap-dev libnotify-dev sudo mentohust 6. Set the corresponding parameters : 1. Select the corresponding network card user name password 2. Multicast address (multicast address) choice 1 Agility 3.dhcp The way (dhcp type) choice 3 Before certification 7. Not surprisingly, you can see the authentication options , Fill in the account number and password , Should be able to connect to the campus network
- Set power on self start , So you don't have to run every time you start up sudo mentohust The command , I used it here apt-get install sysv-rc-conf To manage startup items ;
PS: This method can be applied to the startup items set by many users1.# Installation method : sudo apt-get install sysv-rc-conf 2.cd To /etc/init.d Under the table of contents , Use root Permission to write scripts :login.sh cd /etc/init.d sudo vim login.sh #( If not installed vim Students can search and install vim And learn vim How to use ) 3. Write the following script : #!/bin/bash sudo mentohust<<" Here is your root Account password " 4. Change the permissions of the script file to daemon : chmod +x login.sh 5. use sysv-rc-conf Command to set the running level of the daemon sysv-rc-conf login.sh on 4. preservation login.sh File and exit , After restarting, you can find that you can automatically log in to the campus network . sudo reboot
3、 Raspberry pie install hotspot sharing program create_ap, And realize automatic startup
- create_ap Install and open the raspberry pie hotspot
1. Put the code clone To local sudo git clone https://github.com/oblique/create_ap cd create_ap sudo make install 2. Install dependent Libraries sudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq 3. Turn on the hotspots sudo create_ap --no-virt wlan0 eth0 Hotspot name Hot code
- take create_ap Start as a service , The raspberry pie hot spot can be started automatically
1. Modify service configuration , add to --no-virt Parameters sudo vim /usr/lib/systemd/system/create_ap.service # take create_ap.service Medium ExecStart=/usr/bin/create_ap --config /etc/create_ap.conf # It is amended as follows ExecStart=/usr/bin/create_ap --no-virt --config /etc/create_ap.conf 2. Default profile /etc/create_ap.conf, Change the following two horizontal lines to your own ssid And password , Modify your own dhcp gateway sudo vi /etc/create_ap.conf # take create_ap.conf In the document GATEWAY=10.0.0.1 SSID=MyAccessPoint PASSPHRASE=12345678 # It is amended as follows GATEWAY=192.168.123.1 SSID= The hotspot name you want to set PASSPHRASE= The hotspot password you want to set 3. About the service startup code ( Only the last three lines need to be used to set the boot auto start ): # Start a service : systemctl start create_ap.service # Shut down a service : systemctl stop create_ap.service # Restart a service : systemctl restart create_ap.service # Show the status of a service : systemctl status create_ap.service # Enable a service at boot time : systemctl enable create_ap.service # Disable a service at boot time : systemctl disable create_ap.service # Check whether the service is started : systemctl is-enabled create_ap.service
版权声明
本文为[Yi Lanjun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220602232044.html
边栏推荐
- Build websocket server in. Net5 webapi
- STM32 advanced timer com event
- On the principle of concurrent programming and the art of notify / Park
- Unity knowledge points (ugui 2)
- C-11 problem I: find balloon
- JS takes out the same elements in two arrays
- 淺學一下I/O流和File類文件操作
- The art of concurrent programming (6): explain the principle of reentrantlock in detail
- JS - accuracy issues
- vscode删除卸载残余
猜你喜欢
Idea debug debugging tutorial
2022 团体程序设计天梯赛 模拟赛 1-8 均是素数 (20 分)
Wechat applet canvas draws a simple asymptotic color of the dashboard
7-1 introduction to finance
Wechat applet cloud database value assignment to array error
Supersocket is Use in net5 - startup
Abstract classes, interfaces and common keywords
Learn about I / O flow and file operations
2022 团体程序设计天梯赛 模拟赛 L2-1 盲盒包装流水线 (25 分)
Design and implementation of redis (1): understand data structures and objects
随机推荐
Optimization of especially slow startup in idea debugging mode
浅学一下I/O流和File类文件操作
Scenario Title: how does system a use the page of system B
Problem C: realize Joseph Ring with linked list
Notes sur l'apprentissage profond (Ⅱ) - - Principe et mise en oeuvre de la fonction d'activation
The art of concurrent programming (5): the use of reentrantlock
標識符、關鍵字、數據類型
Codeforces Round #784 (Div. 4)题解 (第一次AK cf (XD
Codeforces round 784 (Div. 4) (AK CF (XD) for the first time)
SQL topic exercise summary
51 single chip microcomputer: D / a digital to analog conversion experiment
AWS from entry to actual combat: creating accounts
常用的辅助类
Idea debug debugging tutorial
Use the thread factory to set the thread name in the thread pool
C interface
Definition format of array
2022 团体程序设计天梯赛 模拟赛 L1-7 矩阵列平移 (20 分)
Unity basics 2
Activity supports multi window display