Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ioc_start.py: allow setting IP address on lo0 #48

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

Defenso-QTH
Copy link
Contributor

Please merge #47 first.


Currently, iocage ignores IP addresses given for the loopback interface
lo0 that exists by default in a VNET jail. Adding addresses to that
interface can be useful, for instance to implement rfc7404 addressing
where link-local addresses are used for interconnections, and routable
addresses are set on loopback interfaces.

This commit enables setting additional addresses on the lo0 interface
using the usual ip4_addr or ip6_addr settings.
For instance: ip4_addr='lo0|192.168.2.10'

Closes #46

Iocage currently expects interfaces to be specified in the nic:bridge
format, where bridge cannot be none. This results in iocage always
creating a bridge to which VNET jail epair interfaces are added as
members.

In a scenario where the user wants jails to be isolated on the data-link
layer (OSI layer 2 / Ethernet) and use the host as a router, this bridge
is unnecessery. It can also result in illegitimate cross-jail traffic
being allowed, since pf filtering on bridge interfaces is disabled by
default on FreeBSD systems (net.link.bridge.pfil_bridge=0).

Closes freebsd#44
Currently, iocage ignores IP addresses given for the loopback interface
lo0 that exists by default in a VNET jail. Adding addresses to that
interface can be useful, for instance to implement rfc7404 addressing
where link-local addresses are used for interconnections, and routable
addresses are set on loopback interfaces.

This commit enables setting additional addresses on the lo0 interface
using the usual ip4_addr or ip6_addr settings.
For instance: ip4_addr='lo0|192.168.2.10'

Closes freebsd#46
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11916048528

Details

  • 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 7.738%

Changes Missing Coverage Covered Lines Changed/Added Lines %
iocage_lib/ioc_start.py 0 5 0.0%
Totals Coverage Status
Change from base Build 11334365279: -0.002%
Covered Lines: 798
Relevant Lines: 7803

💛 - Coveralls

1 similar comment
@coveralls
Copy link

coveralls commented Nov 19, 2024

Pull Request Test Coverage Report for Build 11916048528

Details

  • 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 7.738%

Changes Missing Coverage Covered Lines Changed/Added Lines %
iocage_lib/ioc_start.py 0 5 0.0%
Totals Coverage Status
Change from base Build 11334365279: -0.002%
Covered Lines: 798
Relevant Lines: 7803

💛 - Coveralls

@dgeo dgeo self-assigned this Nov 26, 2024
@dgeo dgeo added this to the 1.9 milestone Nov 26, 2024
@dgeo dgeo added the enhancement New feature or request label Nov 26, 2024
@Defenso-QTH
Copy link
Contributor Author

Would you like me to rebase this?

@dgeo
Copy link
Contributor

dgeo commented Nov 27, 2024

It should merge flawlessly

@dgeo dgeo merged commit 0703fb5 into freebsd:master Nov 27, 2024
@dgeo
Copy link
Contributor

dgeo commented Nov 27, 2024

Thank you once again !

@Defenso-QTH Defenso-QTH deleted the loopback-ip-PR branch November 27, 2024 22:21
dgeo added a commit to criecm/iocage that referenced this pull request Nov 29, 2024
* ioc_start.py: allow 'none' bridge in interfaces

Iocage currently expects interfaces to be specified in the nic:bridge
format, where bridge cannot be none. This results in iocage always
creating a bridge to which VNET jail epair interfaces are added as
members.

In a scenario where the user wants jails to be isolated on the data-link
layer (OSI layer 2 / Ethernet) and use the host as a router, this bridge
is unnecessery. It can also result in illegitimate cross-jail traffic
being allowed, since pf filtering on bridge interfaces is disabled by
default on FreeBSD systems (net.link.bridge.pfil_bridge=0).

Closes freebsd#44

* ioc_start.py: allow setting IP address on lo0

Currently, iocage ignores IP addresses given for the loopback interface
lo0 that exists by default in a VNET jail. Adding addresses to that
interface can be useful, for instance to implement rfc7404 addressing
where link-local addresses are used for interconnections, and routable
addresses are set on loopback interfaces.

This commit enables setting additional addresses on the lo0 interface
using the usual ip4_addr or ip6_addr settings.
For instance: ip4_addr='lo0|192.168.2.10'

Closes freebsd#46

---------

Co-authored-by: dgeo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot assign an IP to localhost interface of VNET jail
3 participants