pppoe addition

This commit is contained in:
2025-12-23 18:36:36 +05:00
parent a67f3609c4
commit 82aba07b01
15 changed files with 466 additions and 7 deletions

182
PPPOE_SETUP.md Normal file
View File

@@ -0,0 +1,182 @@
# MikroTik PPPoE to CGRateS RADIUS Integration
## Architecture Overview
```
┌─────────────────────┐ RADIUS (UDP 1812/1813) ┌──────────────────┐
│ MikroTik Router │ ◄─────────────────────────────────────► │ CGRateS │
│ (PPPoE Server) │ │ RADIUS Agent │
└─────────────────────┘ └──────────────────┘
│ │
│ PPPoE │
▼ ▼
┌─────────────────────┐ ┌──────────────────┐
│ PPPoE Clients │ │ Redis (Data) │
│ (Subscribers) │ │ MySQL (CDRs) │
└─────────────────────┘ └──────────────────┘
```
## CGRateS Configuration Files
| File | Description |
|------|-------------|
| `cgrates.json` | Main CGRateS configuration |
| `pppoe_auth.json` | PPPoE authentication request processors |
| `pppoe_accounting.json` | PPPoE accounting request processors |
| `tariffplans/pppoe/` | Tariff plan data (users, rates, balances) |
## MikroTik Configuration
### 1. Add RADIUS Server
```routeros
/radius
add address=<CGRATES_IP> secret=CGRateS.org service=ppp timeout=3s
```
### 2. Configure PPPoE Server Profile
```routeros
/ppp profile
add name=pppoe-profile use-radius=yes only-one=yes \
rate-limit="" \
incoming-filter="" outgoing-filter="" \
local-address=10.0.0.1 \
dns-server=8.8.8.8,8.8.4.4
```
### 3. Configure PPPoE Server
```routeros
/interface pppoe-server server
add service-name=pppoe-service interface=ether1 \
default-profile=pppoe-profile \
authentication=pap,chap,mschap2 \
one-session-per-host=yes
```
### 4. Enable RADIUS for PPP
```routeros
/ppp aaa
set use-radius=yes accounting=yes interim-update=1m
```
### 5. (Optional) Configure RADIUS Incoming (CoA/Disconnect)
```routeros
/radius incoming
set accept=yes port=3799
```
## CGRateS Setup Commands
### 1. Start Redis
```bash
redis-server
```
### 2. Start CGRateS Engine
```bash
cgr-engine -config_path=/path/to/cgrates-radius/
```
### 3. Load Tariff Plan
```bash
cgr-loader -config_path=/path/to/cgrates-radius/ \
-path=/path/to/cgrates-radius/tariffplans/pppoe/ \
-verbose
```
## Sample PPPoE Users
| Username | Password | Static IP | Rate Limit | Balance |
|----------|----------|-----------|------------|---------|
| pppoe_user1 | SecurePass123 | 10.0.0.101 | 10M/10M | 100 units |
| pppoe_user2 | SecurePass456 | 10.0.0.102 | 20M/20M | 100 units |
| pppoe_user3 | SecurePass789 | Dynamic | 50M/50M | 100 units |
## Authentication Flow
1. **Client connects** → MikroTik sends Access-Request to CGRateS
2. **CGRateS processes**`MikrotikPPPoEAuthCGR` extracts user info, checks balance
3. **Password validation**`MikrotikPPPoEAuthPAP/CHAP/MSCHAPv2` validates credentials
4. **Access-Accept** → Returns Session-Timeout, Framed-IP-Address, Mikrotik-Rate-Limit
5. **Session starts** → MikroTik assigns IP and rate limit to client
## Accounting Flow
1. **Session starts**`MikrotikPPPoEAcctStart` initiates session in CGRateS
2. **Interim updates**`MikrotikPPPoEAcctInterim` updates usage every 60 seconds
3. **Session ends**`MikrotikPPPoEAcctStop` terminates session, generates CDR
## RADIUS Attributes
### Authentication Request (from MikroTik)
- User-Name
- User-Password / CHAP-Password / MS-CHAP-Challenge
- NAS-IP-Address
- NAS-Port-Type
- Calling-Station-Id (MAC)
- Acct-Session-Id
### Authentication Reply (from CGRateS)
- Session-Timeout
- Acct-Interim-Interval
- Framed-IP-Address
- Framed-IP-Netmask
- Mikrotik-Rate-Limit
### Accounting Request (from MikroTik)
- Acct-Status-Type (Start/Interim-Update/Stop)
- Acct-Session-Id
- Acct-Session-Time
- Acct-Input-Octets
- Acct-Output-Octets
- User-Name
- NAS-IP-Address
- Framed-IP-Address
## Testing
### Test Authentication with radtest
```bash
radtest pppoe_user1 SecurePass123 localhost 1812 CGRateS.org
```
### Check Active Sessions
```bash
cgr-console 'sessions_get_active_sessions'
```
### Check Account Balance
```bash
cgr-console 'accounts Tenant="cgrates.org" Account="pppoe_user1"'
```
## Troubleshooting
### Enable CGRateS Debug Logging
Set `"log_level": 7` in cgrates.json
### Check RADIUS Traffic on MikroTik
```routeros
/tool sniffer
quick ip-protocol=udp port=1812-1813
```
### Verify RADIUS Secret
Ensure `secret=CGRateS.org` matches `client_secrets` in cgrates.json
## Notes
- **Shared Secret**: Default is `CGRateS.org` - change in production!
- **Rate Limit Format**: MikroTik uses `rx/tx` format (e.g., `10M/10M`)
- **Session-Timeout**: Returned in seconds based on prepaid balance
- **Interim Interval**: Set to 60 seconds for frequent balance updates

View File

@@ -72,13 +72,14 @@
"network": "udp",
"auth_address": "0.0.0.0:1812",
"acct_address": "0.0.0.0:1813"
},
{
"network": "tcp",
"auth_address": "0.0.0.0:1812",
"acct_address": "0.0.0.0:1813"
},
}
],
"client_secrets": {
"*default": "CGRateS.org"
},
"client_dictionaries": {
"*default": ["/usr/share/cgrates/radius/dict/"]
}
},

104
pppoe_accounting.json Normal file
View File

@@ -0,0 +1,104 @@
{
"radius_agent": {
"request_processors": [
{
"id": "MikrotikPPPoEAcctStart",
"filters": ["*string:~*req.Acct-Status-Type:Start"],
"flags": ["*initiate", "*attributes", "*resources", "*accounts"],
"request_fields": [
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"},
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"},
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
"value": "*prepaid", "mandatory": true},
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable",
"value": "~*req.Acct-Session-Id", "mandatory": true},
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable",
"value": "~*req.NAS-IP-Address", "mandatory": true},
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant",
"value": "data"},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "CallingStationId", "path": "*cgreq.CallingStationId", "type": "*variable",
"value": "~*req.Calling-Station-Id"},
{"tag": "FramedIPAddress", "path": "*cgreq.FramedIPAddress", "type": "*variable",
"value": "~*req.Framed-IP-Address"},
{"tag": "RemoteAddr", "path": "*cgreq.RemoteAddr", "type": "*variable",
"value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}
],
"reply_fields": []
},
{
"id": "MikrotikPPPoEAcctInterim",
"filters": ["*string:~*req.Acct-Status-Type:Interim-Update"],
"flags": ["*update", "*accounts"],
"request_fields": [
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"},
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"},
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
"value": "*prepaid", "mandatory": true},
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable",
"value": "~*req.Acct-Session-Id", "mandatory": true},
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable",
"value": "~*req.NAS-IP-Address", "mandatory": true},
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant",
"value": "data"},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable",
"value": "~*req.Acct-Session-Time{*duration_seconds}"},
{"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*sum",
"value": "~*req.Acct-Input-Octets;~*req.Acct-Output-Octets"}
],
"reply_fields": []
},
{
"id": "MikrotikPPPoEAcctStop",
"filters": ["*string:~*req.Acct-Status-Type:Stop"],
"flags": ["*terminate", "*resources", "*accounts", "*cdrs"],
"request_fields": [
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"},
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"},
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
"value": "*prepaid", "mandatory": true},
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable",
"value": "~*req.Acct-Session-Id", "mandatory": true},
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable",
"value": "~*req.NAS-IP-Address", "mandatory": true},
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant",
"value": "data"},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable",
"value": "~*req.Acct-Session-Time{*duration_seconds}", "mandatory": true},
{"tag": "DataUsed", "path": "*cgreq.DataUsed", "type": "*sum",
"value": "~*req.Acct-Input-Octets;~*req.Acct-Output-Octets"},
{"tag": "CallingStationId", "path": "*cgreq.CallingStationId", "type": "*variable",
"value": "~*req.Calling-Station-Id"},
{"tag": "FramedIPAddress", "path": "*cgreq.FramedIPAddress", "type": "*variable",
"value": "~*req.Framed-IP-Address"},
{"tag": "RemoteAddr", "path": "*cgreq.RemoteAddr", "type": "*variable",
"value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}
],
"reply_fields": []
}
]
}
}

109
pppoe_auth.json Normal file
View File

@@ -0,0 +1,109 @@
{
"radius_agent": {
"request_processors": [
{
"id": "MikrotikPPPoEAuthCGR",
"filters": [
"*string:~*vars.*radReqType:*radAuth"
],
"flags": ["*authorize", "*attributes", "*accounts", "*continue"],
"request_fields": [
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"},
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"},
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
"value": "*prepaid", "mandatory": true},
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable",
"value": "~*req.Acct-Session-Id", "mandatory": true},
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable",
"value": "~*req.NAS-IP-Address", "mandatory": true},
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable",
"value": "~*req.User-Name", "mandatory": true},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant",
"value": "data"},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable",
"value": "~*req.Event-Timestamp"},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable",
"value": "~*req.Event-Timestamp"},
{"tag": "CallingStationId", "path": "*cgreq.CallingStationId", "type": "*variable",
"value": "~*req.Calling-Station-Id"},
{"tag": "PasswordFromAttributes", "path": "*cgreq.PasswordFromAttributes",
"type": "*constant", "value": "*attributes"}
],
"reply_fields": [
{"tag": "SessionTimeout", "path": "*rep.Session-Timeout", "type": "*variable",
"value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true},
{"tag": "AcctInterimInterval", "path": "*rep.Acct-Interim-Interval",
"type": "*constant", "value": "60"},
{"tag": "FramedIPAddress", "path": "*rep.Framed-IP-Address", "type": "*variable",
"value": "~*cgrep.Attributes.FramedIPAddress"},
{"tag": "FramedIPNetmask", "path": "*rep.Framed-IP-Netmask", "type": "*variable",
"value": "~*cgrep.Attributes.FramedIPNetmask"},
{"tag": "MikrotikRateLimit", "path": "*rep.Mikrotik-Rate-Limit", "type": "*variable",
"value": "~*cgrep.Attributes.MikrotikRateLimit"}
]
},
{
"id": "MikrotikPPPoEAuthPAP",
"filters": [
"*string:~*vars.*radReqType:*radAuth",
"*notempty:~*req.User-Password:"
],
"flags": ["*radauth", "*pap", "*log"],
"request_fields": [
{"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable",
"value": "~*cgrep.Attributes.PasswordFromAttributes"}
],
"reply_fields": [
{"tag": "RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*removeall", "path": "*rep"},
{"tag": "Code", "path": "*rep.*radReplyCode", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*constant", "value": "AccessReject"},
{"tag": "ReplyMessage", "path": "*rep.Reply-Message", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*variable", "value": "~*cgrep.Error"}
]
},
{
"id": "MikrotikPPPoEAuthCHAP",
"filters": [
"*string:~*vars.*radReqType:*radAuth",
"*notempty:~*req.CHAP-Password:"
],
"flags": ["*radauth", "*chap", "*log"],
"request_fields": [
{"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable",
"value": "~*cgrep.Attributes.PasswordFromAttributes"}
],
"reply_fields": [
{"tag": "RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*removeall", "path": "*rep"},
{"tag": "Code", "path": "*rep.*radReplyCode", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*constant", "value": "AccessReject"},
{"tag": "ReplyMessage", "path": "*rep.Reply-Message", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*variable", "value": "~*cgrep.Error"}
]
},
{
"id": "MikrotikPPPoEAuthMSCHAPv2",
"filters": [
"*string:~*vars.*radReqType:*radAuth",
"*notempty:~*req.Microsoft.MS-CHAP-Challenge:"
],
"flags": ["*radauth", "*mschapv2", "*log"],
"request_fields": [
{"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable",
"value": "~*cgrep.Attributes.PasswordFromAttributes"}
],
"reply_fields": [
{"tag": "RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*removeall", "path": "*rep"},
{"tag": "Code", "path": "*rep.*radReplyCode", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*constant", "value": "AccessReject"},
{"tag": "ReplyMessage", "path": "*rep.Reply-Message", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*variable", "value": "~*cgrep.Error"}
]
}
]
}
}

View File

@@ -0,0 +1,4 @@
#Tenant,Account,ActionPlanId,ActionTriggersId,AllowNegative,Disabled
cgrates.org,pppoe_user1,AP_PPPOE_INIT,,,
cgrates.org,pppoe_user2,AP_PPPOE_INIT,,,
cgrates.org,pppoe_user3,AP_PPPOE_INIT,,,
1 #Tenant Account ActionPlanId ActionTriggersId AllowNegative Disabled
2 cgrates.org pppoe_user1 AP_PPPOE_INIT
3 cgrates.org pppoe_user2 AP_PPPOE_INIT
4 cgrates.org pppoe_user3 AP_PPPOE_INIT

View File

@@ -0,0 +1,5 @@
#Id,ActionsId,TimingId,Weight
# Initial balance setup
AP_PPPOE_INIT,ACT_TOPUP_100,*asap,10
# Monthly topup plan
AP_PPPOE_MONTHLY,ACT_TOPUP_1000,*monthly,10
1 #Id,ActionsId,TimingId,Weight
2 # Initial balance setup
3 AP_PPPOE_INIT,ACT_TOPUP_100,*asap,10
4 # Monthly topup plan
5 AP_PPPOE_MONTHLY,ACT_TOPUP_1000,*monthly,10

View File

@@ -0,0 +1,7 @@
#ActionsId,Action,ExtraParameters,Filter,BalanceId,BalanceType,Categories,DestinationIds,RatingSubject,SharedGroup,ExpiryTime,TimingIds,Units,BalanceWeight,BalanceBlocker,BalanceDisabled,Weight
# Add 100 units of monetary balance (for prepaid users)
ACT_TOPUP_100,*topup_reset,,,main,*monetary,,,,,*unlimited,,100,10,false,false,10
# Add 1000 units of monetary balance
ACT_TOPUP_1000,*topup_reset,,,main,*monetary,,,,,*unlimited,,1000,10,false,false,10
# Log balance
ACT_LOG,*log,,,,,,,,,,,,,,,10
1 #ActionsId,Action,ExtraParameters,Filter,BalanceId,BalanceType,Categories,DestinationIds,RatingSubject,SharedGroup,ExpiryTime,TimingIds,Units,BalanceWeight,BalanceBlocker,BalanceDisabled,Weight
2 # Add 100 units of monetary balance (for prepaid users)
3 ACT_TOPUP_100,*topup_reset,,,main,*monetary,,,,,*unlimited,,100,10,false,false,10
4 # Add 1000 units of monetary balance
5 ACT_TOPUP_1000,*topup_reset,,,main,*monetary,,,,,*unlimited,,1000,10,false,false,10
6 # Log balance
7 ACT_LOG,*log,,,,,,,,,,,,,,,10

View File

@@ -0,0 +1,23 @@
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,Path,Type,Value,Blocker,Weight
# PPPoE user credentials and RADIUS reply attributes
# User: pppoe_user1 - 10Mbps plan with static IP
cgrates.org,ATTR_PPPOE_USER1,*sessions,*string:~*req.Account:pppoe_user1,,,,,,false,20
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.Password,*constant,SecurePass123,,
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.RequestType,*constant,*prepaid,,
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.FramedIPAddress,*constant,10.0.0.101,,
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.FramedIPNetmask,*constant,255.255.255.0,,
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.MikrotikRateLimit,*constant,10M/10M,,
# User: pppoe_user2 - 20Mbps plan with static IP
cgrates.org,ATTR_PPPOE_USER2,*sessions,*string:~*req.Account:pppoe_user2,,,,,,false,20
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.Password,*constant,SecurePass456,,
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.RequestType,*constant,*prepaid,,
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.FramedIPAddress,*constant,10.0.0.102,,
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.FramedIPNetmask,*constant,255.255.255.0,,
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.MikrotikRateLimit,*constant,20M/20M,,
# User: pppoe_user3 - 50Mbps plan with dynamic IP
cgrates.org,ATTR_PPPOE_USER3,*sessions,*string:~*req.Account:pppoe_user3,,,,,,false,20
cgrates.org,ATTR_PPPOE_USER3,,,,,*req.Password,*constant,SecurePass789,,
cgrates.org,ATTR_PPPOE_USER3,,,,,*req.RequestType,*constant,*prepaid,,
cgrates.org,ATTR_PPPOE_USER3,,,,,*req.MikrotikRateLimit,*constant,50M/50M,,
1 #Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,Path,Type,Value,Blocker,Weight
2 # PPPoE user credentials and RADIUS reply attributes
3 # User: pppoe_user1 - 10Mbps plan with static IP
4 cgrates.org,ATTR_PPPOE_USER1,*sessions,*string:~*req.Account:pppoe_user1,,,,,,false,20
5 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.Password,*constant,SecurePass123,,
6 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.RequestType,*constant,*prepaid,,
7 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.FramedIPAddress,*constant,10.0.0.101,,
8 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.FramedIPNetmask,*constant,255.255.255.0,,
9 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.MikrotikRateLimit,*constant,10M/10M,,
10 # User: pppoe_user2 - 20Mbps plan with static IP
11 cgrates.org,ATTR_PPPOE_USER2,*sessions,*string:~*req.Account:pppoe_user2,,,,,,false,20
12 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.Password,*constant,SecurePass456,,
13 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.RequestType,*constant,*prepaid,,
14 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.FramedIPAddress,*constant,10.0.0.102,,
15 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.FramedIPNetmask,*constant,255.255.255.0,,
16 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.MikrotikRateLimit,*constant,20M/20M,,
17 # User: pppoe_user3 - 50Mbps plan with dynamic IP
18 cgrates.org,ATTR_PPPOE_USER3,*sessions,*string:~*req.Account:pppoe_user3,,,,,,false,20
19 cgrates.org,ATTR_PPPOE_USER3,,,,,*req.Password,*constant,SecurePass789,,
20 cgrates.org,ATTR_PPPOE_USER3,,,,,*req.RequestType,*constant,*prepaid,,
21 cgrates.org,ATTR_PPPOE_USER3,,,,,*req.MikrotikRateLimit,*constant,50M/50M,,

View File

@@ -0,0 +1,3 @@
#Tenant,ID,FilterIDs,ActivationInterval,RunID,AttributeIDs,Weight
cgrates.org,DEFAULT,,,*default,*none,0
cgrates.org,Raw,,,*raw,*constant:*req.RequestType:*none,0
1 #Tenant ID FilterIDs ActivationInterval RunID AttributeIDs Weight
2 cgrates.org DEFAULT *default *none 0
3 cgrates.org Raw *raw *constant:*req.RequestType:*none 0

View File

@@ -0,0 +1,3 @@
#Id,DestinationId,RatesTag,RoundingMethod,RoundingDecimals,MaxCost,MaxCostStrategy
DR_DATA_TIME,DST_DATA,RT_DATA_TIME,*up,4,0,
DR_DATA_FLAT,DST_DATA,RT_DATA_FLAT,*up,4,0,
1 #Id DestinationId RatesTag RoundingMethod RoundingDecimals MaxCost MaxCostStrategy
2 DR_DATA_TIME DST_DATA RT_DATA_TIME *up 4 0
3 DR_DATA_FLAT DST_DATA RT_DATA_FLAT *up 4 0

View File

@@ -0,0 +1,2 @@
#Id,Prefix
DST_DATA,data
1 #Id Prefix
2 DST_DATA data

View File

@@ -0,0 +1 @@
#Tenant,ID,Type,Path,Values,ActivationInterval
1 #Tenant ID Type Path Values ActivationInterval

View File

@@ -0,0 +1,5 @@
#Id,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart
# Time-based rate: $0.001 per second (for prepaid session time billing)
RT_DATA_TIME,0,0.001,1s,1s,0s
# Flat rate: $0 per session (unlimited plan)
RT_DATA_FLAT,0,0,1s,1s,0s
1 #Id,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart
2 # Time-based rate: $0.001 per second (for prepaid session time billing)
3 RT_DATA_TIME,0,0.001,1s,1s,0s
4 # Flat rate: $0 per session (unlimited plan)
5 RT_DATA_FLAT,0,0,1s,1s,0s

View File

@@ -0,0 +1,3 @@
#Id,DestinationRatesId,TimingTag,Weight
RP_DATA_TIME,DR_DATA_TIME,*any,10
RP_DATA_FLAT,DR_DATA_FLAT,*any,10
1 #Id DestinationRatesId TimingTag Weight
2 RP_DATA_TIME DR_DATA_TIME *any 10
3 RP_DATA_FLAT DR_DATA_FLAT *any 10

View File

@@ -0,0 +1,7 @@
#Tenant,Category,Subject,ActivationTime,RatingPlanId,RatesFallbackSubject
# PPPoE users with time-based billing
cgrates.org,generic,pppoe_user1,2024-01-01T00:00:00Z,RP_DATA_TIME,
cgrates.org,generic,pppoe_user2,2024-01-01T00:00:00Z,RP_DATA_TIME,
cgrates.org,generic,pppoe_user3,2024-01-01T00:00:00Z,RP_DATA_TIME,
# Default fallback for any user in generic category
cgrates.org,generic,*any,2024-01-01T00:00:00Z,RP_DATA_TIME,
1 #Tenant,Category,Subject,ActivationTime,RatingPlanId,RatesFallbackSubject
2 # PPPoE users with time-based billing
3 cgrates.org,generic,pppoe_user1,2024-01-01T00:00:00Z,RP_DATA_TIME,
4 cgrates.org,generic,pppoe_user2,2024-01-01T00:00:00Z,RP_DATA_TIME,
5 cgrates.org,generic,pppoe_user3,2024-01-01T00:00:00Z,RP_DATA_TIME,
6 # Default fallback for any user in generic category
7 cgrates.org,generic,*any,2024-01-01T00:00:00Z,RP_DATA_TIME,