Unable to get the VPN status of the MX's backup WAN service via API

BazMonkey
Getting noticed

Unable to get the VPN status of the MX's backup WAN service via API

I've discovered some issues where sites use a 4G backup (via a 4G modem) have got issues with a site-to-site VPN establishing. Seems to be an ISP issue. 

 

So, each site has 3 VPNs to 3 MX hub sites. This would mean there 6 VPNs establised. 3 across the WAN1 link and 3 across the WAN2 link.

 

I can run an API call to get he status of the WAN1 VPNs but not to the WAN2 VPNs.  (See below)

 

Is there any way apart from doing individual packet caputures on each site to determine via API the status of the WAN2 VPNs?

 

[{'networkId': 'N_xxxxxxxxxxxx', 'networkName': '#508921#-network_name', 'reachability': 'reachable'}, {'networkId': 'N_xxxxxxxxxx', 'networkName': 'network_name', 'reachability': 'reachable'}, {'networkId': 'L_xxxxxxxxxxxx', 'networkName': 'network_name', 'reachability': 'reachable'}]
2 REPLIES 2
PhilipDAth
Kind of a big deal
Kind of a big deal

I'm not aware of any way to get this info.

sungod
Head in the Cloud

Is the cellular modem on a WAN 2 RJ45 port, or is it MX integrated/on MX USB port?

 

If the MX 'knows' it is a cellular fallback connection then it won't establish VPNs until the WAN 1 link fails.

 

You can get uplink status with getOrganizationApplianceUplinkStatuses it should include all uplinks including cellular.

 

Example from API docs...

 

[
    {
        "networkId": "N_24329156",
        "serial": "Q234-ABCD-5678",
        "model": "MX68C",
        "lastReportedAt": "2018-02-11T00:00:00Z",
        "uplinks": [
            {
                "interface": "wan1",
                "status": "active",
                "ip": "1.2.3.4",
                "gateway": "1.2.3.5",
                "publicIp": "123.123.123.1",
                "primaryDns": "8.8.8.8",
                "secondaryDns": "8.8.4.4",
                "ipAssignedBy": "static"
            },
            {
                "interface": "cellular",
                "status": "ready",
                "ip": "1.2.3.4",
                "provider": "at&t",
                "publicIp": "123.123.123.1",
                "model": "integrated",
                "signalStat": {
                    "rsrp": "-120",
                    "rsrq": "-13"
                },
                "connectionType": "4g",
                "apn": "internet",
                "iccid": "123456789"
            }
        ]
    }
]

 

If both WAN 1 and 2 are RJ45, then a roundabout way might be to use getOrganizationApplianceVpnStats

 

This shows peer-peer stats for each end of each uplink, if you choose a short time period you might be able to create some rules to infer what you need from the stats...

 

[
    {
        "networkId": "N_12345678",
        "networkName": "San Francisco Office",
        "merakiVpnPeers": [
            {
                "networkId": "L_23456789",
                "networkName": "New York Office",
                "usageSummary": {
                    "receivedInKilobytes": 1234567,
                    "sentInKilobytes": 2345678
                },
                "latencySummaries": [
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan1",
                        "avgLatencyMs": 15,
                        "minLatencyMs": 10,
                        "maxLatencyMs": 30
                    },
                    {
                        "senderUplink": "wan2",
                        "receiverUplink": "wan1",
                        "avgLatencyMs": 15,
                        "minLatencyMs": 10,
                        "maxLatencyMs": 30
                    }
                ],
                "lossPercentageSummaries": [
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan1",
                        "avgLossPercentage": 0,
                        "minLossPercentage": 0,
                        "maxLossPercentage": 0.1
                    },
                    {
                        "senderUplink": "wan2",
                        "receiverUplink": "wan1",
                        "avgLossPercentage": 0,
                        "minLossPercentage": 0,
                        "maxLossPercentage": 0.1
                    }
                ],
                "jitterSummaries": [
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan1",
                        "avgJitter": 0.01,
                        "minJitter": 0,
                        "maxJitter": 0.25
                    },
                    {
                        "senderUplink": "wan2",
                        "receiverUplink": "wan1",
                        "avgJitter": 0.01,
                        "minJitter": 0,
                        "maxJitter": 0.25
                    }
                ],
                "mosSummaries": [
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan1",
                        "avgMos": 4.1,
                        "minMos": 4,
                        "maxMos": 4.2
                    },
                    {
                        "senderUplink": "wan2",
                        "receiverUplink": "wan1",
                        "avgMos": 4.1,
                        "minMos": 4,
                        "maxMos": 4.2
                    }
                ]
            }
        ]
    },
    {
        "networkId": "L_23456789",
        "networkName": "New York Office",
        "merakiVpnPeers": [
            {
                "networkId": "N_12345678",
                "networkName": "San Francisco Office",
                "usageSummary": {
                    "receivedInKilobytes": 2345678,
                    "sentInKilobytes": 1234567
                },
                "latencySummaries": [
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan1",
                        "avgLatencyMs": 15,
                        "minLatencyMs": 10,
                        "maxLatencyMs": 30
                    },
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan2",
                        "avgLatencyMs": 15,
                        "minLatencyMs": 10,
                        "maxLatencyMs": 30
                    }
                ],
                "lossPercentageSummaries": [
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan1",
                        "avgLossPercentage": 0,
                        "minLossPercentage": 0,
                        "maxLossPercentage": 0.1
                    },
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan2",
                        "avgLossPercentage": 0,
                        "minLossPercentage": 0,
                        "maxLossPercentage": 0.1
                    }
                ],
                "jitterSummaries": [
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan1",
                        "avgJitter": 0.01,
                        "minJitter": 0,
                        "maxJitter": 0.25
                    },
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan2",
                        "avgJitter": 0.01,
                        "minJitter": 0,
                        "maxJitter": 0.25
                    }
                ],
                "mosSummaries": [
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan1",
                        "avgMos": 4.1,
                        "minMos": 4,
                        "maxMos": 4.2
                    },
                    {
                        "senderUplink": "wan1",
                        "receiverUplink": "wan2",
                        "avgMos": 4.1,
                        "minMos": 4,
                        "maxMos": 4.2
                    }
                ]
            }
        ]
    }
]

 

Get notified when there are additional replies to this discussion.