openstack网络管理命令
1、获取网络列表
[root@cc ~(keystone_admin)]# neutron net-list
+--------------------------------------+----------+-----------------------------------------------------+
| id | name | subnets |
+--------------------------------------+----------+-----------------------------------------------------+
| afde2904--44b9-a3a2-f23b0b68a60b | flat | abb07ddd-110d-408d--e0fc0d640b63 172.16.80.0/ |
| 1d7ede32-66aa-41c0-bec0-1b93a5741e46 | vlan1681 | 1c06ea64-5d1f-49ec-804e-97d44974c583 172.16.81.0/ |
+--------------------------------------+----------+-----------------------------------------------------+
2、查看某个网络的信息
[root@cc ~(keystone_admin)]# neutron net-show afde2904--44b9-a3a2-f23b0b68a60b
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | afde2904--44b9-a3a2-f23b0b68a60b |
| name | flat |
| provider | False |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | abb07ddd-110d-408d--e0fc0d640b63 |
| tenant_id | cbeb053466384fd4a3eaa4fced6e307a |
+---------------------------+--------------------------------------+
3、创建公网
[root@station140 ~(network_admin)]# neutron net-create --router:external=true pub1
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | aebe75f0--4a5e-bbd9-cb81e1f017bc |
| name | pub1 |
| provider:network_type | local |
| provider:physical_network | |
| provider:segmentation_id | |
| router:external | True |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | e3a71a59840c4e88b8740b789c3afb9c |
+---------------------------+--------------------------------------+
注: 参数 --router:external=true 表示创建的是公网网络
4、创建私有网络,指定tenant
[root@cc07 ~]# neutron net-create hzb-privnet1 --tenant-id=26a8e1feb372493d831c19d4d9e28d73
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | --25T06:: |
| description | |
| id | 2193270e-c4c9-469c-99ae-87ebdb4ba535 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | |
| name | hzb-privnet1 |
| port_security_enabled | True |
| provider | False |
| provider:network_type | vlan |
| provider:physical_network | physnet1 |
| provider:segmentation_id | |
| qos_policy_id | |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | 26a8e1feb372493d831c19d4d9e28d73 |
| updated_at | --25T06:: |
+---------------------------+--------------------------------------+
5、创建hzb-privnet1的子网
[root@cc07 ~]# neutron subnet-create --name hzb-sub-net1 --allocation-pool start=10.30.0.50,end=10.30.0.100 --no-gateway --ip-version hzb-privnet1 10.30.0.0/
Created a new subnet:
+-------------------+-----------------------------------------------+
| Field | Value |
+-------------------+-----------------------------------------------+
| allocation_pools | {"start": "10.30.0.50", "end": "10.30.0.100"} |
| cidr | 10.30.0.0/ |
| created_at | --25T06:: |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | |
| host_routes | |
| id | 0ba19972-c2f6-4cbb-80f6-a642a2f698a8 |
| ip_version | |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | hzb-sub-net1 |
| network_id | 2193270e-c4c9-469c-99ae-87ebdb4ba535 |
| subnetpool_id | |
| tenant_id | ff2958aa964541679833ddbcc503c5d2 |
| updated_at | --25T06:: |
+-------------------+-----------------------------------------------+
6、列出网络hzb-privnet1的子网
[root@cc07 ~]# neutron subnet-list --network_id=2193270e-c4c9-469c-99ae-87ebdb4ba535
+--------------------------------------+--------------+--------------+-----------------------------------------------+
| id | name | cidr | allocation_pools |
+--------------------------------------+--------------+--------------+-----------------------------------------------+
| 0ba19972-c2f6-4cbb-80f6-a642a2f698a8 | hzb-sub-net1 | 10.30.0.0/ | {"start": "10.30.0.50", "end": "10.30.0.100"} |
+--------------------------------------+--------------+--------------+-----------------------------------------------+
7、查看某一子网的详情
[root@cc07 ~]# neutron subnet-show 0ba19972-c2f6-4cbb-80f6-a642a2f698a8
+-------------------+-----------------------------------------------+
| Field | Value |
+-------------------+-----------------------------------------------+
| allocation_pools | {"start": "10.30.0.50", "end": "10.30.0.100"} |
| cidr | 10.30.0.0/ |
| created_at | --25T06:: |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | |
| host_routes | |
| id | 0ba19972-c2f6-4cbb-80f6-a642a2f698a8 |
| ip_version | |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | hzb-sub-net1 |
| network_id | 2193270e-c4c9-469c-99ae-87ebdb4ba535 |
| subnetpool_id | |
| tenant_id | ff2958aa964541679833ddbcc503c5d2 |
| updated_at | --25T06:: |
+-------------------+-----------------------------------------------+
8、更新子网
[root@cc07 ~]# neutron subnet-update 0ba19972-c2f6-4cbb-80f6-a642a2f698a8 --dns-nameserver 8.8.8.8 --allocation-pool start=10.30.0.60,end=10.30.0.90
Updated subnet: 0ba19972-c2f6-4cbb-80f6-a642a2f698a8
[root@cc07 ~]# neutron subnet-show 0ba19972-c2f6-4cbb-80f6-a642a2f698a8
+-------------------+----------------------------------------------+
| Field | Value |
+-------------------+----------------------------------------------+
| allocation_pools | {"start": "10.30.0.60", "end": "10.30.0.90"} |
| cidr | 10.30.0.0/ |
| created_at | --25T06:: |
| description | |
| dns_nameservers | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | |
| host_routes | |
| id | 0ba19972-c2f6-4cbb-80f6-a642a2f698a8 |
| ip_version | |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | hzb-sub-net1 |
| network_id | 2193270e-c4c9-469c-99ae-87ebdb4ba535 |
| subnetpool_id | |
| tenant_id | ff2958aa964541679833ddbcc503c5d2 |
| updated_at | --25T06:: |
+-------------------+----------------------------------------------+
9、删除子网
neutron subnet-delete hzb-sub-net1
10、清理被占用的子网,比如要清理掉74网段的
[root@cc25 ~]# neutron port-list |grep .
| -c27c-4adc-a9b0-28b0b225574f | | fa::3e:cc:: | {"subnet_id": "fde62b7a-a313-49ae-95ba-02f1ad491c9d", "ip_address": "192.168.50.39"} |
| 1929b1ad-14c2-45e7-a56c-97405aa0fd97 | | fa::3e::: | {"subnet_id": "648eaf18-7033-4401-9ce2-bea42d98c94a", "ip_address": "172.16.74.141"} |
| 2a385f13-80a5--91a8-1d776016b3b7 | | fa::3e::df: | {"subnet_id": "a37ce888-abb1-42d5-88ed-06e6fbacfb91", "ip_address": "172.16.74.150"} |
| 32f830cc-9d1f-4f02-b4d0-cd397b18cd9f | | fa::3e::cf:6b | {"subnet_id": "a37ce888-abb1-42d5-88ed-06e6fbacfb91", "ip_address": "172.16.74.146"} |
| 3a36f5fe-77f7-481c-ac55-2b51c3d606ef | | fa::3e:ea::ef | {"subnet_id": "a37ce888-abb1-42d5-88ed-06e6fbacfb91", "ip_address": "172.16.74.151"} |
| 4500b42e-c43f-4c28-a8f3-81ee8ea3cf01 | | fa::3e:7c::d8 | {"subnet_id": "a37ce888-abb1-42d5-88ed-06e6fbacfb91", "ip_address": "172.16.74.147"} |
| 544943a6-132e-41e4-b56b-b3295e774cce | | fa::3e::2a:f9 | {"subnet_id": "861fe053-5619-4350-8a5f-9f189be669fc", "ip_address": "10.10.10.12"} |
| 63b1053a-9f02-4d02-95f0-dd6ab7bb913b | | fa::3e:8a:: | {"subnet_id": "648eaf18-7033-4401-9ce2-bea42d98c94a", "ip_address": "172.16.74.142"} |
| 6fc468f5-2f4d--ae9f-dddfae12aba1 | | fa::3e::c1:f7 | {"subnet_id": "a37ce888-abb1-42d5-88ed-06e6fbacfb91", "ip_address": "172.16.74.152"} |
| 888dc43c--4a73-a92d-76745b171c9f | | fa::3e:ff:ec:7d | {"subnet_id": "fde62b7a-a313-49ae-95ba-02f1ad491c9d", "ip_address": "192.168.50.33"} |
| 9a6302d7-765a-4e8c-8ff4-2d220314116d | | fa::3e:ed:be:e5 | {"subnet_id": "a37ce888-abb1-42d5-88ed-06e6fbacfb91", "ip_address": "172.16.74.149"} |
| a8a70f01-a430---ccb2d5e78b95 | | fa::3e:::1a | {"subnet_id": "861fe053-5619-4350-8a5f-9f189be669fc", "ip_address": "10.10.10.7"} |
| abc3b68f-dea7-427e-8b99-bb9ef6df6f11 | | fa::3e:bb::ce | {"subnet_id": "582523a3-5740-4150-a377-140d6cc2d261", "ip_address": "11.11.11.1"} |
| ca4c163b-dd8c-4a3a-9b75-0db8b92ee26b | | fa::3e::: | {"subnet_id": "a37ce888-abb1-42d5-88ed-06e6fbacfb91", "ip_address": "172.16.74.145"} |
| d594a69e-cf61-4b99-ac2e-19cb71b22c7d | | fa::3e::: | {"subnet_id": "648eaf18-7033-4401-9ce2-bea42d98c94a", "ip_address": "172.16.74.140"} |
| dbe3b20a-f69a--8c2c-8a63ea849a71 | | fa::3e:c7::8f | {"subnet_id": "582523a3-5740-4150-a377-140d6cc2d261", "ip_address": "11.11.11.3"} |
| e5df42b1-cd52-41e6-9df2-c7d8739e3547 | | fa::3e:b2:4d:5b | {"subnet_id": "a37ce888-abb1-42d5-88ed-06e6fbacfb91", "ip_address": "172.16.74.148"} |
| f1523f4e-a8b3-42df-867a-72a2505e51d1 | | fa::3e:c0:a6:9d | {"subnet_id": "648eaf18-7033-4401-9ce2-bea42d98c94a", "ip_address": "172.16.74.145"} |
| fbdc7f8f-9c3c-4b93-a251-4a841c11cbbd | | fa::3e:ff::d7 | {"subnet_id": "648eaf18-7033-4401-9ce2-bea42d98c94a", "ip_address": "172.16.74.146"} |
执行:
neutron port-delete cb5ed928-015a--b78f-816c91191b56
11、列出浮动IP池(也就是外部网络)
(nova-api)[root@cc07 nova]# nova floating-ip-pool-list
+-----------+
| name |
+-----------+
| hzb-pub1 |
| vlan_1612 |
+-----------+
12、创建浮动IP
(nova-api)[root@cc07 nova]# nova floating-ip-create vlan_1612
+--------------------------------------+---------------+-----------+----------+-----------+
| Id | IP | Server Id | Fixed IP | Pool |
+--------------------------------------+---------------+-----------+----------+-----------+
| 37c2c8b1-92ec--b83f-198977e4554c | 172.16.12.234 | - | - | vlan_1612 |
+--------------------------------------+---------------+-----------+----------+-----------+
(nova-api)[root@cc07 nova]# nova floating-ip-list
+--------------------------------------+---------------+-----------+----------+-----------+
| Id | IP | Server Id | Fixed IP | Pool |
+--------------------------------------+---------------+-----------+----------+-----------+
| 37c2c8b1-92ec--b83f-198977e4554c | 172.16.12.234 | - | - | vlan_1612 |
| 7bb93e28-bf36--aebf-94fafa27d5fa | 172.16.12.219 | - | - | vlan_1612 |
| bc258041-139e--98c1-a6ba7960ad59 | 172.16.12.218 | - | - | vlan_1612 |
+--------------------------------------+---------------+-----------+----------+-----------+
需要指定浮动ip池
13、删除浮动ip
nova floating-ip-delete <address>
(nova-api)[root@cc07 nova]# nova floating-ip-delete 172.16.12.234
(nova-api)[root@cc07 nova]# nova floating-ip-list
+--------------------------------------+---------------+-----------+----------+-----------+
| Id | IP | Server Id | Fixed IP | Pool |
+--------------------------------------+---------------+-----------+----------+-----------+
| 7bb93e28-bf36--aebf-94fafa27d5fa | 172.16.12.219 | - | - | vlan_1612 |
| bc258041-139e--98c1-a6ba7960ad59 | 172.16.12.218 | - | - | vlan_1612 |
+--------------------------------------+---------------+-----------+----------+-----------+
openstack网络管理命令的更多相关文章
- Nmcli 网络管理命令行工具基础
介绍 在本教程中,我们会在CentOS / RHEL 7中讨论网络管理命令行工具NetworkManager command line tool,也叫nmcli.那些使用ifconfig的用户应该在C ...
- Linux网络管理命令
Linux网络管理命令 ifconfig 用于配置网卡ip地址信息等网络参数或显示网络接口状态,类似于windows的ipconfig命令. 可以用这个工具来临时性的配置网卡的IP地址.掩码.广播地址 ...
- centos常用网络管理命令
网卡配置命令:ifconfig (ip addr , ip link) ifconfig:显示所有活动状态的相关信息 ifconfig Interface:仅显示指定接口的相关信息 ifc ...
- openstack查看命令的restful调用形式
[root@cc10 fast-pulsar2]# [root@cc10 fast-pulsar2]# cinder --debug type-create hzb DEBUG:keystonecli ...
- 网络管理命令list
网络管理 axel 多线程下载工具 tcpreplay 将PCAP包重新发送,用于性能或者功能测试 hping3 测试网络及主机的安全 ssh-copy-id 把本地的ssh公钥文件安装到远程主机对应 ...
- openstack kilo 命令行
把下面内容放到.bashrc中,或者直接执行也行. export OS_USERNAME=adminexport OS_PASSWORD=admin #根据实际密码来设 ...
- openstack keystone 命令详细
命令使用之前需要 运行命令行“. admin-openrc” 用户(User) 查看用户列表 openstack user list 创建用户 openstack user create [-h] ...
- linux网络管理命令"ip"用法
Linux的ip命令和ifconfig类似,但前者功能更强大,并旨在取代后者.使用ip命令,只需一个命令,你就能很轻松地执行一些网络管理任务. ip help命令: 显示ip相关命令的帮助: # i ...
- Linux用户管理 权限管理 内存管理 网络管理命令 (第四天)
默认添加的用户会自动加入和用户名一样的组中su 切换用户查看当前登陆的用户: whoami id`查看当前用户属于哪个组:groupsgroupadd 组名 添加组groupdel 组名 删除组gre ...
随机推荐
- HTML表单 在提交之前 验证表单数字合法性
function checkform(){ if(!isNumeric($('.apply_money').val())){ alert("必须是数字"); return fals ...
- centos alias命令详解
Alias命令 功能描述:我们在进行系统的管理工作一定会有一些我们经常固定使用,但又很长的命令.那我们可以给这些这一长串的命令起一个别名.之后还需要这一长串命令时就可以直接以别名来替代了.系统中已经有 ...
- 【c#】设置Socket连接、接收超时(转)
用到Socket,发现如果连接错误,比如Connect的端口不对,会造成很长时间的延时,程序就僵在那里,效果很不好: 在网上找到很方便的设置办法,分享如下: Socket.SetSocketOptio ...
- 显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
很多朋友的php程序当php的版本升级到5.3以后,会出现”Deprecated: Assigning the return value of new by reference is deprecat ...
- POJ1236学校网络——tarjan
题目:http://poj.org/problem?id=1236 Tarjan+缩点.温习一下Tarjan的写法. 1.在缩点后的TAG中,有几个联通块等价于有几个入度为0的点! 2.把它们都联通相 ...
- hdu1 247 Hat’s Words(字典树)
Hat’s Words Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total ...
- buffer cache —— buffer busy waits/read by other session
oracle提供非常精确.有效的row level lock机制,多个用户同时修改数据时,为了保护数据,以块为单位挂起锁的情况不会发生.但这不太正确.以块为单位的锁虽然不存在,但正因为oracle I ...
- yyblog2.0 数据库开发规范
一.基础规范 (1)必须使用InnoDB存储引擎 解读:支持事务.行级锁.并发性能更好.CPU及内存缓存页优化使得资源利用率更高 (2)表字符集默认使用utf8,必要时候使用utf8mb4 解读:1. ...
- python之解析csv
使用csv包 读取信息 csvfile = file('csv_test.csv', 'rb') reader = csv.reader(csvfile) for line in reader: pr ...
- C# 进程(应用程序)间通信
SendMessage用法: 函数功能:该函数将指定的消息发送到一个或多个窗口.此函数为指定的窗口调用窗口程序,直到窗口程序处理完消息再返回.该函数是应用程序和应用程序之间进行消息传递的主要手段之一. ...