Hello,
I'm trying to setup a OpenVPN server on a VM hosted by Strato. They are using OpenVZ as VT.
I was using this tutorial
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-18-04 for the initial setup.
Instead of adding the iptables MASQUERADE I used
-A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source vm_public_ip
and added it to my
/etc/ufw/before.rules
However, this is what I'm getting when I try to start the server:
sudo openvpn --config /etc/openvpn/server.conf
Sun Oct 18 15:12:17 2020 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
Sun Oct 18 15:12:17 2020 library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.08
Sun Oct 18 15:12:17 2020 Diffie-Hellman initialized with 2048 bit key
Sun Oct 18 15:12:17 2020 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Sun Oct 18 15:12:17 2020 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Sun Oct 18 15:12:17 2020 ROUTE_GATEWAY ON_LINK IFACE=venet0 HWADDR=00:00:00:00:00:00
Sun Oct 18 15:12:17 2020 TUN/TAP device tun0 opened
Sun Oct 18 15:12:17 2020 Note: Cannot set tx queue length on tun0: Operation not permitted (errno=1)
Sun Oct 18 15:12:17 2020 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Sun Oct 18 15:12:17 2020 /sbin/ip link set dev tun0 up mtu 1500
Sun Oct 18 15:12:17 2020 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Sun Oct 18 15:12:17 2020 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Sun Oct 18 15:12:17 2020 Could not determine IPv4/IPv6 protocol. Using AF_INET
Sun Oct 18 15:12:17 2020 Socket Buffers: R=[212992->212992] S=[212992->212992]
Sun Oct 18 15:12:17 2020 UDPv4 link local (bound): [AF_INET][undef]:1194
Sun Oct 18 15:12:17 2020 UDPv4 link remote: [AF_UNSPEC]
Sun Oct 18 15:12:17 2020 GID set to nogroup
Sun Oct 18 15:12:17 2020 UID set to nobody
Sun Oct 18 15:12:17 2020 MULTI: multi_init called, r=256 v=256
Sun Oct 18 15:12:17 2020 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Sun Oct 18 15:12:17 2020 IFCONFIG POOL LIST
Sun Oct 18 15:12:17 2020 Initialization Sequence Completed
To me it looks like it's using the wrong network interface, as venet0 is just pointing to the localhost.
This is my ifconfig:
ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Lokale Schleife)
RX packets 95687 bytes 24661316 (24.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 95687 bytes 24661316 (24.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
venet0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500
inet 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0 destination 127.0.0.1
inet6 ::2 prefixlen 128 scopeid 0x80<compat,global>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
RX packets 866925 bytes 138538576 (138.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1403385 bytes 188541422 (188.5 MB)
TX errors 0 dropped 11 overruns 0 carrier 0 collisions 0
venet0:0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500
inet vm_public_ip netmask 255.255.255.255 broadcast vm_public_ip destination vm_public_ip
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
I guess it must be using the venet0:0 interface?
Does someone got a clue what I might be doing wrong?
Thanks in advance