Aller au contenu
NimbusNexus

Routeurs

C’est le routeur qui donne à un réseau tenant (et à ses sous-réseaux) l’accès à internet. Les VM attachées à un sous-réseau tenant ne peuvent pas atteindre l’internet public par elles-mêmes — elles sont sur un segment L2 privé. Un routeur relie ce segment au réseau externe de la région, en faisant du NAT pour le trafic sortant et (en option) en hébergeant des IP flottantes pour le trafic entrant.

Quand vous avez besoin d’un routeur

  • VM exposées au public sur un réseau tenant. Attachez un routeur, puis allouez et attachez une IP flottante. Le trafic sortant passe par le NAT du routeur ; le trafic entrant sur l’IP flottante est routé jusqu’à la VM.
  • Tiers applicatifs mixtes privés/publics. Le tier web se trouve derrière un routeur avec une IP flottante ; les tiers app + db restent privés et atteignent internet (par exemple pour les mises à jour de paquets) via le source-NAT du routeur.
  • Routage multi-sous-réseau. Un routeur peut desservir plusieurs sous-réseaux simultanément. Le trafic entre deux sous-réseaux d’un même routeur est intra-VPC et ne quitte jamais NimbusNexus.

Si vous attachez des VM directement au réseau externe, vous n’avez pas besoin de routeur — le réseau externe EST la passerelle.

SNAT, DNAT et IP flottantes

Un routeur a une connexion de passerelle externe (vers le réseau externe de la région) et zéro ou plusieurs connexions internes (vers des sous-réseaux tenant). Définir la passerelle dans external_gateway_info demande aussi bandwidth_subscription et bandwidth_mbps (un multiple de 10) : la passerelle est plafonnée à cette bande passante, et la bande passante est facturée (voir Données tarifaires).

  • Trafic sortant d’une VM privée → le routeur fait du source-NAT vers son IP externe. Plusieurs VM privées partagent cette unique IP externe pour le trafic sortant.
  • Trafic entrant vers une IP flottante → le routeur fait du destination-NAT vers la VM privée à laquelle l’IP flottante est attachée. La VM privée voit l’IP source d’origine (nous préservons l’IP du client à travers le NAT pour le trafic entrant ; seul le trafic sortant subit un SNAT).

Le source-NAT suit external_gateway_info.enable_snat, qui est un paramètre de la plateforme. Vous ne configurez pas le destination-NAT directement ; le routeur s’en charge en fonction des IP flottantes que vous avez attachées.

Routes statiques

Un routeur porte une table de routes statiques que vous pouvez remplir pour des destinations autres que celle par défaut. Chaque route envoie le trafic destiné à un CIDR destination, depuis n’importe quel sous-réseau du routeur, vers une adresse nexthop — une autre VM, comme une appliance VPN ou un proxy transparent. PUT /api/v1/router/{router_id}/extraroutes ajoute des routes de façon atomique, et DELETE sur le même chemin les retire de façon atomique. La plupart des utilisateurs n’y touchent jamais ; elle existe pour les architectures VPC avancées qui en ont besoin.

Étapes suivantes

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 →