From c36460007b239d8edef6465857dcb741cdbc6053 Mon Sep 17 00:00:00 2001 From: Warren Date: Tue, 13 Sep 2022 16:52:08 +1200 Subject: [PATCH 1/2] add ignores/dirty so the branch stays clean/_more_ pullable in prod --- .gitignore | 15 ++++++++ .gitmodules | 4 ++ v1.1/Shaper.example.csv | 12 ++++++ v1.1/ispConfig.example.py | 79 +++++++++++++++++++++++++++++++++++++++ v1.1/network.example.json | 78 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 .gitignore create mode 100644 v1.1/Shaper.example.csv create mode 100644 v1.1/ispConfig.example.py create mode 100644 v1.1/network.example.json 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 + } + } + } +} From 27c8ea2387c195730b0c84b68077435bd773a8e7 Mon Sep 17 00:00:00 2001 From: Warren Date: Tue, 13 Sep 2022 17:04:21 +1200 Subject: [PATCH 2/2] tidy, nix original config files --- v1.1/Shaper.csv | 12 ------ v1.1/ispConfig.example.py | 21 ----------- v1.1/ispConfig.py | 58 ----------------------------- v1.1/network.json | 78 --------------------------------------- 4 files changed, 169 deletions(-) delete mode 100644 v1.1/Shaper.csv delete mode 100644 v1.1/ispConfig.py delete mode 100644 v1.1/network.json diff --git a/v1.1/Shaper.csv b/v1.1/Shaper.csv deleted file mode 100644 index 82b76bfa..00000000 --- a/v1.1/Shaper.csv +++ /dev/null @@ -1,12 +0,0 @@ -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 index f8c0a44c..67bbfecc 100644 --- a/v1.1/ispConfig.example.py +++ b/v1.1/ispConfig.example.py @@ -56,24 +56,3 @@ 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/ispConfig.py b/v1.1/ispConfig.py deleted file mode 100644 index 67bbfecc..00000000 --- a/v1.1/ispConfig.py +++ /dev/null @@ -1,58 +0,0 @@ -# '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 diff --git a/v1.1/network.json b/v1.1/network.json deleted file mode 100644 index ff466ff8..00000000 --- a/v1.1/network.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "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 - } - } - } -}