linux: Mention mtu setting in esptun doc

The standard tunnel mtu of 1500 will cause packets to be dropped,
causing transferring larger files to fail.
This commit is contained in:
Wladimir J. van der Laan 2020-02-22 14:23:31 +00:00
parent ce9505e670
commit 2819afaae5
2 changed files with 8 additions and 3 deletions

View File

@ -19,10 +19,14 @@ IP address and switch the interface on.
For example:
/root/esptun tun0 /dev/ttyS1 "accesspointname" "secretpassword" 192.168.122.21 23232
/sbin/ip link set dev tun0 mtu 1472
/sbin/ip addr add 10.0.1.2/24 dev tun0
/sbin/ip link set tun0 up
/sbin/ip route add default via 10.0.1.1 dev tun0
(setting the MTU to `1500-20-8` the typical network MTU minus IP and UDP header overhead, because
otherwise the ESP's network stack will drop the oversized packets)
Host side
---------
@ -30,7 +34,8 @@ On the other endpoint the tunnel is expected to be a host running `socat` or sim
the tunnel. For example:
sudo socat UDP:192.168.2.127:23232,bind=192.168.122.21:23232 \
TUN:10.0.1.1/24,tun-name=tundudp,iff-no-pi,tun-type=tun,su=$USER,iff-up
TUN:10.0.1.1/24,tun-name=tundudp,iff-no-pi,tun-type=tun,su=$USER,iff-up &
sudo ip link set dev tundudp mtu 1472
Optionally, enable forwarding and masquerading:

View File

@ -395,12 +395,12 @@ static bool esp_read_responses(int fd, bool early_terminate)
}
/** Send a packet to ESP interface. */
static void esp_tx_packet(int fd, const uint8_t *esp_buffer, size_t size) {
static void esp_tx_packet(int fd, const uint8_t *buffer, size_t size) {
write_all(fd, S("AT+CIPSEND="));
write_uint(fd, size);
write_all(fd, S("\r\n"));
if (esp_read_responses(fd, false)) {
write_all(fd, esp_buffer, size);
write_all(fd, buffer, size);
esp_read_responses(fd, false);
}
}