Identify all connections between routers

This query identifies all connections between routers. These types of connections are also called Layer 3 router links. Each of these connections also represents a connection between two subnets.

You can use similar queries to determine the type of connection between two devices. You can determine whether a connection falls into any of the following types:

  • Layer 2 connection
  • Layer 3 router links

    This refers to connections between routers, and hence, between subnets, and is the example provided in this query.

  • Psuedowire connection

Use the topologyLinks table to identify which connections belong to a specific type of topology. This table lists all the connections in the database and specifies the identifier of a topology type entity from the entityData table.

Example

1]  SELECT       a.entityName Connected_Entity,
2]               z.entityName Connected_Entity
3]  FROM         topologyLinks t
4]  INNER JOIN   entityData topo ON topo.entityId = t.entityId
5]  INNER JOIN   connects c ON c.connectionId = t.connectionId
6]  INNER JOIN   entityData a ON a.entityId = c.aEndEntityId
7]  INNER JOIN   entityData z ON z.entityId = c.zEndEntityId
8]  WHERE        topo.entityType = 73

Description

The table below describes this query.

Table 1. Description of the query 

Line numbers

Description

1-2

Specify the data to show in the results, as follows:

  • The name of an interface at one end of the connection, represented by a.entityName
  • The name of an interface at the other end of the connection, represented by z.entityName

3

Use the topologyLinks table as the driving table for this query. Use the alias t for the topologyLinks table for purposes of brevity.

4

Identify all the types of topology listed in the topologyLinks table. Do this by joining the entityData table using the entityId field.

5

Extract the connection data for each connection. Do this by joining the connects table using the connectionId field.

6-7

Extract entity details for each of the interfaces at either end of the connection.

Do this by joining the entityData table a second time using the entityId field in the entityData table and the aEndEntityId and zEndEntityId fields in turn in the connects table.

8

Limit the results to connections within layer 3 router links only. This limits the results to connections between routers, and hence, between subnets.

Results

The table below shows the results of the query.

Table 2. Results of the query 

Connected entity

Connected entity

172.20.4.16[ Et0/0 ]

172.20.4.11[ Fa0/0 ]

172.20.4.11[ Fa0/0 ]

172.20.4.16[ Et0/0 ]

172.20.4.16[ Et0/0 ]

172.20.4.12[ Fa0/0 ]

172.20.4.11[ Fa0/0 ]

172.20.4.12[ Fa0/0 ]

172.20.4.12[ Fa0/0 ]

172.20.4.16[ Et0/0 ]

172.20.4.12[ Fa0/0 ]

172.20.4.11[ Fa0/0 ]

172.20.4.16[ Et0/0 ]

172.20.4.15[ Fa0/1 ]

172.20.4.11[ Fa0/0 ]

172.20.4.15[ Fa0/1 ]

172.20.4.12[ Fa0/0 ]

172.20.4.15[ Fa0/1 ]

172.20.4.15[ Fa0/1 ]

172.20.4.12[ Fa0/0 ]

172.20.4.15[ Fa0/1 ]

172.20.4.11[ Fa0/0 ]

172.20.4.15[ Fa0/1 ]

172.20.4.16[ Et0/0 ]

172.20.4.16[ Et0/0 ]

172.20.4.28[ Gi0/0 ]