<p>Some additional guidance is in <a href="https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf" rel="nofollow noreferrer">share/examples/bitcoin.conf</a> to add to Nontenda's answer.</p>
<blockquote>
<p>Let's say for instance you use <code>addnode=4.2.2.4</code>, <code>addnode</code> will connect
you to and tell you about the nodes connected to <code>4.2.2.4</code>.  In addition
it will tell the other nodes connected to it that you exist so they
can connect to you.</p>
<p><code>connect</code> will not do the above when you &quot;connect&quot; to it. It will <strong>only</strong>
connect you to <code>4.2.2.4</code> and no one else. So if you're behind a
firewall, or have other problems finding nodes, add some using
<code>addnode</code>. If you want to stay private, use <code>connect</code>
to only connect to &quot;trusted&quot; nodes.</p>
<p>If you run multiple nodes on a LAN, there's no need for all of them to open lots
of connections.  Instead &quot;connect&quot; them all to one node that is port
forwarded and has lots of connections.</p>
</blockquote>
<p>Further documentation for <code>addnode</code> is <a href="https://bitcoincore.org/en/doc/0.16.0/rpc/network/addnode/" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2021-06-24T10:34:17.080Z
2021-06-24T10:34:17.080Z
Michael Folkson
<p><code>addnode</code> add a node to the list of nodes to connect.<br>
<code>connect</code> only connect to THIS node.</p>

<p>For example, if you are currently connected to the nodes <code>{A, B, C}</code> and then issue…</p>

<p><code>addnode=D</code>: you'll be connected to <code>{A, B, C, D}</code><br>
<code>connect=D</code>: you'll be connected to <code>{D}</code></p>

CC BY-SA 4.0
2013-05-10T07:29:42.410Z
2019-12-16T18:20:42.293Z
2019-12-16T18:20:42.293Z
Nontenda
<p>As seen here: <a href="https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments" rel="noreferrer">https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments</a></p>

<blockquote>
  <p>-addnode=ip          Add a node to connect to and attempt to keep the connection open<br>
  -connect=ip          Connect only to the specified node(s)</p>
</blockquote>

<p>Both of those explanations seem to say the same thing to me.</p>

<p>Can anyone explain them in more detail?</p>

<bitcoind><json-rpc><p2p><peer-discovery>
What is the difference between the bitcoind command line options "addnode" and "connect"?
user3145
# What is the difference between the bitcoind command line options "addnode" and "connect"?

(Asked by: username_0 on 2013-05-10)

As seen here: <https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments>

> -addnode=ip Add a node to connect to and attempt to keep the connection open  
> -connect=ip Connect only to the specified node(s)

Both of those explanations seem to say the same thing to me.

Can anyone explain them in more detail?

**Tags:** bitcoind, json-rpc, p2p, peer-discovery


---

## 2 answers

### Answer by username_2 on 2013-05-10. Score: 16 | Accepted answer

`addnode` add a node to the list of nodes to connect.  
`connect` only connect to THIS node.

For example, if you are currently connected to the nodes `{A, B, C}` and then issue…

`addnode=D`: you'll be connected to `{A, B, C, D}`  
`connect=D`: you'll be connected to `{D}`


---

### Answer by username_1 on 2021-06-24. Score: 1

Some additional guidance is in [share/examples/bitcoin.conf](https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf) to add to username_2's answer.

> Let's say for instance you use `addnode=4.2.2.4`, `addnode` will connect
> you to and tell you about the nodes connected to `4.2.2.4`. In addition
> it will tell the other nodes connected to it that you exist so they
> can connect to you.
>
> `connect` will not do the above when you "connect" to it. It will **only**
> connect you to `4.2.2.4` and no one else. So if you're behind a
> firewall, or have other problems finding nodes, add some using
> `addnode`. If you want to stay private, use `connect`
> to only connect to "trusted" nodes.
>
> If you run multiple nodes on a LAN, there's no need for all of them to open lots
> of connections. Instead "connect" them all to one node that is port
> forwarded and has lots of connections.

Further documentation for `addnode` is [here](https://bitcoincore.org/en/doc/0.16.0/rpc/network/addnode/).


---

