Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PerfectLaugh/chinaroutes
Add routes to specific country through target gateway.
https://github.com/PerfectLaugh/chinaroutes
Last synced: 3 months ago
JSON representation
Add routes to specific country through target gateway.
- Host: GitHub
- URL: https://github.com/PerfectLaugh/chinaroutes
- Owner: PerfectLaugh
- Archived: true
- Created: 2017-06-01T06:19:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-03T08:16:10.000Z (over 7 years ago)
- Last Synced: 2024-07-16T14:10:40.314Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 301 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chinaroutes (for Linux-only)
简体中文(Chinese-Simplified): [README.zh-CN.md](README.zh-CN.md)
Original repo: https://github.com/fivesheep/chnroutes
This is only the modification from above project.
You can feed this program the file like http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest then specify the country (case-sensitive) and the target router.
Because it add routes through libnl, you must have libnl in your system.
You can almost instantaneously add a bunch of country ips' route by this program.
```
user@Dev:~/chinaroutes$ ./target/release/chinaroutes --help
chinaroutes 0.1.2
Add country routes for linux routing tableUSAGE:
chinaroutes [FLAGS] [OPTIONS] --country --file --targetFLAGS:
--delete Delete the entries (Default to add)
-h, --help Prints help information
-V, --version Prints version informationOPTIONS:
-c, --country Target country (case-sensitive)
-f, --file Input asn-delegated file
-t, --table Routing table (default: 254)
--target Target gateway
```
## How to build it?Basically you just need two things: **Rust programming language** and **libnl**, installed on your system.
I use Ubuntu as the build platform.
```sh
$ apt install libnl-3-dev
$ cd ./chinaroutes
$ cargo build --release
```then execute the program in ./target/release/chinaroutes
done.