{% for route in ipv4route %}
    {
        "vipType": "constant",
        "vipValue": [
        {
            "prefix": {
                "vipObjectType": "object",
                "vipType": "constant",
                "vipValue": "{{ route.prefix }}",
                "vipVariableName": "{{ route.gateway.value }}"
            },
            {% if route.gateway.value == "next-hop" %}
                "next-hop": {
                    "vipType": "constant",
                    "vipValue": [
                        {% for hop in route.next_hop %}
                            {
                            "address": {
                                "vipObjectType": "object",
                                "vipType": "constant",
                                "vipValue": "{{ hop.address }}",
                                "vipVariableName": "vpn_next_hop_ip_address_{{loop.index}}"
                            },
                            "distance": {
                                "vipObjectType": "object",
                                {% if hop.en_distance %}
                                    "vipType": "ignore",
                                {% else %}
                                    "vipType": "constant",
                                {% endif %}
                                "vipValue": {{ hop.distance }},
                                "vipVariableName": "vpn_next_hop_ip_distance_{{loop.index}}"
                            },
                            "priority-order": [
                                "address",
                                "distance"
                            ]
                            }{% if not loop.last %},{% endif %}
                        {% endfor %}
                    ],
                "vipObjectType": "tree",
                "vipPrimaryKey": [
                    "address"
                ]
                },
            {% endif %}
            "priority-order": [
            "prefix",
            "next-hop",
            "next-hop-with-track"
            ]
        }{% if not loop.last %},{% endif %}
        ],
        "vipObjectType": "tree",
        "vipPrimaryKey": [
        "prefix"
        ]
    }{% if not loop.last %},{% endif %}
{% endfor %}