Search code examples
linuxnetwork-programmingsshubuntu-16.04scp

packet_write_wait: Connection to @host port 22: Broken pipe


I'm trying to copy some files from production server(ubuntu 16.04) to backup server(ubuntu 16.04) using scp command but getting

packet_write_wait: Connection to @host port 22: Broken pipe
Lost connection

I have tried adding

-o ServerAliveInterval=30 -o ServerAliveCountMax=5

from https://superuser.com/questions/1331240/packet-write-wait-connection-to-xxx-port-3591-broken-pipe https://superuser.com/questions/1331240/packet-write-wait-connection-to-xxx-port-3591-broken-pipe https://superuser.com/questions/1137584/packet-write-wait-broken-pipe-error-on-macos-sierra-ssh but then its started throwing

Timeout, server @host not responding.
lost connection

I'm able to get the ssh connection to the backup server but not able to copy any files. Point out something which I can do and copy files to backup server.Thanks in advance.

I found that I can copy files/folders upto 4k size to backup server but not bigger files. it's working when I'm trying to copy large files to another server but not on backup server.


Solution

  • It seems I found fix by setting the LAN card's mtu setting to 1492 by

    # ifconfig eth0 mtu 1492

    Refer this link for more information : http://www.microhowto.info/howto/change_the_mtu_of_a_network_interface.html