ansible-role-interfaces icon indicating copy to clipboard operation
ansible-role-interfaces copied to clipboard

Create a manual or non-IP interface?

Open sjwk opened this issue 4 years ago • 3 comments

Is there a recommended way to create an interface with neither static nor DHCP address? In my use case, I want to create a bonded parent interface, which won't have any IP address of its own, but act purely as a parent to multiple VLAN interfaces, which will have their own addresses.

On a [Debian] host that is already set up this way, the parent interface is simply configured as:

iface bond1 inet manual bond-mode 802.3ad bond-slaves enp1s0f2 enp1s0f3

If I set bootproto to static but don't give it any address, the role completes but fails to bring the interface up due to missing address. If I set bootproto to static and set the address to 0.0.0.0 it works (although it's probably not a good config) but the 'Check active bond interface state' handler fails.

Thanks!

sjwk avatar Dec 16 '20 15:12 sjwk

bootproto manual does not seem supported, it should be, i need it for tap0 (i set some routes when i connect to the vpn)

for me adding:

{% if item.bootproto == 'manual' %}
{{ item.allowclass | default('auto') }} {{ item.device }}
iface {{ item.device }} inet manual
{% endif %}

To ethernet_Debian.j2 worked, of course this is just a workaround.

purplesrl avatar Jan 01 '21 09:01 purplesrl

Looking at man interfaces, what you are describing is the 'method' in Debian/Ubuntu. The bootproto terminology I think comes from CentOS/RHEL.

Currently for Debian/Ubuntu we support static or dhcp methods, but others are supported, including manual. Perhaps the simplest option would be to set the method to manual if item.bootproto is static, but no IP address is configured?

markgoddard avatar Jan 04 '21 09:01 markgoddard

Currently for Debian/Ubuntu we support static or dhcp methods, but others are supported, including manual. Perhaps the simplest option would be to set the method to manual if item.bootproto is static, but no IP address is configured?

That sounds like it would work.

sjwk avatar Jan 27 '21 08:01 sjwk