63.10. 子网集


设置子网属性

使用方法:

openstack subnet set [-h] [--name <name>] [--dhcp | --no-dhcp]
                            [--gateway <gateway>]
                            [--description <description>] [--tag <tag>]
                            [--no-tag]
                            [--allocation-pool start=<ip-address>,end=<ip-address>]
                            [--no-allocation-pool]
                            [--dns-nameserver <dns-nameserver>]
                            [--no-dns-nameservers]
                            [--host-route destination=<subnet>,gateway=<ip-address>]
                            [--no-host-route] [--service-type <service-type>]
                            <subnet>
Copy to Clipboard Toggle word wrap

Expand
表 63.37. 位置参数
概述

<subnet>

要修改的子网(名称或 ID)

Expand
表 63.38. 可选参数
概述

--no-allocation-pool

从子网清除关联的分配池。指定 --allocation-pool 和 --no-allocation- 池来覆盖当前的分配池信息。

--no-dhcp

禁用 dhcp

--dhcp

启用 dhcp

--allocation-pool start=<ip-address>,end=<ip-address>

此子网的分配池 IP 地址 e.g.: start=192.168.199.2,end=192.168.199.254 (重复选项来添加多个 IP 地址)

--no-tag

清除与子网关联的标签。指定 --tag 和 --no-tag 以覆盖当前标签

--name <name>

更新了子网的名称

--no-host-route

清除子网中的相关 host-routes。指定 --host-route 和 --no-host-route 以覆盖当前的主机路由信息。

--host-route destination=<subnet>,gateway=<ip-address>

此子网的附加路由: destination=10.10.0.0/16、gateway=192.168.71.254 目标:目标子网(在 CIDR 表示法中)网关: nexthop IP 地址(用于添加多个路由)

--dns-nameserver <dns-nameserver>

此子网的 DNS 服务器(重复选项以设置多个 DNS 服务器)

--gateway <gateway>

为子网指定网关。选项为: <ip-address>: Specific IP 地址用作网关,没有 : 这个子网将不会使用网关,例如:--gateway 192.168.9.1, --gateway none

--no-dns-nameservers

清除 dns 名称服务器的现有信息。指定 --dns-nameserver 和 --no-dns-nameserver 以覆盖当前的 DNS 名称服务器信息。

-h, --help

显示帮助信息并退出

--description <description>

设置子网描述

--service-type <service-type>

此子网的服务类型,如 network:floatingip_agent_gateway。必须是网络端口的有效设备所有者值(重复选项来设置多个服务类型)

--tag <tag>

要添加到子网的标签(重复选项来设置多个标签)

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat