# slow rsync speeds for LAN transfer but not remote transfer



## molofishy (Aug 4, 2019)

I'm trying to transfer a bunch of movies (.mv4; ~400mb each) from my freebsd server to my mac on my local area network, with:

```
rsync --progress -vvr oliver@myserver.ddns.net:/home/oliver/family_videos .
```
The transfer is excruciatingly slow (75kb/s)

I can download files with my internet connection from servers on the other side of the world at a much faster speed!

What is odd is that when I am outside my LAN (connecting my laptop to my phone's hotspot), the transfer speed of the above rsync call is significantly faster. Same goes for loading a webpage hosted on the server: loading time is much faster outside the LAN than within the LAN.

Happy to provide the results of any diagnostic commands to help you identify the issue...


----------



## SirDice (Aug 5, 2019)

You're not connecting to a _local_ address. You're connecting to your _external_ address (myserver.ddns.net). Which causes your home internet router to try and do a hairpin. Hairpinning usually doesn't even work (on cheap SOHO modem/routers), so getting 75KB/s is already more than I expected.

Use rsync(1) to the internal address.


----------



## molofishy (Aug 5, 2019)

Great - now I'm getting 50mb/s speeds with:

```
rsync --progress -vvr oliver@192.168.0.10:/home/oliver/family_videos .
```

Also, to view my website, navigating to:


			http://192.168.0.10/~oliver/mysite/
		

is much faster than


			http://myserver.ddns.net/~oliver/mysite/
		


Is there a way I can always ssh into the same address & navigate to the same url to view my website? Otherwise I have to have 2 aliases/browser shortcuts depending on whether I am in / out of the LAN

I have set 

```
UseDNS no
```
in /etc/ssh/sshd_config

But that didn't seem to help.


----------



## SirDice (Aug 6, 2019)

molofishy said:


> Is there a way I can always ssh into the same address & navigate to the same url to view my website? Otherwise I have to have 2 aliases/browser shortcuts depending on whether I am in / out of the LAN


Nothing "easy". One way to solve it is to use an internal DNS server to translate internal requests to internal addresses. A so-called split-horizon DNS.


----------

