Add new properties to customize InetUtils.
Added useOnlySiteLocalInterfaces and preferredNetworks properties to InetUtils. The preferredNetworks property allows for a whitelist of networks. The useOnlySiteLocalInterfaces allows InetAddresses where isSiteLocalAddress is true. Fixes gh-114
This commit is contained in:
committed by
Spencer Gibb
parent
8281c829e2
commit
e6ccb824a6
@@ -393,7 +393,7 @@ TIP: If you see errors like `java.lang.IllegalArgumentException: Can not set org
|
||||
[[ignore-network-interfaces]]
|
||||
=== Ignore Network Interfaces
|
||||
|
||||
Sometimes it is useful to ignore certain named network interfaces so they can be excluded from Service Discovery registration (eg. running in a Docker container). A list of regular expressions can be set that will cause the desired network interfaces to be ignored. The following configuration will ignore the "docker0" interface and all interfaces that start with "veth".
|
||||
Sometimes it is useful to ignore certain named network interfaces so they can be excluded from Service Discovery registration (eg. running in a Docker container). A list of regular expressions can be set that will cause the desired network interfaces to be ignored. The following configuration will ignore the "docker0" interface and all interfaces that start with "veth".
|
||||
|
||||
.application.yml
|
||||
----
|
||||
@@ -403,4 +403,26 @@ spring:
|
||||
ignoredInterfaces:
|
||||
- docker0
|
||||
- veth.*
|
||||
----
|
||||
----
|
||||
|
||||
You can also force to use only specified network addresses using list of regular expressions:
|
||||
|
||||
.application.yml
|
||||
----
|
||||
spring:
|
||||
cloud:
|
||||
inetutils:
|
||||
preferredNetworks:
|
||||
- 192.168
|
||||
- 10.0
|
||||
----
|
||||
|
||||
You can also force to use only site local addresses. See https://docs.oracle.com/javase/8/docs/api/java/net/Inet4Address.html#isSiteLocalAddress--[Inet4Address.html.isSiteLocalAddress()] for more details what is site local address.
|
||||
|
||||
.application.yml
|
||||
----
|
||||
spring:
|
||||
cloud:
|
||||
inetutils:
|
||||
useOnlySiteLocalInterfaces: true
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user