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

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



三、根目录(环境变量所在目录),执行环境变量
四、执行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
|
[[email protected] ~]# 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"} |
[[email protected] ~]# 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(虚地址)
|
[[email protected] ~]# 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
[[email protected] ~]# 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
|