By passing the --nic argument multiple times, it is possible to attach multiple interfaces to an instance. The interfaces within the instance may then be enumerated as eth0, eth1, eth2, and so on, depending on the operating system.
Attaching multiple network interfaces to an instance is referred to as multihoming. When an instance is multihomed, neither Neutron nor the instance itself is aware of which network takes precedence over another. When attached networks and subnets have their own respective gateway addresses set, an instance's routing table can be populated with multiple default routes. This scenario can wreak havoc on the connectivity and routing behavior of an instance. This configuration is useful when connecting instances to multiple networks directly, however, care should be taken to avoid network issues in this type of design.
The following openstack server create command demonstrates the basic procedure of connecting an instance to multiple networks when creating the instance:
openstack server create --flavor FLAVOR --image IMAGE
--nic net-id=NETWORK1
--nic net-id=NETWORK2
--nic net-id=NETWORK3
<SERVER-NAME>
Inside the instance, the first attached NIC corresponds to NETWORK1, the second NIC corresponds to NETWORK2, and so on. For many cloud-ready images, a single interface within the instance is brought online automatically using DHCP. Modification of the network interface file(s) or use of the dhclient command within the instance may be required to activate and configure additional network interfaces once the instance is active.