Ir para o conteúdo
NimbusNexus

Roteadores

Um roteador é o que dá acesso à internet a uma rede de tenant (e às sub-redes dela). VMs anexadas a uma sub-rede de tenant não conseguem chegar à internet pública sozinhas — elas estão em um segmento L2 privado. Um roteador faz a ponte entre esse segmento e a rede externa da região, fazendo NAT para o tráfego de saída e (opcionalmente) hospedando IPs flutuantes para o tráfego de entrada.

Quando você precisa de um roteador

  • VMs voltadas para o público em uma rede de tenant. Anexe um roteador e depois aloque + anexe um IP flutuante. O tráfego de saída passa por NAT no roteador; o de entrada no IP flutuante é roteado de volta para a VM.
  • Camadas de app privadas e públicas misturadas. A camada web fica atrás de um roteador com um IP flutuante; as camadas de app + banco de dados continuam privadas e acessam a internet (para coisas como atualizações de pacotes) pelo NAT de origem do roteador.
  • Roteamento entre várias sub-redes. Um roteador pode atender várias sub-redes ao mesmo tempo. O tráfego entre duas sub-redes no mesmo roteador é interno à VPC e nunca sai da NimbusNexus.

Se você está anexando VMs diretamente à rede externa, não precisa de roteador — a rede externa É o gateway.

SNAT, DNAT e IPs flutuantes

Um roteador tem uma conexão de gateway externo (com a rede externa da região) e zero ou mais conexões internas (com sub-redes de tenant). Definir o gateway em external_gateway_info também recebe bandwidth_subscription e bandwidth_mbps (um múltiplo de 10): o gateway fica limitado a essa largura de banda, e a largura de banda é cobrada (veja Dados de preços).

  • Saída de uma VM privada → o roteador faz NAT de origem para o IP externo do roteador. Várias VMs privadas compartilham esse único IP externo para o tráfego de saída.
  • Entrada em um IP flutuante → o roteador faz NAT de destino para a VM privada à qual o IP flutuante está anexado. A VM privada vê o IP de origem original (preservamos o IP do cliente no NAT do tráfego de entrada; só o tráfego de saída passa por SNAT).

O NAT de origem segue external_gateway_info.enable_snat, que é uma configuração da plataforma. Você não configura o NAT de destino diretamente; o roteador cuida disso com base em quais IPs flutuantes você anexou.

Rotas estáticas

Um roteador tem uma tabela de rotas estáticas que você pode preencher para destinos que não são o padrão. Cada rota envia o tráfego destinado a um CIDR destination, vindo de qualquer sub-rede do roteador, para um endereço nexthop — outra VM, como um appliance de VPN ou um proxy transparente. PUT /api/v1/router/{router_id}/extraroutes adiciona rotas de forma atômica, e DELETE no mesmo caminho as remove de forma atômica. A maioria dos usuários nunca mexe nisso; ela existe para os layouts avançados de VPC que precisam dela.

Próximos passos

Reference

GET/api/v1/router/

List Routers

Lists virtual routers owned by the project.

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
namequerystring | null—
descriptionquerystring | null—
admin_state_upqueryboolean | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/router/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/router/

Create Router

Creates a virtual router, attaching a bandwidth-billed QoS policy when an external gateway is provided.

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
namestring | null—
descriptionstring | null—
admin_state_upboolean | null—
external_gateway_infoExternalGatewayInfo | null—
distributedboolean | null—
haboolean | null—
availability_zone_hintsarray of string | null—
bandwidth_subscriptionPlanType | nullSubscription plan for bandwidth billing on the external gateway port. Only relevant when external_gateway_info is provided.
bandwidth_mbpsinteger | null—
routesarray of Route | null—
project_idstring | null—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/router/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/api/v1/router/artifacts

Router Artifacts

Returns external networks and project subnets usable when creating a router.

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
namequerystring | null—
descriptionquerystring | null—
admin_state_upqueryboolean | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/router/artifacts" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/router/{router_id}

Get Router

Returns the details of a single virtual router by ID.

Parameters

NameInTypeDescription
router_id*pathstring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/router/<router_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
PUT/api/v1/router/{router_id}

Update Router

Updates a virtual router and refreshes its bandwidth-billed QoS policy when the external gateway changes.

Parameters

NameInTypeDescription
router_id*pathstring—

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
namestring—
descriptionstring | null—
admin_state_upboolean—
external_gateway_infoExternalGatewayInfo | null—
distributedboolean | null—
haboolean | null—
routesarray of Route | null—
bandwidth_subscriptionPlanType | nullSubscription plan for bandwidth billing on the external gateway port. Pass to start or update bandwidth billing when external_gateway_info is present; omit (or set to null) when removing the external gateway.
bandwidth_mbpsinteger | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X PUT "https://api.nimbusnexus.net/api/v1/router/<router_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/api/v1/router/{router_id}

Delete Router

Deletes a virtual router by ID.

Parameters

NameInTypeDescription
router_id*pathstring—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/router/<router_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
PUT/api/v1/router/{router_id}/extraroutes

Add Extra Routes

Atomically adds extra static routes to a virtual router's routing table.

Parameters

NameInTypeDescription
router_id*pathstring—

Request body

JSON body required.

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X PUT "https://api.nimbusnexus.net/api/v1/router/<router_id>/extraroutes" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "destination": "https://example.com/webhooks",
      "nexthop": "example"
    }
  ]'
DELETE/api/v1/router/{router_id}/extraroutes

Remove Extra Routes

Atomically removes extra static routes from a virtual router's routing table.

Parameters

NameInTypeDescription
router_id*pathstring—

Request body

JSON body required.

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/router/<router_id>/extraroutes" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "destination": "https://example.com/webhooks",
      "nexthop": "example"
    }
  ]'
GET/api/v1/router/{router_id}/extraroutes/artifacts

Extra Routes Artifacts

Returns artifacts of router interfaces to specify a correct next hop for extra routes.

Parameters

NameInTypeDescription
router_id*pathstring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/router/<router_id>/extraroutes/artifacts" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/router/{router_id}/interface

List Router Interfaces

Lists the interfaces (ports) currently attached to a virtual router.

Parameters

NameInTypeDescription
router_id*pathstring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/router/<router_id>/interface" \
  -H "Authorization: Bearer $NIMBUS_KEY"
PUT/api/v1/router/{router_id}/interface

Add Router Interface

Attaches a subnet or port to a virtual router as a new interface.

Parameters

NameInTypeDescription
router_id*pathstring—

Request body

FieldTypeDescription
subnet_idstring | null—
port_idstring | null—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X PUT "https://api.nimbusnexus.net/api/v1/router/<router_id>/interface" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/api/v1/router/{router_id}/interface/artifacts

Interface Artifacts

Returns the router's existing interfaces and the subnets that may be attached as new interfaces.

Parameters

NameInTypeDescription
router_id*pathstring—
admin_domainquerystring | null—
admin_projectquerystring | null—
scope_current_projectqueryboolean | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/router/<router_id>/interface/artifacts" \
  -H "Authorization: Bearer $NIMBUS_KEY"
DELETE/api/v1/router/{router_id}/interface/{port_id}

Remove Router Interface

Detaches an interface port from a virtual router.

Parameters

NameInTypeDescription
router_id*pathstring—
port_id*pathstring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/router/<router_id>/interface/<port_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"

Need to make a real call? Try these endpoints in the live Swagger UI →