Перейти до вмісту
NimbusNexus

Маршрутизатори

Маршрутизатор — це те, що дає мережі тенанта (і її підмережам) доступ до інтернету. VM, підʼєднані до підмережі тенанта, не можуть самі вийти в публічний інтернет — вони перебувають у приватному сегменті L2. Маршрутизатор зʼєднує цей сегмент із зовнішньою мережею регіону, виконує NAT для вихідного трафіку й (за потреби) обслуговує плаваючі IP для вхідного.

Коли потрібен маршрутизатор

  • Публічні VM у мережі тенанта. Підʼєднайте маршрутизатор, потім виділіть + підʼєднайте плаваючий IP. Вихідний трафік проходить NAT через маршрутизатор; вхідний на плаваючий IP маршрутизується назад до VM.
  • Змішані приватні/публічні рівні застосунку. Вебрівень стоїть за маршрутизатором із плаваючим IP; рівні застосунку + БД залишаються приватними й виходять в інтернет (напр., для оновлення пакетів) через source-NAT маршрутизатора.
  • Маршрутизація між кількома підмережами. Маршрутизатор може одночасно обслуговувати кілька підмереж. Трафік між двома підмережами на одному маршрутизаторі залишається всередині VPC і ніколи не виходить за межі NimbusNexus.

Якщо ви підʼєднуєте VM безпосередньо до зовнішньої мережі, маршрутизатор не потрібен — зовнішня мережа САМА Є шлюзом.

SNAT, DNAT і плаваючі IP

Маршрутизатор має одне підключення до зовнішнього шлюзу (до зовнішньої мережі регіону) і нуль або більше внутрішніх підключень (до підмереж тенанта). Щоб задати шлюз у external_gateway_info, потрібні також bandwidth_subscription і bandwidth_mbps (кратне 10): пропускна здатність шлюзу обмежується цим значенням, а сама пропускна здатність тарифікується (див. Дані про ціни).

  • Вихідний трафік із приватної VM → маршрутизатор виконує source-NAT на свій зовнішній IP. Кілька приватних VM спільно використовують цей один зовнішній IP для вихідного трафіку.
  • Вхідний трафік на плаваючий IP → маршрутизатор виконує destination-NAT на приватну VM, до якої підʼєднано плаваючий IP. Приватна VM бачить початковий IP джерела (для вхідного трафіку ми зберігаємо IP клієнта під час NAT; SNAT застосовується лише до вихідного).

Source-NAT визначається параметром external_gateway_info.enable_snat, який є налаштуванням платформи. Destination-NAT не налаштовують напряму: маршрутизатор робить це сам, залежно від того, які плаваючі IP ви підʼєднали.

Статичні маршрути

Маршрутизатор має таблицю статичних маршрутів, яку можна заповнити для призначень, відмінних від маршруту за замовчуванням. Кожен маршрут спрямовує трафік до CIDR у destination з будь-якої підмережі на маршрутизаторі на адресу nexthop — іншу VM, як-от VPN-пристрій чи прозорий проксі. PUT /api/v1/router/{router_id}/extraroutes атомарно додає маршрути, а DELETE за тим самим шляхом атомарно їх видаляє. Більшість користувачів ніколи цього не торкаються; ця можливість існує для складних схем VPC, яким вона потрібна.

Що далі

  • Мережі і Підмережі — що зʼєднують маршрутизатори.
  • Плаваючі IP — вхідні публічні адреси, що працюють через маршрутизатор.
  • Групи безпеки — рівень фаєрвола, що застосовується на інтерфейсі VM (сам маршрутизатор трафік не фільтрує).

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 →