vinfra service compute router set
Modify virtual router parameters:
usage: vinfra service compute router set [--name <name>] [--external-gateway <network> | --no-external-gateway] [--fixed-ip <fixed-ip>] [--enable-snat | --disable-snat] [--route <destination=destination, nexthop=nexthop> | --no-route] <router>
--name <name>
- Virtual router name
--external-gateway <network>
- Specify a physical network to be used as the router’s external gateway (name or ID)
--no-external-gateway
- Remove the external gateway from the router
--enable-snat
- Enable source NAT on the external gateway
--disable-snat
- Disable source NAT on the external gateway
--fixed-ip <fixed-ip>
- Desired IP on the external gateway
--route <destination=destination,nexthop=nexthop>
-
A static route for the router. This option can be used multiple times.
destination
: destination subnet range in CIDR notation.nexthop
: next hop IP address from one of the networks that the router is connected to.
--no-route
- Clear routes associated with the router
<router>
- Virtual router name or ID
Example:
# vinfra service compute router set myrouter --disable-snat --external-gateway public +-----------------------+--------------------------------------------------+ | Field | Value | +-----------------------+--------------------------------------------------+ | external_gateway_info | enable_snat: false | | | ip_addresses: | | | - 10.94.129.76 | | | network_id: 720e45bc-4225-49de-9346-26513d8d1262 | | id | b9d8b000-5d06-4768-9f65-2715250cda53 | | name | myrouter | | project_id | 894696133031439f8aaa7e4868dcbd4d | | routes | [] | | status | ACTIVE | +-----------------------+--------------------------------------------------+
This command disables SNAT on the external gateway of the virtual router myrouter
.