Nat 185
Includes:
- IPv4, IPv6, A, AAAA, and PTR in the same host record when allocating a host
- Optional CNAME record when allocating a host (passed as a list of alias name, one CNAME record is created for each)
- Support for networks as well as containers in the
oss-params.json
file.
Hosts can be allocated through ipam.new_service_host()
by passing domain name, hostname, and service type (mandatory). Optinally, you can pass either ipv4/ipv6 addresses, ipv4/ipv6 networks, or nothing. Passing nothing is considered default. In that case:
- If the service type has any container specified in the params file, networks have to be allocated before allocating hosts (through
ipam.new_service_networks()
). The mask parameter is used to create the new networks. Containers are filled up in the order that they appear in the params file. - If the service type has any network specified in the params file, those networks are used directly to allocate hosts. Networks are filled up in the order that they appear in the params file.
If you pass addresses or networks, the module will always attempt to use those, but will fail if they don't match the configuration in the params file for the service type (i.e. if you request an address or network that places outside of the configured containers/networks).
Either a non-empty list of networks
or a non-empty list of containers
is required in the params file per service type. Having both is redundant, but in that case containers take precedence. The mask
parameter is irrelevant if the service type uses networks instead of containers.
Example config:
"LO": {
"V4": {"containers": [], "networks": ["10.255.255.32/32", "10.255.255.0/28", "10.255.255.16/28"], "mask": 0},
"V6": {"containers": [], "networks": ["dead:beef::/80", "dead:beef:0:1::/80"], "mask": 0},
"domain_name": ".gso"
},
"TRUNK": {
"V4": {"containers": ["10.255.255.0/24", "10.255.254.0/24"], "networks": [], "mask": 31},
"V6": {"containers": ["dead:beef::/64", "dead:beee::/64"], "networks": [], "mask": 126},
"domain_name": ".gso"
},