debops / ansible-ifupdown

Manage network interface configuration in /etc/network/interfaces
GNU General Public License v3.0
25 stars 14 forks source link

Setting multiple IP addresses in the same interface. Is this possible? #70

Closed lchigami closed 7 years ago

lchigami commented 7 years ago

I'm trying to setup a single interface with multiple IP addresses (IP aliases). Theoretically, the "ip" command is capable of doing this, but I'm unable to perform this using this module and Ansible.

lchigami commented 7 years ago

Sorry, my mistake. I was using the wrong configuration...

drybjed commented 7 years ago

In case anybody else finds this issue, you can do this by specifying multiple IP addresses in the interface configuration:

ifupdown__interfaces:
  'eth0':
    inet: 'static'
    address: [ '192.0.2.1/24', '192.0.2.2/24' ]