First, modify the virtual network card configuration in the virtual machine.
cd/ect/sysconfig/network-scripts/
VI Ifcfg-eth0
Change Bootproto=static
CP Ifcfg-eth0 Ifcfg-eth0:1 # Copying a configuration file #
VI ifcfg-eth0:1
Change Device=eth0:1
Change ipaddr= to new IP
Service Network restart
Second, find the network control node
Using neutron agent-list in the control node, locate the Metadata agent node, which is the network control node.
Third, login network control node
Neutron port-update $portID--allowed-address-pairs type=dict list=true ip_address= New IP
Portid can be obtained by:
Neutron Port-list | grep "Legacy IP" search
Other:
Can bind multiple
Neutron port-update ad33c996-b5e9-4c91-8f73-6d14ab3827d6--allowed-address-pairs type=dict list=true ip_address= 10.133.16.242 ip_address=10.133.16.241 ip_address=10.133.16.243
After tying can be viewed according to Port-id
Neutron port-show Portid
Neutron port-show Ad33c996-b5e9-4c91-8f73-6d14ab3827d6
Built-in virtual machine add NIC
Nova Interface-attach--net-id 3e680906-75d7-4d97-aa5f-9466bc1fd811 880E89FD-E2F3-4E67-AC32-7F12267BD6A2
The first string is the network ID, and the second string is the virtual machine ID, which can be found in the portal.
Virtual Machine single NIC set two IP