Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/Concepts/Node-Keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Specified by the [`--p2p-host`](../Reference/CLI/CLI-Syntax.md#p2p-host) and
The enode is displayed when starting a Besu node and can be obtained using the [`net_enode`](../Reference/API-Methods.md#net_enode)
JSON-RPC API method.

If [UPnP](../HowTo/Find-and-Connect/Using-UPnP.md) is enabled, the enode advertised to other nodes during discovery is the
external IP address and port.
The enode advertised to other nodes during discovery is the external IP address and port, as defined
by [`--nat-method`](../HowTo/Find-and-Connect/Specifying-NAT.md).

## Specifying a Custom Node Private Key File

Expand Down
2 changes: 1 addition & 1 deletion docs/HowTo/Find-and-Connect/Configuring-Ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Hyperledger Besu node on AWS is:
When running Besu from the [Docker image](../Get-Started/Run-Docker-Image.md), [expose ports](../Get-Started/Run-Docker-Image.md#exposing-ports).

!!! tip
Besu supports [UPnP](Using-UPnP.md) for home or small office environments where a wireless router
Besu supports [UPnP](Specifying-NAT.md) for home or small office environments where a wireless router
or modem provides NAT isolation.

## P2P Networking
Expand Down
64 changes: 64 additions & 0 deletions docs/HowTo/Find-and-Connect/Specifying-NAT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
description: Configuring NAT with Hyperledger Besu
<!--- END of page meta data -->

# Configuring NAT

Use the [`--nat-method`](../../Reference/CLI/CLI-Syntax.md#nat-method) option to specify the
NAT method. Options are: `UPNP`, `MANUAL`, `DOCKER`, `AUTO`, and `NONE`.

The [enode](../../Concepts/Node-Keys.md#enode-url) advertised to other nodes during discovery is the
external IP address and port. The [`admin_nodeInfo`](../../Reference/API-Methods.md#admin_nodeinfo)
JSON-RPC API method returns the external address and port for the `enode` and `listenAddr` properties.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... external IP address ..."?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enode is more than the IP address so leaving as is


While Hyperledger Besu is running, the following are not supported:

* IP address changes
* Changing NAT methods. To change the NAT method, restart the node with the [`--nat-method`](../../Reference/CLI/CLI-Syntax.md#nat-method)
option set.

## UPnP

Specify `UPNP` to quickly allow inbound peer connections without manual router configuration. Use UPnP
in home or small office environments where a wireless router or modem provides NAT isolation.

UPnP automatically detects if a node is running in a UPnP environment and provides port forwarding.
UPnP might introduce delays during node startup, especially on networks where no UPnP gateway device can be found.

!!! tip
UPnP support is often disabled by default in networking firmware. If disabled by default, you must
explicitly enable UPnP support.

## Manual

Specify `MANUAL` to explicitly configure the external IP address and ports to advertise.

When `MANUAL` is specified:

* [`--p2p-host`](../../Reference/CLI/CLI-Syntax.md#p2p-host) and [`--p2p-port`](../../Reference/CLI/CLI-Syntax.md#p2p-port)
define the advertised host and port for the P2P service.
* [`--rpc-http-host`](../../Reference/CLI/CLI-Syntax.md#rpc-http-host) and [`rpc-http-port`](../../Reference/CLI/CLI-Syntax.md#rpc-http-port)
define the advertised host and port for the JSON-RPC service.

## Docker

Specify `DOCKER` to explicitly specify Hyperledger Besu is running inside a Docker container.
When `DOCKER` is specified, the host IP address is advertised not the container IP address.

The host IP is the advertised host specified in the [`docker run` command](https://docs.docker.com/engine/reference/commandline/run/#add-entries-to-container-hosts-file---add-host).
If not specified in the `docker run` command, the advertised host defaults to [`--p2p-host`](../../Reference/CLI/CLI-Syntax.md#p2p-host)
and [`--p2p-port`](../../Reference/CLI/CLI-Syntax.md#p2p-port).

## Auto

`AUTO` is the default NAT method. `AUTO` detects if Besu is running inside Docker container. If
inside a Docker container, acts as if [`DOCKER`](#docker) is specified. Otherwise, acts as if
[`NONE`](#none) is specified.

## None

Specify `NONE` to explicitly specify Besu does not use NAT. If the NAT method is `NONE` and [`--p2p-host`](../../Reference/CLI/CLI-Syntax.md#p2p-host),
[`--p2p-port`](../../Reference/CLI/CLI-Syntax.md#p2p-port), [`--rpc-http-host`](../../Reference/CLI/CLI-Syntax.md#rpc-http-host),
and [`rpc-http-port`](../../Reference/CLI/CLI-Syntax.md#rpc-http-port) are specified, they are
ignored in the advertised addresses and the default values are advertised.


33 changes: 0 additions & 33 deletions docs/HowTo/Find-and-Connect/Using-UPnP.md

This file was deleted.

6 changes: 5 additions & 1 deletion docs/HowTo/Get-Started/Run-Docker-Image.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ docker run -p <localportJSON-RPC>:8545 -p <localportWS>:8546 -p <localportP2P>:3
data path interferes with the operation of Besu and prevents Besu from safely launching.

To run a node that maintains the node state (key and database), [`--data-path`](../../Reference/CLI/CLI-Syntax.md#data-path)
must be set to a location other than `/opt/besu` and a storage volume mounted at that location.
must be set to a location other than `/opt/besu` and a storage volume mounted at that location.

When running in a Docker container, [`--nat-method`](../Find-and-Connect/Specifying-NAT.md) must
be set to `DOCKER` or `AUTO` (default). Do not set [`--nat-method`](../Find-and-Connect/Specifying-NAT.md)
to `NONE`, `UPNP`, or `MANUAL`.

[Besu environment variables](../../Reference/CLI/CLI-Syntax.md#besu-environment-variables) can be specified with the docker image instead of the command line options.

Expand Down
4 changes: 2 additions & 2 deletions docs/Reference/API-Methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ Properties of the node object are:

!!! note
If the node is running locally, the host of the `enode` and `listenAddr` are displayed as `[::]` in the result.
If [UPnP](../HowTo/Find-and-Connect/Using-UPnP.md) is enabled, the external address is
displayed for the `enode` and `listenAddr`.
When advertising externally, the external address displayed for the `enode` and `listenAddr` is
defined by [`--nat-method`](../HowTo/Find-and-Connect/Specifying-NAT.md).

!!! example
```bash tab="curl HTTP request"
Expand Down
7 changes: 4 additions & 3 deletions docs/Reference/CLI/CLI-Syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,15 +745,16 @@ Default is 1000.
nat-method="UPNP"
```

Specify the method for handling [NAT environments](../../HowTo/Find-and-Connect/Using-UPnP.md). Options are: `UPNP` and `NONE`.
The default is `NONE`, which disables NAT functionality.
Specify the method for handling [NAT environments](../../HowTo/Find-and-Connect/Specifying-NAT.md).
Options are: [`UPNP`, `MANUAL`, `DOCKER`, `AUTO`, and `NONE`](../../HowTo/Find-and-Connect/Specifying-NAT.md).
The default is `AUTO`. `NONE` disables NAT functionality.

!!!tip
UPnP support is often disabled by default in networking firmware. If disabled by default, explicitly enable UPnP support.

!!!notes
* Option `UPNP` might introduce delays during node startup, especially on networks where no UPnP gateway device can be found.
* `--nat-method` cannot be used with the [Besu Docker image](../../HowTo/Get-Started/Run-Docker-Image.md).
* `--nat-method=DOCKER` must be specified when using the [Besu Docker image](../../HowTo/Get-Started/Run-Docker-Image.md).

### network

Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ nav:
- Configure Static Nodes: HowTo/Find-and-Connect/Static-Nodes.md
- Configure Ports for Access: HowTo/Find-and-Connect/Configuring-Ports.md
- Manage Peers: HowTo/Find-and-Connect/Managing-Peers.md
- Use UPnP: HowTo/Find-and-Connect/Using-UPnP.md
- Specify NAT Method: HowTo/Find-and-Connect/Specifying-NAT.md
- Monitor Nodes:
- Use Metrics: HowTo/Monitor/Metrics.md
- Configure Logging: HowTo/Monitor/Logging.md
Expand Down