Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Kea Kea
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 519
    • Issues 519
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 55
    • Merge requests 55
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source Projects
  • KeaKea
  • Issues
  • #1596

Closed
Open
Created Dec 09, 2020 by Peter Davies@peterdDeveloper

Include subnet and pool user context in lease database

I would like the option to copy the information from user-context on subnet level and from pool level to user-context in lease4/lease6 table after a lease accepted. What I would like to see it is :
Example config:

  {  
        "name": "CMTS-4",  
         "relay": {
             "ip-addresses": [ "0123:4567:891b:cd::1" ]
        },
        "subnet6": [
            {
            "subnet": "0123:4567:891b:cd::/64",
            "id": 40001,
            "pools": [
                        { "pool": "0123:4567:891b:cd:4000::a - 0123:4567:891b:cd:7fff:ffff:ffff:ffff" ,"client-class": "pool_one",  "user-context": { "pool": "pool_one", "name" : "av", "size" : "10" }} ,
                        { "pool": "0123:4567:891b:cd::a - 0123:4567:891b:cd:3fff:ffff:ffff:ffff" ,"client-class": "gamers",  "user-context": { "pool": "gamers", "name" : "computers", "size" : "1000" } } ,
                        { "pool": "0123:4567:891b:cd:8000::a - 0123:4567:891b:cd:bfff:ffff:ffff:ffff" ,"client-class": "internet"}

                      ],
            "pd-pools": [
                {
                    "prefix": "abcd:ef01:9044::",
                    "client-class": "pool_one",
                    "prefix-len": 46,
                    "delegated-len": 56,
                    "user-context": { "pdpool": "pool_one", "name" : "av" }

                },
                {
                    "prefix": "abcd:ef01:9444::",
                    "client-class": "gamers",
                    "prefix-len": 46,
                    "delegated-len": 56,
                    "user-context": { "pdpool": "gamers", "name" : "lan" }
                },
                {
                    "prefix": "abcd:ef01:8120::",
                    "client-class": "internet",
                    "prefix-len": 44,
                    "delegated-len": 56
                }
            ],
            "user-context": {
                "device": "CMTS-4",
                "location": "Partner"
             }
           }
        ]
     }

When a user gets a lease with "client-class: gamers" then on the lease record in the lease table he will have the next json:

"user-context": {
	shared-network: {}, ## <- came from shared-network level
	"subnet" : { "device": "CMTS-4", "location": "Partner"}, ## <- came from subnet level
	"pd-pool" : { "pdpool": "gamers", "name" : "lan" }, ## <- came from pd-pool level
	"pool" : { "pool": "gamers", "name" : "computers", "size" : "1000" } ## <- came from pool level
}

This will help me get info on my subscribers, the lease table doesnt have specific info,
Lets say that I have a few pools under one subnet(like the example),
with that info I can get more accurate statistics on the leased addresses.
How many subscribers I have in gamers.

Another idea is to add info from other hook,
We are using radius hook,

So If was I able to select fields from radius hook, like "username" or some other attribute (that came from radius) and put it inside user-context:

"user-context": {
	"radius" : {  "username" : "xxxxx",  }
}

RT #17374

Edited Dec 09, 2020 by Peter Davies
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking