【笔记】Eureka显示正确的网卡

前言

Eureka显示正确的网卡

配置正确的网卡

src/main/resources/bootstrap.yml
1
2
3
4
5
6
7
8
9
spring:
cloud:
inetutils:
preferred-networks:
# 配置正确的网卡
- 192\.168\.3\..+
ignored-interfaces:
# 配置要忽略的网卡(可选)
- utun.+

配置正确的显示

src/main/resources/application.yml
1
2
3
4
5
eureka:
instance:
prefer-ip-address: true
# 显示格式(可选)
instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}

完成