关于OpenStack的neutron服务的学习

Posted 人间忽晚,山河以秋

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于OpenStack的neutron服务的学习相关的知识,希望对你有一定的参考价值。

neutron服务的搭建配置

一、使用neutron相关命令查询网络服务的列表信息,并已下图的方式打印出来
在这里插入图片描述

[root@controller ~]# neutron agent-list -c binary -c agent_type -c alive
+---------------------------+--------------------+-------+
| binary                    | agent_type         | alive |
+---------------------------+--------------------+-------+
| neutron-openvswitch-agent | Open vSwitch agent | :-)   |
| neutron-metadata-agent    | Metadata agent     | :-)   |
| neutron-l3-agent          | L3 agent           | :-)   |
| neutron-dhcp-agent        | DHCP agent         | :-)   |
| neutron-metadata-agent    | Metadata agent     | :-)   |
| neutron-lbaas-agent       | Loadbalancer agent | :-)   |
| neutron-openvswitch-agent | Open vSwitch agent | :-)   |
+---------------------------+--------------------+-------+

二、使用neutron相关命令查询网络服务的列表信息中的“binary”一列

[root@controller ~]# neutron agent-list -c binary
+---------------------------+
| binary                    |
+---------------------------+
| neutron-openvswitch-agent |
| neutron-metadata-agent    |
| neutron-l3-agent          |
| neutron-dhcp-agent        |
| neutron-metadata-agent    |
| neutron-lbaas-agent       |
| neutron-openvswitch-agent |
+---------------------------+

三、使用neutron相关命令查询网络服务DHCP agent 的详细信息

[root@controller ~]# neutron agent-list -c binary -c id
+---------------------------+--------------------------------------+
| binary                    | id                                   |
+---------------------------+--------------------------------------+
| neutron-openvswitch-agent | 020ac5f8-ff1f-4fd7-9a6d-94a81435b67d |
| neutron-metadata-agent    | 314d133c-1580-45dd-8dc6-c9428ec2cecf |
| neutron-l3-agent          | 3dc1dfd1-e1db-4c37-bccf-1df26ff993e7 |
| neutron-dhcp-agent        | 507dc1ad-94de-4feb-95c1-a1fd1ba5f9c8 |
| neutron-metadata-agent    | bfbe5b2a-7dd2-4e45-b79d-ceee3ab02881 |
| neutron-lbaas-agent       | dee66fd4-6c39-4fb9-af2b-93b6f785ea60 |
| neutron-openvswitch-agent | e7e3093d-83fd-4250-8d1f-4e73be57c07b |
+---------------------------+--------------------------------------+
[root@controller ~]# neutron agent-show  507dc1ad-94de-4feb-95c1-a1fd1ba5f9c8 
+---------------------+----------------------------------------------------------+
| Field               | Value                                                    |
+---------------------+----------------------------------------------------------+
| admin_state_up      | True                                                     |
| agent_type          | DHCP agent                                               |
| alive               | True                                                     |
| availability_zone   | nova                                                     |
| binary              | neutron-dhcp-agent                                       |
| configurations      | {                                                        |
|                     |      "subnets": 3,                                       |
|                     |      "dhcp_lease_duration": 86400,                       |
|                     |      "dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq",  |
|                     |      "networks": 3,                                      |
|                     |      "log_agent_heartbeats": false,                      |
|                     |      "ports": 8                                          |
|                     | }                                                        |
| created_at          | 2019-12-11 20:52:13                                      |
| description         |                                                          |
| heartbeat_timestamp | 2019-12-14 16:21:55                                      |
| host                | controller                                               |
| id                  | 507dc1ad-94de-4feb-95c1-a1fd1ba5f9c8                     |
| started_at          | 2019-12-11 20:52:13                                      |
| topic               | dhcp_agent                                               |
+---------------------+----------------------------------------------------------+

四、使用ovs-vswitchd管理工具的相关命令查询计算节点的网桥列表信息

[root@controller ~]# ovs-vsctl list-br
br-ex
br-int
br-tun

五、使用ovs-vswitchd管理工具的相关命令查询控制节点的网桥br-ex的端口列表信息

[root@controller ~]# ovs-vsctl list-ports br-ex
enp8s0
phy-br-ex
qg-77358d4d-5e

五、创建云主机外部网络 ext-net,子网为 ext-subnet,云主机浮动 IP 可用网段为 192.168.200.100 ~ 192.168.200.200,网关为 192.168.200.1。创建云主机内部网络 int-net1,子网为 int-subnet1,云主机子网 IP 可用网段为 10.0.0.100 ~ 10.0.0.200,网关为 10.0.0.1;创建云主机内部网络 int-net2,子网为 int-subnet2,云主机子网 IP 可用网段为 10.0.1.100 ~ 10.0.1.200,网关为 10.0.1.1。添加名为 ext-router 的路由器,添加网关在 ext-net 网络,添加内部端口到 int-net1 网络,完成内部网络 int-net1 和外部网络的连通。

六、使用 neutron 相关命令查询所创建路由器的详细信息

[root@controller ~]# neutron router-show ext-route
+-------------------------+-------------------------------------------------------------------------------------------------+
| Field                   | Value                                                                                           |
+-------------------------+-------------------------------------------------------------------------------------------------+
| admin_state_up          | True                                                                                            |
| availability_zone_hints |                                                                                                 |
| availability_zones      | nova                                                                                            |
| description             |                                                                                                 |
| distributed             | False                                                                                           |
| external_gateway_info   | {"network_id": "33cd595e-cc06-4a28-b7ca-12cc2543c6f0", "enable_snat": true,                     |
|                         | "external_fixed_ips": [{"subnet_id": "60a96b85-5125-4e65-a954-c8847f78b10a", "ip_address":      |
|                         | "192.168.200.101"}]}                                                                            |
| ha                      | False                                                                                           |
| id                      | a9f08d30-aa3c-4e5f-abce-351cf90430ce                                                            |
| name                    | ext-route                                                                                       |
| routes                  |                                                                                                 |
| status                  | ACTIVE                                                                                          |
| tenant_id               | 5cb6243755824171b7e0873b18847545                                                                |
+-------------------------+-------------------------------------------------------------------------------------------------+
[root@controller ~]# 

七、使用 neutron 相关命令查询所创建子网的列表信息,并查看内网子网的详细信息

[root@controller ~]# neutron subnet-list
+--------------------------------------+-------------+------------------+---------------------------------------------+
| id                                   | name        | cidr             | allocation_pools                            |
+--------------------------------------+-------------+------------------+---------------------------------------------+
| 60a96b85-5125-4e65-a954-c8847f78b10a | ext-subnet  | 192.168.200.0/24 | {"start": "192.168.200.100", "end":         |
|                                      |             |                  | "192.168.200.200"}                          |
| 222e0a6f-781a-4f79-b401-e64e95a980af | int-subnet1 | 10.10.10.0/24    | {"start": "10.10.10.100", "end":            |
|                                      |             |                  | "10.10.10.200"}                             |
| 35414dcc-11ca-4845-8545-4d391ab420e6 | int-subnet2 | 10.10.20.0/24    | {"start": "10.10.20.100", "end":            |
|                                      |             |                  | "10.10.20.200"}                             |
+--------------------------------------+-------------+------------------+---------------------------------------------+
[root@controller ~]# neutron subnet-show 222e0a6f-781a-4f79-b401-e64e95a980af
+-------------------+--------------------------------------------------+
| Field             | Value                                            |
+-------------------+--------------------------------------------------+
| allocation_pools  | {"start": "10.10.10.100", "end": "10.10.10.200"} |
| cidr              | 10.10.10.0/24                                    |
| created_at        | 2019-12-11T22:48:12                              |
| description       |                                                  |
| dns_nameservers   |                                                  |
| enable_dhcp       | True                                             |
| gateway_ip        | 10.10.10.1                                       |
| host_routes       |                                                  |
| id                | 222e0a6f-781a-4f79-b401-e64e95a980af             |
| ip_version        | 4                                                |
| ipv6_address_mode |                                                  |
| ipv6_ra_mode      |                                                  |
| name              | int-subnet1                                      |
| network_id        | 706ba0d7-d01c-4121-b7aa-cbd711358631             |
| subnetpool_id     |                                                  |
| tenant_id         | 5cb6243755824171b7e0873b18847545                 |
| updated_at        | 2019-12-11T22:48:12                              |
+-------------------+--------------------------------------------------+

八、使用 neutron 相关命令查询所创建网络的列表信息

[root@controller ~]# neutron net-list
+--------------------------------------+----------+-------------------------------------------------------+
| id                                   | name     | subnets                                               |
+--------------------------------------+----------+-------------------------------------------------------+
| 33cd595e-cc06-4a28-b7ca-12cc2543c6f0 | ext-net  | 60a96b85-5125-4e65-a954-c8847f78b10a 192.168.200.0/24 |
| 706ba0d7-d01c-4121-b7aa-cbd711358631 | int-net1 | 222e0a6f-781a-4f79-b401-e64e95a980af 10.10.10.0/24    |
| 8866f180-b5bc-4682-b75b-eb5cfa9d62de | int-net2 | 35414dcc-11ca-4845-8545-4d391ab420e6 10.10.20.0/24    |
+--------------------------------------+----------+-------------------------------------------------------+

以上是关于关于OpenStack的neutron服务的学习的主要内容,如果未能解决你的问题,请参考以下文章

Openstack Neutron学习手册

Neutron学习笔记

理解 Neutron FWaaS - 每天5分钟玩转 OpenStack(117)

理解 Neutron FWaaS - 每天5分钟玩转 OpenStack(117)

OpenStack —— 网络服务Neutron

Openstack 网络服务Neutron [五]