hashicorp / consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
https://www.consul.io
Other
28.34k stars 4.42k forks source link

Consul - "No private IPv4 address found" error #11550

Open beratuslu opened 2 years ago

beratuslu commented 2 years ago

"ubuntu 20.04"

I am trying to start Consul service with this command: /usr/bin/consul agent -server -ui -data-dir=/temp/consul -bootstrap-expect=1 -node=vault -bind=0.0.0.0 -config-dir=/etc/consul.d/

it gives ==> “No private IPv4 address found”

I also find a page regarding same issue but since I am starter level at linux. I couldnt apply solution. https://github.com/hashicorp/consul/issues/725

What is the issue?

Amier3 commented 2 years ago

Hey @beratuslu

First off, I see this is your first issue so welcome to the hashicorp community! 👍

I see you posted this in our community forum as well, and one of our engineers replied:

Hi @beratuslu you need to provide -bind with the actual public IP address value. 0.0.0.0 is not a routable address so it will default to the local interfaces 127.0.0.1 and other network interfaces available, but in this case non of the network interfaces expose a private IP.

Were you able to try this fix? If it isn't possible for some reason could you let us know the use case for using -bind=0.0.0.0 so we can provide another solution?

jkirschner-hashicorp commented 2 years ago

Hi @beratuslu,

I also found a post of yours on StackExchange that mentions you were following this third-party tutorial.

Out of curiosity, what are you trying to do/learn with Vault? Is there something that led you to use a third-party tutorial rather than Vault's own tutorials (e.g., Getting Started)?

If I understand correctly, you want to use Vault, and that tutorial is suggesting using Consul as Vault's storage provider. Assuming you are using Vault 1.4+, the easiest way to get started is to use Vault integrated storage (so no external storage, like Consul, is needed).

To use the integrated storage, I think you'd need to update https://github.com/b1tsized/vault-tutorial/blob/main/01-getting-started/sys_file_templates/config.hcl to use storage "raft" instead of consul (see docs reference).

beratuslu commented 2 years ago

hello @jkirschner-hashicorp, Yes, I think its not necessary to use consul in my case, as I want to use vault for my deployment environment variables. I dont know what is best practice for this. What I think is; for my "static secrets" I will create "single use" token from UI to access this secrets(a json object) when I will deploy new machine. I will inject this token in to my application as environment variable.

Actually because of obstacles I faced, I postpone this security hardening action to a future time. but if I can take this action now. it would be just nice. since I am newbie at linux/DEVOPS I need step by step to-do list like b1tsized documented what ever best practice for this case.

Cheers Berat