1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 11:44:48 +08:00
zjunet/README.md

153 lines
4.4 KiB
Markdown
Raw Permalink Normal View History

2014-09-18 22:21:10 +08:00
# zjunet
2019-06-04 15:44:12 +08:00
[查看中文README](README.zh.md)
2014-09-18 22:21:10 +08:00
Command Line Scripts for ZJU (VPN / WLAN / DNS)
2014-09-28 21:42:50 +08:00
## Features
2014-09-18 22:21:10 +08:00
2014-09-28 21:42:50 +08:00
- ZJU VPN (l2tp)
2014-09-18 22:55:22 +08:00
2019-06-04 15:44:12 +08:00
- ZJUWLAN
2014-09-18 22:55:22 +08:00
2019-06-04 15:44:12 +08:00
- Router support
2014-09-18 22:55:22 +08:00
2019-06-04 15:44:12 +08:00
- Overlap network dialing (with load balance)
2014-09-18 22:55:22 +08:00
2019-06-04 15:44:12 +08:00
- Overlap bandwidth of ZJUWLAN and ZJU VPN (1 WLAN + N VPN, Using ZJUWLAN)
2014-09-28 21:42:50 +08:00
2019-06-04 15:44:12 +08:00
- Automatic DNS setting (in case DNS do not work)
2014-09-19 23:19:16 +08:00
2014-09-28 21:46:50 +08:00
## Requirements
- xl2tpd
- curl
2019-06-04 15:44:12 +08:00
- `dig` (Different package on different platform)
## Installation
If you meet any problem during or after the installation, check Troubleshooting section below in this documentation.
2014-09-29 20:02:45 +08:00
2015-02-08 23:19:16 +08:00
### Debian / Ubuntu (deb)
2014-10-02 13:44:47 +08:00
2022-03-29 05:18:22 +08:00
1. Configure ZJU mirrors using [浙大源配置生成器](https://mirrors.zju.edu.cn/old.html#generator).
2. Run these command.
``` bash
curl https://dl.zjuqsc.com/linux/qsc.public.key | sudo apt-key add -
curl https://dl.zjuqsc.com/linux/debian/qsc.list | sudo tee /etc/apt/sources.list.d/qsc.list
sudo apt-get update
sudo apt-get install zjunet
```
2019-06-04 15:44:12 +08:00
3. The installation has completed.
4. If you are setting up a server, we suggest you run `zjunet wlan disable` to disable WLAN capability.
2014-10-02 13:44:47 +08:00
2015-02-08 23:19:16 +08:00
### Fedora / CentOS (rpm)
2022-03-29 05:18:22 +08:00
1. Configure ZJU mirrors using [浙大源配置生成器](https://mirrors.zju.edu.cn/old.html#generator).
2. Configure [EPEL of ZJU mirrors](https://mirrors.zju.edu.cn/epel/) (Taking CentOS installation as an example)
1. Run `yum install epel-release` to install EPEL.
2. Edit `/etc/yum.repos.d/epel.repo` , uncomment lines begin with `#baseurl=` (Remove leading `#` sign) and comment lines begin with `mirrorlist=` (Prepend `#` sign)
3. Edit `/etc/yum.repos.d/epel.repo` , replace `https://download.fedoraproject.org/pub` with `https://mirrors.zju.edu.cn` .
2014-10-02 13:44:47 +08:00
3. Run these command.
```bash
curl https://dl.zjuqsc.com/linux/qsc.public.key | sudo tee /etc/pki/rpm-gpg/RPM-GPG-KEY-QSC-COMP66
curl https://dl.zjuqsc.com/linux/yum/qsc.repo | sudo tee /etc/yum.repos.d/qsc.repo
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-QSC-COMP66
sudo yum install zjunet
```
2014-09-30 18:11:45 +08:00
4. The installation has completed.
5. If you are setting up a server, we suggest you run `zjunet wlan disable` to disable WLAN capability.
2019-06-04 15:44:12 +08:00
### OpenWrt (opk)
Download .opk package from [Release Page](https://github.com/QSCTech/zjunet/releases) (onto your router),
Run `opkg install ./zjunet_<version>_all.opk`.
2020-11-13 03:32:18 +08:00
### Arch Linux (AUR)
Simply run `yay zjunet` to build the package from AUR and install it.
Keep in mind that a fresh install without internet connection is almost impossible.
Please complete installation before connecting to the intranet.
### Other Linux (Build from source code)
2014-10-02 13:47:16 +08:00
2014-09-29 20:02:45 +08:00
```bash
xl2tpd -v; curl -V; dig -v # Check installation of dependencies. There should be 3 version numbers.
2019-06-04 15:44:12 +08:00
# Under proper directory
git clone https://github.com/QSCTech/zjunet.git
2014-09-29 20:02:45 +08:00
cd zjunet
sudo ./install.sh
2019-06-04 15:44:12 +08:00
# If update is necessary, run `git pull` and `sudo ./install.sh`
# If you are setting up a server, we suggest you run `zjunet wlan disable` to disable WLAN capability.
2014-09-29 20:02:45 +08:00
```
2019-06-04 15:44:12 +08:00
**ATTENTION** Requirement check will **NOT** be done running `./install.sh`.
Please run `xl2tpd -v`, `curl -V` and `dig -v` to verify the installation.
## Troubleshooting
### Packet lose
This is a known issue.
When overlapping VPN and ZJUWLAN, network packet may be lost.
(because of nexthop in routing table).
2014-10-01 04:10:17 +08:00
2019-06-04 15:44:12 +08:00
Contributions to this issue are welcomed. (Maybe using `iptables`)
2014-11-12 20:22:49 +08:00
2019-06-04 15:44:12 +08:00
### ppp0 may disappears on OpenWrt
2014-11-12 20:22:49 +08:00
2019-06-04 15:44:12 +08:00
Set lcp-echo-failure larger in /etc/ppp/options.
2014-10-01 04:10:17 +08:00
2019-06-04 15:44:12 +08:00
See also #39
2014-10-01 04:10:17 +08:00
2019-06-04 15:44:12 +08:00
### Other problems?
2014-10-01 04:10:17 +08:00
2019-06-04 15:44:12 +08:00
Please send mail to tech@zjuqsc.com if you have any other problem.
2014-09-30 18:11:45 +08:00
2019-06-04 15:44:12 +08:00
## Contribute to this project
2014-09-30 18:11:45 +08:00
2019-06-04 15:44:12 +08:00
QSCers may Push directly without sending Pull Requests。
2014-09-30 18:11:45 +08:00
2019-06-04 15:44:12 +08:00
Please write an Issue if you have worries. Contact maintainer directly if necessary.
2014-09-29 18:44:10 +08:00
2019-06-04 15:44:12 +08:00
**PRs from non-QSCers are also welcomed.**
2014-11-12 20:22:49 +08:00
2019-06-04 15:44:12 +08:00
### Packaging Instruction
2014-09-29 18:44:10 +08:00
2019-06-04 15:44:12 +08:00
*(Not finished yet)*
2014-09-29 21:11:49 +08:00
2014-09-30 15:46:57 +08:00
#### Debian
2014-09-29 21:11:49 +08:00
```bash
2019-06-04 15:44:12 +08:00
sudo apt-get install build-essential autoconf automake autotools-dev dh-make \
debhelper devscripts fakeroot xutils lintian pbuilder rpm
cd build
./build.sh
2014-09-29 21:11:49 +08:00
```
2019-06-04 15:44:12 +08:00
##### See Also
2014-09-30 15:46:57 +08:00
- http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html
- http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/
2014-09-29 21:11:49 +08:00
2019-06-04 15:44:12 +08:00
#### OpenWrt
2014-09-30 20:07:18 +08:00
2019-06-04 15:44:12 +08:00
##### See Also
2014-09-30 20:07:18 +08:00
- http://lists.openmoko.org/pipermail/devel/2008-July/000496.html
2019-06-04 15:44:12 +08:00
### Links
2014-09-19 23:19:16 +08:00
- [Array in unix Bourne Shell](http://unix.stackexchange.com/questions/137566/array-in-unix-bourne-shell)
2014-09-20 18:13:40 +08:00
- [How do you tell if a string contains another string in Unix shell scripting?](http://stackoverflow.com/questions/2829613/how-do-you-tell-if-a-string-contains-another-string-in-unix-shell-scripting)