diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..53d9e2fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ + +v1.1/Shaper.csv +v1.1/network.json +v1.1/ispConfig.py +v1.1/xdp-cpumap-tc/ +v1.1/pping +v1.1/statsByDevice.json +v1.1/statsByParentNode.json +v1.1/*.bak + + + +# Ignore project folders for some IDEs +.idea/ +__pycache__ diff --git a/.gitmodules b/.gitmodules index 86c6932f..99982431 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,16 @@ [submodule "v0.9/xdp-cpumap-tc"] path = v0.9/xdp-cpumap-tc url = https://github.com/xdp-project/xdp-cpumap-tc.git + ignore = dirty [submodule "v1.0/xdp-cpumap-tc"] path = v1.0/xdp-cpumap-tc url = https://github.com/xdp-project/xdp-cpumap-tc.git + ignore = dirty [submodule "v1.1/xdp-cpumap-tc"] path = v1.1/xdp-cpumap-tc url = https://github.com/xdp-project/xdp-cpumap-tc.git + ignore = dirty [submodule "v1.2/xdp-cpumap-tc"] path = v1.2/xdp-cpumap-tc url = https://github.com/xdp-project/xdp-cpumap-tc.git + ignore = dirty diff --git a/v1.1/Shaper.example.csv b/v1.1/Shaper.example.csv new file mode 100644 index 00000000..4e1cc72d --- /dev/null +++ b/v1.1/Shaper.example.csv @@ -0,0 +1,12 @@ +ID,AP,MAC,Hostname,IPv4,IPv6,Download Min,Upload Min,Download Max,Upload Max +,AP_A,,Device 1,100.64.0.1,,25,5,155,20 +,AP_A,,Device 2,100.64.0.2,,25,5,105,18 +,AP_9,,Device 3,100.64.0.3,,25,5,105,18 +,AP_9,,Device 4,100.64.0.4,,25,5,105,18 +,AP_11,,Device 5,100.64.0.5,,25,5,105,18 +,AP_11,,Device 6,100.64.0.6,,25,5,90,15 +,AP_1,,Device 7,100.64.0.7,,25,5,155,20 +,AP_1,,Device 8,100.64.0.8,,25,5,105,18 +,AP_7,,Device 9,100.64.0.9,,25,5,105,18 +,AP_7,,Device 10,100.64.0.10,,25,5,105,18 +,Site_1,,Device 11,100.64.0.11,,25,5,105,18 diff --git a/v1.1/ispConfig.example.py b/v1.1/ispConfig.example.py new file mode 100644 index 00000000..f8c0a44c --- /dev/null +++ b/v1.1/ispConfig.example.py @@ -0,0 +1,79 @@ +# 'fq_codel' or 'cake diffserv4' +# 'cake diffserv4' is recommended + +# fqOrCAKE = 'fq_codel' +fqOrCAKE = 'cake diffserv4' + +# How many Mbps are available to the edge of this network +upstreamBandwidthCapacityDownloadMbps = 1000 +upstreamBandwidthCapacityUploadMbps = 1000 + +# Traffic from devices not specified in Shaper.csv will be rate limited by an HTB of this many Mbps +defaultClassCapacityDownloadMbps = 500 +defaultClassCapacityUploadMbps = 500 + +# Interface connected to core router +interfaceA = 'eth1' + +# Interface connected to edge router +interfaceB = 'eth2' + +# Shape by Site in addition to by AP and Client +# Now deprecated, was only used prior to v1.1 +# shapeBySite = True + +# Allow shell commands. False causes commands print to console only without being executed. MUST BE ENABLED FOR +# PROGRAM TO FUNCTION +enableActualShellCommands = True + +# Add 'sudo' before execution of any shell commands. May be required depending on distribution and environment. +runShellCommandsAsSudo = False + +# Graphing +graphingEnabled = True +ppingLocation = "pping" +influxDBurl = "http://localhost:8086" +influxDBBucket = "libreqos" +influxDBOrg = "Your ISP Name Here" +influxDBtoken = "" + +# NMS/CRM Integration +# If a device shows a WAN IP within these subnets, assume they are behind NAT / un-shapable, and ignore them +ignoreSubnets = ['192.168.0.0/16'] + +# Optional UISP integration +automaticImportUISP = False +# Everything before /nms/ on your UISP instance +uispBaseURL = 'https://examplesite.com' +# UISP Auth Token +uispAuthToken = '' +# UISP | Whether to shape router at customer premises, or instead shape the station radio. When station radio is in +# router mode, use 'station'. Otherwise, use 'router'. +shapeRouterOrStation = 'router' + +# API Auth +apiUsername = "testUser" +apiPassword = "changeme8343486806" +apiHostIP = "127.0.0.1" +apiHostPost = 5000 + +httpAPIConfig = { + 'enabled': False, + 'baseURL': 'https://my.api.domain.tld', + 'networkURI': '/api/path/network-json-data', + 'devicesURI': '/api/path/devices-json-path', + 'devicesRemap': [], # if your devices json data aint perfect, you can remap keys for csv cols + 'requestsConfig': { + # 'verify': False, # Good for Dev if your dev env doesnt have cert + # 'params': { # params for query string ie uri?some-arg=some-value + # 'some-arg': 'some-value' + # }, + 'headers': { + 'some-header': 'some-value', # ie simple api keys etc + }, + }, + # If you want to store a timestamped copy/backup of both network.json and Shaper.csv each time they are updated, + # provide a path + # TODO Figure out how to expire old backups as not to exhaust disk space + 'logChanges': False # or '/var/log/libreqos' etc +} diff --git a/v1.1/network.example.json b/v1.1/network.example.json new file mode 100644 index 00000000..ff466ff8 --- /dev/null +++ b/v1.1/network.example.json @@ -0,0 +1,78 @@ +{ + "Site_1": + { + "downloadBandwidthMbps":1000, + "uploadBandwidthMbps":1000, + "children": + { + "AP_A": + { + "downloadBandwidthMbps":500, + "uploadBandwidthMbps":500 + }, + "Site_3": + { + "downloadBandwidthMbps":500, + "uploadBandwidthMbps":500, + "children": + { + "PoP_5": + { + "downloadBandwidthMbps":200, + "uploadBandwidthMbps":200, + "children": + { + "AP_9": + { + "downloadBandwidthMbps":120, + "uploadBandwidthMbps":120 + }, + "PoP_6": + { + "downloadBandwidthMbps":60, + "uploadBandwidthMbps":60, + "children": + { + "AP_11": + { + "downloadBandwidthMbps":30, + "uploadBandwidthMbps":30 + } + } + } + } + } + } + } + } + }, + "Site_2": + { + "downloadBandwidthMbps":500, + "uploadBandwidthMbps":500, + "children": + { + "PoP_1": + { + "downloadBandwidthMbps":200, + "uploadBandwidthMbps":200, + "children": + { + "AP_7": + { + "downloadBandwidthMbps":100, + "uploadBandwidthMbps":100 + } + } + } + }, + "children": + { + "AP_1": + { + "downloadBandwidthMbps":150, + "uploadBandwidthMbps":150 + } + } + } +}