openstack 虚地址创建

步骤:

       一、登陆到openstack后台,根据路径 项目->网络→网络, 找到对应网络

               openstack 虚地址创建_第1张图片

    二、进入网络详情界面,创建端口

 openstack 虚地址创建_第2张图片

openstack 虚地址创建_第3张图片

    三、根目录(环境变量所在目录),执行环境变量

[root@controller ~]# source admin-openrc

    四、执行neutron port-list, 找到需配置虚地址机器的网络port-id 

   10.300.0.117/10.300.0.118为需要配置虚地址的机器IP , 53e13274-9589-45bf-8b26-7617848ac54b/10a28179-368b-4e8c-9f71-046d24bb6ec7 为对应网络port-id

[root@controller ~]# neutron port-list|grep 10.300.0.117

neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.

| 53e13274-9589-45bf-8b26-7617848ac54b | kh-v300-117                                     | 2098c535c358495cbcae0564d0d66037 | fa:16:3e:33:17:72 | {"subnet_id""2da3c97e-d6ba-4384-ae18-3d919dc28920""ip_address""10.300.0.117"} |

[root@controller ~]# neutron port-list|grep 10.300.0.118

neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.

| 10a28179-368b-4e8c-9f71-046d24bb6ec7 | kh-v300-118                                     | 2098c535c358495cbcae0564d0d66037 | fa:16:3e:16:d5:bb | {"subnet_id""2da3c97e-d6ba-4384-ae18-3d919dc28920""ip_address""10.300.0.118"} |

 

  五、执行neutron port-update, 增加allow_address_pairs属性

   neutron port-update xxx(port-id) --allowed_address_pairs list=true type=dict ip_address=10.300.0.217(虚地址)

[root@controller ~]# neutron port-update 53e13274-9589-45bf-8b26-7617848ac54b --allowed_address_pairs list=true type=dict ip_address=10.300.0.217                                    

neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.

Updated port: 53e13274-9589-45bf-8b26-7617848ac54b

[root@controller ~]# neutron port-update 10a28179-368b-4e8c-9f71-046d24bb6ec7 --allowed_address_pairs list=true type=dict ip_address=10.300.0.217                                    

neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.

Updated port: 10a28179-368b-4e8c-9f71-046d24bb6ec7

你可能感兴趣的:(openstack)