Attaching Multiple Network Interfaces and Floating IPs:: 2°³ÀÇ µð¹ÙÀ̽º¿¡ °¢°¢ÀÇ Fixed IP, Floating IP
root@controller:~# nova network-list
+--------------------------------------+----------+------+
| ID | Label | Cidr |
+--------------------------------------+----------+------+
| c360ab81-8504-4138-a183-e6a744b096b1 | ext-net1 | - |
| 83e166bf-74e1-490e-a349-163ef44def6d | net1 | - | ==>> 192.168.2.0/24
| 05fe2655-c9cc-4dec-9b00-aec8d55682f0 | demo-net | - | ==>> 192.168.0.0/24
+--------------------------------------+----------+------+
:: Æ÷Æ®Ãß°¡
¡Ø neutron port-create ${NET_ID}
root@controller:~# neutron port-create 05fe2655-c9cc-4dec-9b00-aec8d55682f0
Created a new port:
+-----------------------+--------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | |
| binding:profile | {} |
| binding:vif_details | {} |
| binding:vif_type | unbound |
| binding:vnic_type | normal |
| device_id | |
| device_owner | |
| fixed_ips | {"subnet_id": "4e87ea4f-9c41-4f50-9671-762b99f4ce45", "ip_address": "192.168.0.129"} |
| id | 552ff426-c19f-40dd-9f1d-45c361c5495e |
| mac_address | fa:16:3e:dc:52:12 |
| name | |
| network_id | 05fe2655-c9cc-4dec-9b00-aec8d55682f0 |
| security_groups | 937a6e71-6d09-4fd1-bd48-d8862fc528f7 |
| status | DOWN |
| tenant_id | 3fdf67182adc4458a36b6dcdc77bce93 |
+-----------------------+--------------------------------------------------------------------------------------+
:: Æ÷Æ® ¿¬°á
¡Ø nova interface-attach --port-id ${PORT_ID} ${INSTANCE_ID}
root@controller:~# nova interface-attach --port-id 552ff426-c19f-40dd-9f1d-45c361c5495e
621220f5-f737-423f-9c9d-b6812cf4ea12
:: È®ÀÎ
root@controller:~# nova show f63f5024-fbd6-431b-bb06-5297c5cc5ced |grep network
| demo-net network | 192.168.0.128, 192.168.0.129, 115.XX.XXX.168
root@controller:~# neutron floatingip-list
¡Ø neutron floatingip-associate ${FloatingIP_ID} ${PORT_ID}
root@controller:~# neutron floatingip-associate 85c8a731-8005-4e34-a4e7-ea0c4e8c73a8 552ff426-c19f-40dd-9f1d-45c361c5495e
Associated floating IP 85c8a731-8005-4e34-a4e7-ea0c4e8c73a8
root@controller:~# neutron floatingip-list
ÀνºÅϽº³»¿¡¼ IP Á¤º¸ ÀÔ·Â
[root@vm1 ~]# ifconfig |grep eth
eth0 Link encap:Ethernet HWaddr FA:16:3E:12:D9:66
[root@vm1 ~]# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1454 qdisc pfifo_fast state UP qlen 1000
link/ether fa:16:3e:12:d9:66 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether fa:16:3e:dc:52:12 brd ff:ff:ff:ff:ff:ff
[root@vm1 ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
[root@vm1 ~]# sed -i 's/eth0/eth1/g' /etc/sysconfig/network-scripts/ifcfg-eth1
[root@vm1 ~]# /etc/init.d/network restart