0

Discrete Question: Is there a problem with my network configuration or rsync configuration preventing backups over OpenVPN between two servers?

I have a working openvpn tunnel I can ping on 10.8.0.1. But when I use the command below, it times out with timeout (110). It should instead print out the available backup directories... :

rsync rsync://10.8.0.1

My openvpn config files: Server

;local a.b.c.d
port 1194
proto udp
dev tun0
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key  # This file should be kept secret
dh /etc/openvpn/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
keepalive 10 120
tls-auth /etc/openvpn/keys/ta.key 0 # This file is secret
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log-append  /var/log/openvpn/openvpn.log
verb 3
explicit-exit-notify 1
;dev-node MyTap
;topology subnet
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
;server-bridge
;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
;learn-address ./script
;push "redirect-gateway def1 bypass-dhcp"
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
;client-to-client
;duplicate-cn
;log         /var/log/openvpn/openvpn.log
;mute 20
;compress lz4-v2
;push "compress lz4-v2"
;comp-lzo
;max-clients 100

Client:

client
dev tun0
proto udp
remote server.ip.address 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/backupclient.crt
key /etc/openvpn/keys/backupclient.key
remote-cert-tls server
tls-auth /etc/openvpn/keys/ta.key 1
cipher AES-256-CBC
verb 3
;dev-node MyTap
;proto tcp
;http-proxy-retry
;http-proxy [proxy server] [proxy port #]
;mute-replay-warnings
;remote my-server-2 1194
;remote-random
;mute 20

I wasn't able to connect with rsync to show me the available backup files, so then I added the following by running the commands:

root@user:/# iptables --table nat --append POSTROUTING --out-interface eth0 --source 10.8.0.0/24 --jump MASQUERADE
root@user:/# iptables --table nat --append POSTROUTING --out-interface tun0 --source 10.8.0.0/24 --jump MASQUERADE

Then I made changes to UFW:

ufw allow 1194/udp

Edit /etc/default/ufw, look for DEFAULT_FORWARD_POLICY=”DROP” and change:

DEFAULT_FORWARD_POLICY="ACCEPT"

EDIT 1: I've reloaded ufw, openvpn, and rsync with all changes. Even just tried restarting the service. I noticed that my interface device changed with testing from tun to tun0 to tun 2, so I dropped all of the tun and restart open vpn as well

Still no dice. I had this working before I reimaged the server and then struggled to get openvpn installed again. Almost wonder if I messed up an interface or routing...

Justin C
  • 103
  • 4

2 Answers2

0

Well, ufw needs to be ufw reload so any changes in firewall will take effect

PTL
  • 16
  • 1
  • I've reloaded ufw, openvpn, and rsync with all changes. Even just tried restarting the service. I noticed that my interface device changed with testing from tun to tun0 to tun 2, so I dropped all of the tun and restart open vpn as well – Justin C Jun 05 '20 at 15:04
0

Turns out that because I'm using Rsync over openvpn, I still have to open port 873. I'm not sure if this sits well with me, because I need to verify that openvpn is still providing my encryption. I think I may need to add a route so that rsync stops listening on 873. I currently have my server rsync file set to:

address: 10.8.0.1

I'm not sure that it's working correctly, however. Either way, opening port 873 at least allows rsync to start working. I'll keep working on the other bit.

Justin C
  • 103
  • 4