Skip to main content
Glama

create_static_route

Add a static route to a Tier-1 gateway in VMware NSX to define network traffic paths by specifying destination CIDR and next hop IP.

Instructions

Create a static route on a Tier-1 gateway.

Args: tier1_id: The Tier-1 gateway ID. route_id: Unique ID for the static route. network: Destination CIDR (e.g. "10.0.0.0/8"). next_hop: Next hop IP address. target: Optional NSX Manager target name from config. Uses default if omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tier1_idYes
route_idYes
networkYes
next_hopYes
targetNo

Implementation Reference

  • The actual implementation of the create_static_route logic, which interacts with the NSX API client.
    def create_static_route(
        client: NsxClient,
        gateway_id: str,
        route_id: str,
        network: str,
        next_hops: list[dict[str, Any]],
        gateway_type: str = "tier1",
    ) -> dict:
        """Create a static route on a gateway via Policy API (PUT).
    
        Args:
            client: Authenticated NSX API client.
            gateway_id: Gateway identifier (Tier-0 or Tier-1).
            route_id: Unique static route identifier.
            network: Destination CIDR (e.g., "10.0.0.0/8").
            next_hops: List of next-hop dicts, each containing:
                - ip_address (str): Next-hop IP address.
                - admin_distance (int, optional): Admin distance (default 1).
            gateway_type: Either "tier0" or "tier1" (default "tier1").
    
        Returns:
            Created static route dict from NSX API.
        """
        _validate_id(gateway_id)
        _validate_id(route_id)
    
        if not next_hops:
  • MCP tool registration and wrapper function for create_static_route.
    @mcp.tool()
    def create_static_route(
        tier1_id: str,
        route_id: str,
        network: str,
        next_hop: str,
        target: str | None = None,
    ) -> dict:
        """Create a static route on a Tier-1 gateway.
    
        Args:
            tier1_id: The Tier-1 gateway ID.
            route_id: Unique ID for the static route.
            network: Destination CIDR (e.g. "10.0.0.0/8").
            next_hop: Next hop IP address.
            target: Optional NSX Manager target name from config. Uses default if omitted.
        """
        from vmware_nsx.ops.route_mgmt import create_static_route as _create
    
        client = _get_connection(target)
        return _create(client, tier1_id, route_id, network=network, next_hop=next_hop)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zw008/VMware-NSX'

If you have feedback or need assistance with the MCP directory API, please join our Discord server