> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://en.megaport.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://en.megaport.ferndocs.com/_mcp/server.

# List IP Routes

GET https://api.megaport.com/v2/product/mcr2/{productUid}/diagnostics/routes/ip

Returns a list of IP routes for an MCR.

**Note:** This endpoint is strictly rate limited and not intended for regular monitoring, only troubleshooting.

The `productUid` is the unique product ID for the MCR and is required.

Without an `ipAddress` parameter, the request returns both IPv4 and IPv6 routes.

With the optional `ipAddress` parameter, the request narrows the list to exact matching routes or the best matching route. The `ipAddress` parameter accepts the following IP address formats:

| **IP Value**                               | **Description**                         |
| ------------------------------------------ | --------------------------------------- |
| 12345678                                   | IPv4 as Integer                         |
| 10.0.0.0                                   | IPv4 Address Only                       |
| 10.0.0.0/8                                 | IPv4 Address and Subnet Mask as CIDR    |
| 10.0.0.0/255.0.0.0                         | IPv4 Address and Subnet Mask            |
| ::                                         | IPv6 Zero Address                       |
| ::/128                                     | IPv6 Zero Network Address               |
| 2001:db8::1/64                             | IPv6 Network Address                    |
| 2001:db8:4444:ffaa:2233:4455:6677:a987     | IPv6 Address (long, lowercase)          |
| 2001:DB8:4444:FFAA:2233:4455:6677:A987/128 | IPv6 Network Address (long, upper case) |

#### Running in Asynchronous mode

This endpoint must be run in asynchronous mode.

To use asynchronous mode, set the `async` parameter to `True`.

In asynchronous mode, the response is returned in a matter of milliseconds with no actual results, and a status of *Pending*. To retrieve the results, use the MCR `productUid` and the `operationId` returned in the response of this endpoint with the `/v2/product/mcr2/{productUid}/diagnostics/routes/operation` endpoint. This allows you to return routing tables in a low impact way.

**Note:** Synchronous mode has been deprecated and should not be used.

Reference: https://en.megaport.ferndocs.com/api-reference/mcr-looking-glass/list-ip-routes

## Servers

- `https://api.megaport.com` (Production environment, default)
- `https://api-staging.megaport.com` (Staging environment (test only, reset every 24 hours))

## Request

### Path parameters

- `productUid` (string, required)

### Query parameters

- `ip_address` (string, optional) — Filter the results based on this address. (String - optional)
- `async` (string, optional) — Whether the endpoint will be run in sync or async mode. (Boolean - required)

## Response

### 200

List IP Routes - Async Mode / List IP Routes - Async Mode

- `data` (string, optional)
- `message` (string, optional)
- `terms` (string, optional)

## Examples

**Response**

```json
{
  "data": "75557e49-b493-4a9e-9b03-3021570601ba",
  "message": "Please retrieve the result with the operation id: 75557e49-b493-4a9e-9b03-3021570601ba",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python
import requests

url = "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/ip"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/ip';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/ip"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/ip")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/ip")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/ip');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/ip");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/ip")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```