Skip to content

Commit e470596

Browse files
authored
chore(docs): amend port guidance to enable QUIC support (#5029)
* chore(docs): amend port guidance to enable QUIC support
1 parent 0c3fef5 commit e470596

File tree

3 files changed

+77
-46
lines changed

3 files changed

+77
-46
lines changed

book/src/advanced_networking.md

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ drastically and use the (recommended) default.
4040

4141
### NAT Traversal (Port Forwarding)
4242

43-
Lighthouse, by default, uses port 9000 for both TCP and UDP. Lighthouse will
43+
Lighthouse, by default, uses port 9000 for both TCP and UDP. Since v4.5.0, Lighthouse will also attempt to make QUIC connections via UDP port 9001 by default. Lighthouse will
4444
still function if it is behind a NAT without any port mappings. Although
4545
Lighthouse still functions, we recommend that some mechanism is used to ensure
4646
that your Lighthouse node is publicly accessible. This will typically improve
@@ -50,8 +50,8 @@ peers for your node and overall improve the Ethereum consensus network.
5050
Lighthouse currently supports UPnP. If UPnP is enabled on your router,
5151
Lighthouse will automatically establish the port mappings for you (the beacon
5252
node will inform you of established routes in this case). If UPnP is not
53-
enabled, we recommend you to manually set up port mappings to both of Lighthouse's
54-
TCP and UDP ports (9000 by default).
53+
enabled, we recommend you to manually set up port mappings to Lighthouse's
54+
TCP and UDP ports (9000 TCP/UDP, and 9001 UDP by default).
5555

5656
> Note: Lighthouse needs to advertise its publicly accessible ports in
5757
> order to inform its peers that it is contactable and how to connect to it.
@@ -66,24 +66,30 @@ TCP and UDP ports (9000 by default).
6666

6767
The steps to do port forwarding depends on the router, but the general steps are given below:
6868
1. Determine the default gateway IP:
69-
- On Linux: open a terminal and run `ip route | grep default`, the result should look something similar to `default via 192.168.50.1 dev wlp2s0 proto dhcp metric 600`. The `192.168.50.1` is your router management default gateway IP.
69+
- On Linux: open a terminal and run `ip route | grep default`, the result should look something similar to `default via 192.168.50.1 dev wlp2s0 proto dhcp metric 600`. The `192.168.50.1` is your router management default gateway IP.
7070
- On MacOS: open a terminal and run `netstat -nr|grep default` and it should return the default gateway IP.
7171
- On Windows: open a command prompt and run `ipconfig` and look for the `Default Gateway` which will show you the gateway IP.
7272

7373
The default gateway IP usually looks like 192.168.X.X. Once you obtain the IP, enter it to a web browser and it will lead you to the router management page.
7474

7575
2. Login to the router management page. The login credentials are usually available in the manual or the router, or it can be found on a sticker underneath the router. You can also try the login credentials for some common router brands listed [here](https://www.noip.com/support/knowledgebase/general-port-forwarding-guide/).
7676

77-
3. Navigate to the port forward settings in your router. The exact step depends on the router, but typically it will fall under the "Advanced" section, under the name "port forwarding" or "virtual server".
77+
3. Navigate to the port forward settings in your router. The exact step depends on the router, but typically it will fall under the "Advanced" section, under the name "port forwarding" or "virtual server".
7878

7979
4. Configure a port forwarding rule as below:
8080
- Protocol: select `TCP/UDP` or `BOTH`
8181
- External port: `9000`
8282
- Internal port: `9000`
83-
- IP address: Usually there is a dropdown list for you to select the device. Choose the device that is running Lighthouse
83+
- IP address: Usually there is a dropdown list for you to select the device. Choose the device that is running Lighthouse.
8484

85-
5. To check that you have successfully open the ports, go to [yougetsignal](https://www.yougetsignal.com/tools/open-ports/) and enter `9000` in the `port number`. If it shows "open", then you have successfully set up port forwarding. If it shows "closed", double check your settings, and also check that you have allowed firewall rules on port 9000.
85+
Since V4.5.0 port 9001/UDP is also used for QUIC support.
8686

87+
- Protocol: select `UDP`
88+
- External port: `9001`
89+
- Internal port: `9001`
90+
- IP address: Choose the device that is running Lighthouse.
91+
92+
5. To check that you have successfully opened the ports, go to [yougetsignal](https://www.yougetsignal.com/tools/open-ports/) and enter `9000` in the `port number`. If it shows "open", then you have successfully set up port forwarding. If it shows "closed", double check your settings, and also check that you have allowed firewall rules on port 9000. Note: this will only confirm if port 9000/TCP is open. You will need to ensure you have correctly setup port forwarding for the UDP ports (`9000` and `9001` by default).
8793

8894
### ENR Configuration
8995

@@ -125,6 +131,9 @@ IPv4 only:
125131
TCP and UDP.
126132
- `--listen-address :: --port 9909 --discovery-port 9999` will listen over
127133
IPv6 using port `9909` for TCP and port `9999` for UDP.
134+
- By default, QUIC listens for UDP connections using a port number that is one greater than the specified port.
135+
If the specified port is 9909, QUIC will use port 9910 for IPv6 UDP connections.
136+
This can be configured with `--quic-port`.
128137

129138
To listen over both IPv4 and IPv6:
130139
- Set two listening addresses using the `--listen-address` flag twice ensuring
@@ -133,18 +142,38 @@ To listen over both IPv4 and IPv6:
133142
that this behaviour differs from the Ipv6 only case described above.
134143
- If necessary, set the `--port6` flag to configure the port used for TCP and
135144
UDP over IPv6. This flag has no effect when listening over IPv6 only.
136-
- If necessary, set the `--discovery-port6` flag to configure the IPv6 UDP
145+
- If necessary, set the `--discovery-port6` flag to configure the IPv6 UDP
137146
port. This will default to the value given to `--port6` if not set. This flag
138147
has no effect when listening over IPv6 only.
148+
- If necessary, set the `--quic-port6` flag to configure the port used by QUIC for
149+
UDP over IPv6. This will default to the value given to `--port6` + 1. This flag
150+
has no effect when listening over IPv6 only.
139151

140152
##### Configuration Examples
141153

142-
- `--listen-address :: --listen-address 0.0.0.0 --port 9909` will listen
143-
over IPv4 using port `9909` for TCP and UDP. It will also listen over IPv6 but
144-
using the default value for `--port6` for UDP and TCP (`9090`).
145-
- `--listen-address :: --listen-address --port 9909 --discovery-port6 9999`
146-
will have the same configuration as before except for the IPv6 UDP socket,
147-
which will use port `9999`.
154+
> When using `--listen-address :: --listen-address 0.0.0.0 --port 9909`, listening will be set up as follows:
155+
>
156+
> **IPv4**:
157+
>
158+
> It listens on port `9909` for both TCP and UDP.
159+
> QUIC will use the next sequential port `9910` for UDP.
160+
>
161+
> **IPv6**:
162+
>
163+
> It listens on the default value of --port6 (`9090`) for both UDP and TCP.
164+
> QUIC will use port `9091` for UDP, which is the default `--port6` value (`9090`) + 1.
165+
166+
> When using `--listen-address :: --listen-address --port 9909 --discovery-port6 9999`, listening will be set up as follows:
167+
>
168+
> **IPv4**:
169+
>
170+
> It listens on port `9909` for both TCP and UDP.
171+
> QUIC will use the next sequential port `9910` for UDP.
172+
>
173+
> **IPv6**:
174+
>
175+
> It listens on the default value of `--port6` (`9090`) for TCP, and port `9999` for UDP.
176+
> QUIC will use port `9091` for UDP, which is the default `--port6` value (`9090`) + 1.
148177
149178
#### Configuring Lighthouse to advertise IPv6 reachable addresses
150179
Lighthouse supports IPv6 to connect to other nodes both over IPv6 exclusively,

book/src/docker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ docker run lighthouse:local lighthouse --help
112112
You can run a Docker beacon node with the following command:
113113

114114
```bash
115-
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse --network mainnet beacon --http --http-address 0.0.0.0
115+
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 9001:9001/udp -p 127.0.0.1:5052:5052 -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse --network mainnet beacon --http --http-address 0.0.0.0
116116
```
117117

118118
> To join the Goerli testnet, use `--network goerli` instead.
@@ -135,18 +135,18 @@ docker run -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse bea
135135

136136
### Ports
137137

138-
In order to be a good peer and serve other peers you should expose port `9000` for both TCP and UDP.
138+
In order to be a good peer and serve other peers you should expose port `9000` for both TCP and UDP, and port `9001` for UDP.
139139
Use the `-p` flag to do this:
140140

141141
```bash
142-
docker run -p 9000:9000/tcp -p 9000:9000/udp sigp/lighthouse lighthouse beacon
142+
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 9001:9001/udp sigp/lighthouse lighthouse beacon
143143
```
144144

145145
If you use the `--http` flag you may also want to expose the HTTP port with `-p
146146
127.0.0.1:5052:5052`.
147147

148148
```bash
149-
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 sigp/lighthouse lighthouse beacon --http --http-address 0.0.0.0
149+
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 9001:9001/udp -p 127.0.0.1:5052:5052 sigp/lighthouse lighthouse beacon --http --http-address 0.0.0.0
150150
```
151151

152152
[docker_hub]: https://hub.docker.com/repository/docker/sigp/lighthouse/

0 commit comments

Comments
 (0)