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
857 stars 138 forks source link

[BUG] Do not allow host IP to be jail IP #567

Open jpds opened 1 year ago

jpds commented 1 year ago

[MANDATORY] Describe the bug [MANDATORY]

If one accidentally assigns the host IP to a jail and then deletes the jail - the host also loses the IP and connectivity is lost.

I did this by creating the jail with:

# bastille create test 13.1-RELEASE 2001:db8::80/64 ue0
# bastille stop test

..without realizing that ::80 was also the host IPv6 address. It just shouldn't be possible to give the jail a conflicting IP that bastille already knows about.

[MANDATORY] Bastille and FreeBSD version (paste bastille -v && freebsd-version -kru output)

0.9.20220714 freebsd-version -kru

[MANDATORY] How did you install bastille? (port/pkg/git)

pkg

bsdlme commented 1 year ago

I don't think that's a bug because it's a supported feature from jail(2). Maybe bastille could give a warning when adding an existing IP address, though.

yaazkal commented 1 year ago

Definitively not a but, but it lands in the enhancement label

bmac2 commented 1 year ago

Jail supports this natively, so bastille should support it.

@cedwards do we want to make bastille issue a warning if the ip of the jail is the same as the machine ip/???