You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/src/advanced_networking.md
+43-14Lines changed: 43 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ drastically and use the (recommended) default.
40
40
41
41
### NAT Traversal (Port Forwarding)
42
42
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
44
44
still function if it is behind a NAT without any port mappings. Although
45
45
Lighthouse still functions, we recommend that some mechanism is used to ensure
46
46
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.
50
50
Lighthouse currently supports UPnP. If UPnP is enabled on your router,
51
51
Lighthouse will automatically establish the port mappings for you (the beacon
52
52
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).
55
55
56
56
> Note: Lighthouse needs to advertise its publicly accessible ports in
57
57
> 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).
66
66
67
67
The steps to do port forwarding depends on the router, but the general steps are given below:
68
68
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.
70
70
- On MacOS: open a terminal and run `netstat -nr|grep default` and it should return the default gateway IP.
71
71
- On Windows: open a command prompt and run `ipconfig` and look for the `Default Gateway` which will show you the gateway IP.
72
72
73
73
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.
74
74
75
75
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/).
76
76
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".
78
78
79
79
4. Configure a port forwarding rule as below:
80
80
- Protocol: select `TCP/UDP` or `BOTH`
81
81
- External port: `9000`
82
82
- 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.
84
84
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.
86
86
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).
87
93
88
94
### ENR Configuration
89
95
@@ -125,6 +131,9 @@ IPv4 only:
125
131
TCP and UDP.
126
132
-`--listen-address :: --port 9909 --discovery-port 9999` will listen over
127
133
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`.
128
137
129
138
To listen over both IPv4 and IPv6:
130
139
- Set two listening addresses using the `--listen-address` flag twice ensuring
@@ -133,18 +142,38 @@ To listen over both IPv4 and IPv6:
133
142
that this behaviour differs from the Ipv6 only case described above.
134
143
- If necessary, set the `--port6` flag to configure the port used for TCP and
135
144
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
137
146
port. This will default to the value given to `--port6` if not set. This flag
138
147
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.
139
151
140
152
##### Configuration Examples
141
153
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`).
0 commit comments