Giter VIP home page Giter VIP logo

cloud-netconfig's Introduction

cloud-netconfig

cloud-netconfig is a collection of scripts for automatically configuring network interfaces in cloud frameworks. Currently supported are Amazon EC2, Microsoft Azure, and Google Compute Engine. It requires netconfig (package sysconfig-netconfig on openSUSE and SUSE Linux Enterprise distributions).

Installation

If you are installing from source, run as root make install-ec2, make install-azure, or make install-gce depending on your platform. Then reload the udev rules by running udevadm control -R. Afterwards add cloud-netconfig to the variable NETCONFIG__MODULES__ORDER in /etc/sysconfig/network/config and restart networking (systemctl restart wicked.service on SUSE Linux Enterprise Server or openSUSE distributions). On EC2 and Azure you may want to enable the systemd timer too (see below for details on its purpose). To do that, run systemctl enable --now cloud-netconfig.timer.

Mode of Operation

cloud-netconfig handles three different tasks:

  • Set up unconfigured interfaces

For any network interface that does not have an associated configuration file in /etc/sysconfig/network, a DHCP based configuration will be generated and ifup will be called, which triggers interface configuration through wicked.

  • Apply secondary IPv4 addresses

For all interfaces managed by cloud-netconfig, it will look up secondary IPv4 addresses from the framework's metadata server and configure them on the interface. This does not apply to Google Compute Engine, as secondary IPv4 addresses are not assigned directly through the framework.

  • Create routing policies

In case the system has more than one network interface, cloud-netconfig sets up routing in a way that packets are routed through the interface associated with the source address of the packet. To do that, it creates a separate routing table for each interface with a default route according to the interface configration. It also creates a routing policy to use that table for packets using any of the interface's source addresses. This ensures that packets are routed via the correct interface.

Note: DHCP servers of cloud frameworks (this applies to Microsoft Azure at the time of writing) may not include a gateway address in DHCP leases for secondary IPv4 addresses. This is presumably to avoid default routes to clash. To enable full connectivity in this case, cloud-netconfig assumes the gateway host to be the first host of the sub-network assigned to the interface.

Interface configurations will be checked periodically on each DHCP lease renewal and additionally, if the systemd timer is enabled (default on Amazon EC2 and Microsoft Azure SUSE Linux Enterprise Server images), every 60 seconds. cloud-netconfig detects changes in the metadata configuration and updates interface configurations and routing policies accordingly. This means that IP addresses that were removed from the virtual interface configuration will be removed from the interface, but only addresses that were automatically added by cloud-netconfig will be removed. Addresses added manually by the administrator or by another tool (e.g. high-availability software) will not be touched.

Configuration

cloud-netconfig does not require any configuration, but it should be noted that it will not overwrite existing interface configurations. This allows to use specific interface configurations. cloud-netconfig will still set up secondary IP addresses and routing policies. If you do not want that, set the variable CLOUD__NETCONFIG__MANAGE to no in the ifcfg file in /etc/sysconfig/network to disable it for the associated interface. You can also change the default value of CLOUD__NETCONFIG__MANAGE in /etc/default/cloud-netconfig. The default applies to newly created ifcfg files, not for existing ones.

cloud-netconfig's People

Contributors

jgleissner avatar rjschwei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.