New Member
Posts: 4
Registered: ‎08-17-2016
Kudos: 1

USG config.gateway.json syntax and parameters - where to see?

Hello, 

 

I'm playing with config.gateway.json to set up rules for QoS and I have found, that string value priority is not working on USG like it does on Edgerouter. 

 

Then I started to serch for syntax of config.gateway.json and full list of parameters, but could not find anything. 

Is there any manual or example base? 

 

This code of classes did not worked unless I removed string:

 

"priority": "6"

 

"21": {
            "bandwidth": "3%",
            "burst": "32k",
            "ceiling": "10%",
            "description": "RTP",
            "match": {
              "RTP": {
                "ip": {
                  "dscp": "46"
                }
              },
              "RTP-IPv6": {
                "ipv6": {
                  "dscp": "46"
                }
              },
              "IAX2": {
                "ip": {
                  "source": {
                    "port": "4569"
                  }
                }
              }
            },
"priority": "6",
"queue-type": "priority"
},

Plus is "source" (before port number) should be used for downstream rules and "destination" for upstream?

Member
Posts: 265
Registered: ‎09-08-2016
Kudos: 64
Solutions: 9

Re: USG config.gateway.json syntax and parameters - where to see?

[ Edited ]

This example for EdgeRouter does work on USG (3P):

EdgeRouter - Quality of Service for Voice Over IP (QoS for VoIP)

 

My config.json based on this example, figures altered for my needs:

{
        "interfaces": {
                "ethernet": {
                        "eth0": {
                                "traffic-policy": {
                                        "out": "UpStreamV"
                                }
                        },
                        "eth1": {
                                "traffic-policy": {
                                        "out": "DownStreamV"
                                }
                        }
                }
        },
        "traffic-policy": {
                "shaper": {
                        "DownStreamV": {
                                "bandwidth": "160000kbit",
                                "class": {
                                        "10": {
                                                "bandwidth": "1%",
                                                "burst": "15k",
                                                "ceiling": "10%",
                                                "description": "RTP",
                                                "match": {
                                                        "VOIP-RTP": {
                                                                "ip": {
                                                                        "dscp": "46"
                                                                }
                                                        }
                                                },
                                                "queue-type": "fair-queue"
                                        },
                                        "20": {
                                                "bandwidth": "1%",
                                                "burst": "15k",
                                                "ceiling": "10%",
                                                "description": "SIP",
                                                "match": {
                                                        "VOIP-SIP": {
                                                                "ip": {
                                                                        "dscp": "26"
                                                                }
                                                        }
                                                },
                                                "queue-type": "fair-queue"
                                        }
                                },
                                "default": {
                                        "bandwidth": "98%",
                                        "burst": "15k",
                                        "ceiling": "100%",
                                        "queue-type": "fair-queue"
                                },
                                "description": "DownStream QoS policy"
                        },
                        "UpStreamV": {
                                "bandwidth": "30000kbit",
                                "class": {
                                        "10": {
                                                "bandwidth": "5%",
                                                "burst": "15k",
                                                "ceiling": "50%",
                                                "description": "RTP",
                                                "match": {
                                                        "VOIP-RTP": {
                                                                "ip": {
                                                                        "dscp": "46"
                                                                }
                                                        }
                                                },
                                                "queue-type": "fair-queue"
                                        },
                                        "20": {
                                                "bandwidth": "5%",
                                                "burst": "15k",
                                                "ceiling": "10%",
                                                "description": "SIP",
                                                "match": {
                                                        "VOIP-SIP": {
                                                                "ip": {
                                                                        "dscp": "26"
                                                                }
                                                        }
                                                },
                                                "queue-type": "fair-queue"
                                        }
                                },
                                "default": {
                                        "bandwidth": "90%",
                                        "burst": "15k",
                                        "ceiling": "100%",
                                        "queue-type": "fair-queue"
                                },
                                "description": "UpStream QoS policy"
                        }
                }
        }
}

Alternatively you can give the latest Beta USG firmware a try, which is based on EdgeRouter 1.9.7:

[USG] Firmware v4.4.6 now available

 

New Member
Posts: 4
Registered: ‎08-17-2016
Kudos: 1

Re: USG config.gateway.json syntax and parameters - where to see?

@wjn 

 

My config looks almost same, but I don't see "priority" parameter at you cfg. 

I can set it up though CLI, but when I put it into json-file USG loops reboot. 

 

I made a config through CLI with Edgerouter commands and then exported it by: 

mca-ctrl -t dump-cfg > /tmp/config.gateway.json 
Member
Posts: 265
Registered: ‎09-08-2016
Kudos: 64
Solutions: 9

Re: USG config.gateway.json syntax and parameters - where to see?

You should remove all items provisioned by the GUI, only leave your additional settings in the JSON file. Otherwise it will cause conflicts in provisioning (and it keeps provisioning).

 

See also UniFi - How to further customize USG configuration with config.gateway.json

 

 

Highlighted
New Member
Posts: 29
Registered: ‎07-17-2018
Kudos: 1

Re: USG config.gateway.json syntax and parameters - where to see?

Let me pick Update the question „Where to find Syntax ot Parameters?“.

 

Is this anwered?

I am searching for hours to find out whats possible but cannot find anything documented.

Frustrating .....