1
votes

I have many local IP addresses on my host (Windows):

$ ipconfig | find "IPv4"

  • IPv4 address. . . . .: 192.168.55.1
  • IPv4 address. . . . .: 10.11.12.38
  • IPv4 address. . . . .: 172.16.10.5
  • IPv4 address. . . . .: 192.168.87.29

When I start SpringCloud application, it's health on Spring Cloud server (Eureka?) dashborad is unknown. Moreover, on server dashboard it shows my registered service with "192.168.55.1" (this is a first IP from my list, but it is a Virtual Adapter IP address). I suppose, that there is no route from SpringCloud server (Eureka?) to this IP, thats why my service's health is unknown (it cannot ping back service).

I want to restrict my SpringCloud service application to bind only to certain IP addresses (or even masks), f.e. only 10.X.X.X network. How can I do it?

1

1 Answers

1
votes

One way is to simply set your eureka.instance.hostname to the IP address that you want to bind to. This is probably the easiest. Another (with Brixton snapshots) is to configure a pattern for the name of the network adapter you want to bind to.