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

multiple ip adresses can't be configured separately on interfaces without hosts config #306

Closed
ntinti opened this issue Jul 10, 2018 · 1 comment
Assignees

Comments

@ntinti
Copy link

@ntinti ntinti commented Jul 10, 2018

FreeBSD version ( uname -a ): 11.2 Release
CBSD version ( cbsd version ): 11.2.0

Since a few years it is possible on FreeBSD to create dynamic created ip numbers in a jail per interface like
ip4.addr = re0|172.20.20.233/24,re1|10.0.0.1/8;
It would be nice if it can be set in CBSD also.

Also IPV6 should be possible, eg.
ip6.addr = igb0.16|::3;

     ip4.addr
	     In	addition to the	IP addresses that are passed to	the kernel, an
	     interface,	netmask	and additional parameters (as supported	by
	     ifconfig(8)) may also be specified, in the	form
	     ``interface|ip-address/netmask param ...''.  If an	interface is
	     given before the IP address, an alias for the address will	be
	     added to that interface, as it is with the	interface parameter.
	     If	a netmask in either dotted-quad	or CIDR	form is	given after an
	     IP	address, it will be used when adding the IP alias.  If addi-
	     tional parameters are specified then they will also be used when
	     adding the	IP alias.

     ip6.addr
	     In	addition to the	IP addresses that are passed to	the kernel, an
	     interface,	prefix and additional parameters (as supported by
	     ifconfig(8)) may also be specified, in the	form
	     ``interface|ip-address/prefix param ...''.
@olevole olevole self-assigned this Jul 10, 2018
olevole added a commit that referenced this issue Aug 6, 2018
Multiple ip adresses can be configured separately on interfaces without hosts config.
For CBSD correct delimer is "#" instead of usual "|". This is due to two things:
  a) legacy of rcconf.subr and SQLite3 where "|" is delimer for SQL.
     this can be corrected when we refactor rcconf.subr
  b) CBSD already config CARP VHID with "#" as delimer between VHID and IP

TODO:
  - modification for jset/jget
  - extra check for NIC existance
  - inteface=auto can be used in this ip_addr form:  "re0|192.168.0.1,10.0.0.2,re1|172.17.0.2/24"
       where 192.168.0.1 and 172.17.0.2 with fixed NIC, but 10.0.0.2 is not
       In this case we can apply inteface=auto route to determine valid NIC automatically
  - check for CARP integration with new forms - always check for "vhid", not for "#" in ip_addr
  - ..

pointed out: ntinti via Issue #306
olevole added a commit that referenced this issue Sep 12, 2018
working on todo list:
  - modification for jset/jget *DONE*
  - extra check for NIC existance *DONE*

TODO:
  - inteface=auto can be used in this ip_addr form:  "re0|192.168.0.1,10.0.0.2,re1|172.17.0.2/24"
       where 192.168.0.1 and 172.17.0.2 with fixed NIC, but 10.0.0.2 is not
       In this case we can apply inteface=auto route to determine valid NIC automatically
  - check for CARP integration with new forms - always check for "vhid", not for "#" in ip_addr

pointed out: ntinti via Issue #306
olevole added a commit that referenced this issue Sep 16, 2018
e.g  cbsd jset jname=jail1 ip4_addr="re0|10.0.0.3" converted to
     cbsd jset jname=jail1 ip4_addr="re0#10.0.0.3" due to SQLite3 delimer "|"

pointed out: ntinti via Issue #306 ( now everything should work )
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Sep 16, 2018

Now everything should work.

CBSD use SQLite3 where '|' is default delimer. Thus we are forced to convert (and accept by default) records in #ip-addr. But in order for users to feel comfortable, we also allow a record of the |ip-addr form.

Thanks! will be available in the next release

@olevole olevole closed this Sep 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.