-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
cn-routefeed: China Routefeed | ||
--- | ||
|
||
`cn-routefeed` is a BGP speaker that feeds peer all China IPv4 delegations. The delegation information is fetched from APNIC (from <http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest>). `cn-routefeed` might be useful if you are trying to set up special routing for IPv4 routes that are based in China. | ||
|
||
If APNIC changed the URL of delegation information file in the future, you could change that URL on line 5 of `fetcher.cc`. | ||
|
||
### Installation | ||
|
||
`cn-routefeed` need the following build dependencies: | ||
|
||
- g++ | ||
- [libbgp](https://github.com/Nat-Lab/libbgp) | ||
- libcurl | ||
- cmake (optional) | ||
|
||
For libbgp, please follow the installation instruction on the [project page](https://github.com/Nat-Lab/libbgp). For other build dependencies, you can install them on a Debian-based Linux distribution with the following `apt` command: | ||
|
||
``` | ||
# apt install g++ libcurl4-nss-dev cmake | ||
``` | ||
|
||
Once you have the dependencies installed, use the following commands to build `routefeed`: | ||
|
||
``` | ||
$ git clone https://github.com/nat-lab/cn-routefeed | ||
$ cd cn-routefeed | ||
$ mkdir build | ||
$ cd build | ||
$ cmake ../ | ||
$ make | ||
``` | ||
|
||
Or, if you are not into the `cmake` kind of thing, you can build the project with: | ||
|
||
``` | ||
$ g++ -lbgp -lcurl -lpthread *.cc -oroutefeed | ||
``` | ||
|
||
It should work on most of the cases. | ||
|
||
### Usage | ||
|
||
`cn-routefeed` is a simple tool. The command-line help is pretty self-explanatory: | ||
|
||
``` | ||
usage: routefeed [-l HOST] [-p PORT] [-t INTERVAL] -a ASN -i BGP_ID -n NEXTHOP | ||
cn-routefeed is a BGP speaker that feeds all China IPv4 delegations to peer. | ||
Delegation information are fetch from APNIC. | ||
required arguments: | ||
-a ASN Local ASN of the BGP speaker. | ||
-i BGP_ID BGP ID (Router ID) of the BGP speaker. | ||
-n NEXTHOP Nexthop to use when sending routes. | ||
optional arguments: | ||
-l HOST IP address to bind the BGP speaker on. (default: 0.0.0.0) | ||
-p PORT TCP port number to bind the BGP speaker on. (default: 179) | ||
-t INTERVAL Time in second to wait between fetching update from APNIC. | ||
(default: 86400) | ||
``` | ||
|
||
### License | ||
|
||
UNLICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org/> |