<p><code>getnetworkinfo</code> will tell you the IP address of your node if it knows what it actually is (or thinks it knows). It will be in the <code>localaddresses</code> field. Note that it may not contain your IP address or have the right IP addresses as it is difficult to know what your IP address is unless someone external tells you what it is.</p>

CC BY-SA 3.0
2017-09-30T19:34:13.827Z
What I am trying to do is to connect to other node with -addnode, or -connect options, but the question is how to know other nodes address. Both nodes are mine.
Ashot Khachatryan
CC BY-SA 3.0
2017-09-30T19:38:26.870Z
The node's IP address is the IP address of the machine it is running on. On that machine, you can go to a website like https://www.whatismyip.com/ to find your IP address.
Ava Chow
CC BY-SA 3.0
2017-09-30T19:45:10.237Z
So if I have two different bitcoin nodes running in different networks I can use their external ip-s to connect them?
Ashot Khachatryan
CC BY-SA 3.0
2017-09-30T19:46:06.277Z
Yes, you use their external IP addresses. Connecting them works in the same way that other nodes connect to your nodes.
Ava Chow
CC BY-SA 3.0
2017-09-30T19:52:20.883Z
Strange thing is that after addnode I am checking the status with getaddednodeinfo but 'connected' is always false.
Ashot Khachatryan
CC BY-SA 3.0
2017-09-30T19:28:26.707Z
2017-09-30T19:28:26.707Z
Ava Chow
<p>With getpeerinfo command I can get all directly connected peers ip addresses, how to know mine in the bitcoin network?</p>

<bitcoin-core><client><ip-address>
How to know my ip address in network
Ashot Khachatryan
# How to know my ip address in network

(Asked by: username_0 on 2017-09-30)

With getpeerinfo command I can get all directly connected peers ip addresses, how to know mine in the bitcoin network?

**Tags:** bitcoin-core, client, ip-address


---

## 1 answers

### Answer by username_1 on 2017-09-30. Score: 2

`getnetworkinfo` will tell you the IP address of your node if it knows what it actually is (or thinks it knows). It will be in the `localaddresses` field. Note that it may not contain your IP address or have the right IP addresses as it is difficult to know what your IP address is unless someone external tells you what it is.

> **Comments:**
> **username_0**: What I am trying to do is to connect to other node with -addnode, or -connect options, but the question is how to know other nodes address. Both nodes are mine.  
> **username_1**: The node's IP address is the IP address of the machine it is running on. On that machine, you can go to a website like https://www.whatismyip.com/ to find your IP address.  
> **username_0**: So if I have two different bitcoin nodes running in different networks I can use their external ip-s to connect them?  
> **username_1**: Yes, you use their external IP addresses. Connecting them works in the same way that other nodes connect to your nodes.  
> **username_0**: Strange thing is that after addnode I am checking the status with getaddednodeinfo but 'connected' is always false.  

---

