|NO.Z.00020|——————————|^^^^ 部署 ^^^^|——|OpenStack&组件.V07|——|OpenStack-network|Network创建外部网络.V03|

一、创建第一个网络
二、配置外部网络(在controller)节点执行后面的命令:创建一个外部网络
### --- 执行admin环境变量脚本

[root@controller ~]# source admin-openrc.sh
### --- 创建网络:创建一个外部浮动网络
~~~     ext-net --shared:ext-net网络
~~~     --router:external:external在配置文件中指定的外部网络类型
~~~     True --provider:physical_network external:物理网络类型
~~~     --provider:network_type flat:flat也就是浮动网络
 
[root@controller ~]# neutron net-create ext-net --shared --router:external True --provider:physical_network external --provider:network_type flat
Created a new network:
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | 128ca157-22e0-4ef1-86af-c326e510ef89 |
| name                      | ext-net                              |
| provider:network_type     | flat                                 |
| provider:physical_network | external                             |
| provider:segmentation_id  |                                      |
| router:external           | True                                 |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tenant_id                 | 7bce6e7e6d724ad188e4f70ad9d51e17     |
+---------------------------+--------------------------------------+
三、创建一个外部网络的子网:公网地址的分配地址
### --- 创建子网:
~~~     这里的公网地址对外提供的子网,在生生产环境中应该是你向供应商那里去申请的。
~~~     此环境没有供应商提供的公网地址,
~~~     在neutron中我们设置了100.100.100.11/24 brd 100.100.100.255,
~~~     假定它为公网地址,通过这个网段的地址链接到虚拟机上是没有问题的

[root@controller ~]# neutron subnet-create ext-net --name ext-subnet \
> --allocation-pool start=100.100.100.12,end=100.100.100.240 \
> --disable-dhcp --gateway 100.100.100.11 100.100.100.0/24
Created a new subnet:
+-------------------+-------------------------------------------------------+
| Field             | Value                                                 |
+-------------------+-------------------------------------------------------+
| allocation_pools  | {"start": "100.100.100.12", "end": "100.100.100.240"} |
| cidr              | 100.100.100.0/24                                      |
| dns_nameservers   |                                                       |
| enable_dhcp       | False                                                 |
| gateway_ip        | 100.100.100.11                                        |
| host_routes       |                                                       |
| id                | d81339e0-4025-454c-b858-0815d2730255                  |
| ip_version        | 4                                                     |
| ipv6_address_mode |                                                       |
| ipv6_ra_mode      |                                                       |
| name              | ext-subnet                                            |
| network_id        | 128ca157-22e0-4ef1-86af-c326e510ef89                  |
| tenant_id         | 7bce6e7e6d724ad188e4f70ad9d51e17                      |
+-------------------+-------------------------------------------------------+
~~~     --name ext-subnet:名称为ext-subnet
~~~     --allocation-pool start=FLOATING_IP_START,end=FLOATING_IP_END:地址从哪开始从哪结束
~~~     --disable-dhcp --gateway EXTERNAL_NETWORK_GATEWAY EXTERNAL_NETWORK_CIDR:指定它的网关及网段,此环境网关指定到外部网卡上,我们没有真实网段

~~~     FLOATING_IP_STAR=起始IP
~~~     FLOATING_IP_END=结束IP
~~~     EXTERNAL_NETWORK_GATEWAY=外部网络网关
~~~     EXTERNAL_NETWORK_CIDR=外部网络网段
~~~     例如,外玩网段为:10.0.0.0/24,浮动地址范围为:10.0.0.100~10.0.0.200;网关为:10.0.0.1
neutron subnet-create ext-net --name ext-subnet \
--allocation-pool start=10.0.0.100,end=10.0.0.200 \
--disable-dhcp gateway 10.0.0.1 10.0.0.0/25

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(119)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示