This scrip syncs with the [PHPipam][https://phpipam.net/api/api_documentation/] app, collecting subnet information to help [Fastnetmon Community Edition][https://github.com/pavel-odintsov/fastnetmon] scirpt perform smarter operations.
For everything to work, PHPIpam must be structured as follows:
-
In Administration > custom-fields, under Custom Subnets fields. You must create the fields:
- forced_mitigation type boolean: The field provides information on whether the subnet is under forced mitigation.
- community_ddos type integer: The field provides information about the community that the subnet should be announced to.
- networks_whitelist type boolean: The field provides information about the subnet that should be configured in the network_whitelist file.
-
In Administration > custom-fields, under Custom VRF fields. You must create the fields:
- NEXT_HOP type varchar: The field provides information on which next hop the subnet announcement should be made. You can create next_hop fields to accommodate your architecture. It is mandatory to have a VRF created with an ip address in the registered next_hop. e.g.: 10.0.0.1
-
In Administration , under API:
- Create API: You must create and configure access to the API.
- In Administration > Section , under Section management:
- Sections must be configured with the ASN (e.g. 65006)
- In Administration > Subnets , under Available subnets in section xxx:
- Subnets must be entered with the mask /24 in the section created.
- configure src/settings.toml and src/.secrets.toml
The script is designed for a transit operator or ISP. It does not sync private blocks (10.0.0.0/8) or CGNAT blocks (100.64.0.0/10). The sync is configured to register valid blocks and asn.
Mongo v4.4 Redis v7.0.7 PHPIpam v1.5.1
- git clone project
- cd sync_ranger
- python3 -m venv .venv
- pip3 install -r requirements.txt
- python3 src.main.py
enjoy!