BastilleBSD / bastille

Bastille is an open-source system for automating deployment and management of containerized applications on FreeBSD.
https://bastillebsd.org
BSD 3-Clause "New" or "Revised" License
783 stars 130 forks source link

[ENHANCEMENT] weirdness on nic alias ("no IP address found" and "invalid netmask") #700

Open aimass opened 1 month ago

aimass commented 1 month ago

Hi there!

Aliases are working a little quirky. Not sure if this is a limitation of the jail subsystem itself, or something you can address in Bastille.

If I use CIDR mask notation on the main address alone it works fine, but if I add an alias I get invalid netmask '/22,"[alias].... And if use full mask as in the example below, I get a no IP address found for [base ip]

Example configs to reproduce this:

interface = igb1;
ip4.addr = 10.77.3.10/22
ip4.addr += "10.77.0.100 netmask 0xffffffff broadcast 10.77.0.100 vhid 10 advbase 1 advskew 0 pass yuca";
interface = igb1;
ip4.addr = "10.77.3.10 netmask 0xfffffc00";
ip4.addr += "10.77.0.100 netmask 0xffffffff broadcast 10.77.0.100 vhid 10 advbase 1 advskew 0 pass yuca";

Maybe this is an edge case because I purposely want to limit the CARP IPs to /32, avoiding outbound traffic through them. Or at least that's what I think I'm doing :-D

Nevertheless, things (CARP in my case) seem to work as expected either way, so not sure if these warnings are harmless or potentially some latent bug, or I'm not applying the alias in jail.conf correctly, or my understanding is all wrong here.

-- Alex