SUSE Linux Enterprise Server recently had support for multiple network interfaces added in Amazon EC2 and Microsoft Azure. Having more than one interface in an instance can be useful for example if you want the instance to be in multiple subnets. The package cloud-netconfig available from the SUSE Linux Enterprise Public Cloud Module contains scripts to automatically configure and set up those interfaces.
What cloud-netconfig does
For any network interface detected that does not have a configuration file yet, cloud-netconfig generates a standard DHCP configuration and brings up the interface. It also has support for configuring secondary IPv4 addresses on your network interfaces. Secondary IPv4 addresses are additional IP addresses that can be configured in the public cloud framework for virtual network interfaces, but they are not delivered via DHCP. If you have assigned more than one IPv4 address to any of the network interfaces in the public cloud framework, cloud-netconfig will fetch them from the metadata server after the interface was brought up and assign them to the interface. The configuration is checked on each DHCP lease renewal, which means changes to the IP configuration in the public cloud framework will be picked up automatically in the instance after a while without any need for manual intervention. Secondary IPv6 addresses, where supported, are delivered by DHCP, so above approach is not needed for IPv6.
For any secondary interfaces configured by cloud-netconfig, it creates routing policies to ensure outgoing packets are routed via the correct interface.
Installing cloud-netconfig on existing instances
Current SUSE Linux Enterprise Server 12 SP3 images already have cloud-netconfig installed and hence support multiple network interfaces out of the box. For older instances, i.e. ones that do not have package cloud-netconfig-ec2 or cloud-netconfig-azure installed, including SUSE Linux Enterprise Server 11 instances, the following steps are required (all to be executed as root):
Install cloud-netconfig package matching your framework:
zypper in cloud-netconfig-ec2
zypper in cloud-netconfig-azure
Make sure you have package curl installed, as some images do not have it preinstalled but it is required for cloud-netconfig to function properly.
Add cloud-netconfig to NETCONFIG_MODULES_ORDER in /etc/sysconfig/network/config so it looks like this:
NETCONFIG_MODULES_ORDER="cloud-netconfig dns-resolver dns-bind dns-dnsmasq nis ntp-runtime"
Add the following line to /etc/sysconfig/network/ifcfg-eth0:
Remove old persistent interface name rules, if any, and reload udev rules:
rm -f /etc/udev/rules.d/70-persistent-net.rules udevadm control -R
On SUSE Linux Enterprise Server 12 restart wickedd:
systemctl restart wickedd.service
Your system should handle multiple network interfaces and secondary IP address nicely from this point. If the system had unconfigured secondary network interfaces already when you installed and set up cloud-netconfig, you can activate them by running udevadm like this:
udevadm trigger --subsystem-match=net -c add -y eth1
Repeat for any additional interface you might have. You may have odd interfaces names like rename3, at least in Amazon EC2. You can detach and reattach the interface in the AWS console, which should fix the name and configure your interface properly. Rebooting will work too, of course.