Neutron中保持DNS域名服务器顺序

在Neutron子网中,DNS域名服务器在创建或更新时被指定优先级。这意味着如果创建具有多个DNS服务器的子网,顺序将被保存,客户将按你在创建子网时创建DNS服务器的顺序接收到DNS服务器。同样的事情也适用于在子网上添加、删除或更新DNS服务器的修改操作。

获取子网详细信息

    openstack-1@stack:~/devstack$ neutron subnet-list
    +--------------------------------------+------+-------------+--------------------------------------------+
    | id                                   | name | cidr        | allocation_pools                           |
    +--------------------------------------+------+-------------+--------------------------------------------+
    | 1a2d261b-b233-3ab9-902e-88576a82afa6 |      | 10.0.0.0/24 | {"start": "10.0.0.2", "end": "10.0.0.254"} |
    +--------------------------------------+------+-------------+--------------------------------------------+

    openstack-1@stack:~/devstack$ neutron subnet-show 1a2d261b-b233-3ab9-902e-88576a82afa6
    +------------------+--------------------------------------------+
    | Field            | Value                                      |
    +------------------+--------------------------------------------+
    | allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
    | cidr             | 10.0.0.0/24                                |
    | dns_nameservers  | 1.1.1.1                                    |
    |                  | 2.2.2.2                                    |
    |                  | 3.3.3.3                                    |
    | enable_dhcp      | True                                       |
    | gateway_ip       | 10.0.0.1                                   |
    | host_routes      |                                            |
    | id               | 1a2d26fb-b733-4ab3-992e-88554a87afa6       |
    | ip_version       | 4                                          |
    | name             |                                            |
    | network_id       | a404518c-800d-2353-9193-57dbb42ac5ee       |
    | tenant_id        | 3868290ab10f417390acbb754160dbb2           |
    +------------------+--------------------------------------------+

更新子网DNS域名服务器

neutron subnet-update 1a2d261b-b233-3ab9-902e-88576a82afa6 \
--dns_nameservers list=true 3.3.3.3 2.2.2.2 1.1.1.1

openstack-1@stack:~/devstack$ neutron subnet-show 1a2d261b-b233-3ab9-902e-88576a82afa6
+------------------+--------------------------------------------+
| Field            | Value                                      |
+------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| cidr             | 10.0.0.0/24                                |
| dns_nameservers  | 3.3.3.3                                    |
|                  | 2.2.2.2                                    |
|                  | 1.1.1.1                                    |
| enable_dhcp      | True                                       |
| gateway_ip       | 10.0.0.1                                   |
| host_routes      |                                            |
| id               | 1a2d26fb-b733-4ab3-992e-88554a87afa6       |
| ip_version       | 4                                          |
| name             |                                            |
| network_id       | a404518c-800d-2353-9193-57dbb42ac5ee       |
| tenant_id        | 3868290ab10f417390acbb754160dbb2           |
+------------------+--------------------------------------------+

如上面的输出所示,更新了DNS域名服务器的顺序。部署到此子网的新虚拟机将按照这个新的优先级顺序接收DNS域名服务器地址。已经存在的部署过的虚拟机不会立即受到neutron子网上DNS域名服务器顺序调整的影响。配置为通过DHCP获取其IP的虚拟机将检测DNS域名服务器顺序的更改,在它们的DHCP租约到期或虚拟机重新启动时。使用静态IP地址配置的现有虚拟机将永远不会检测到DNS域名服务器的顺序更新。

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页