Ukah Hello everybody, i try to fix this problem since some days and i can't figure it out so i come here to looking for some help. I have my openvpn server on a remote machine, and i have a plex server too on it (port 32400). What i want is ---> When i connect from a client with the public adress of this server:32400, i want that this connection go through the tunnel vpn. The only way to connect to my vpn via the tunnel is typing 10.0.0.1:32400 but i want to do it with the server IP PUBLIC too. If i analyze wireshark traffic, paquets to server:32400 are send from wlps3so (wifi) and not tun0. Here is my config file server side. port 443 port-share 127.0.0.1 4443 proto tcp dev tun ca /etc/openvpn/easy-rsa/keys/ca.crt cert /etc/openvpn/easy-rsa/keys/LaGrosseBertha.crt key /etc/openvpn/easy-rsa/keys/LaGrosseBertha.key # This file should be kept secret dh /etc/openvpn/easy-rsa/keys/dh2048.pem server 10.8.0.0 255.255.255.0 push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 8.8.8.8" push "dhcp-option DNS 208.67.220.220" keepalive 10 120 tls-crypt /etc/openvpn/easy-rsa/keys/ta.key cipher AES-256-CBC auth SHA512 tls-version-min 1.2 tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA:TLS-DHE-RSA-WITH-AES-128-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA compress lz4-v2 push "compress lz4-v2" user nobody group nogroup persist-key persist-tun status openvpn-status.log log-append openvpn.log verb 3 Here is my config client side. client dev tun proto tcp remote X.X.X.X 443 resolv-retry infinite nobind user nobody group nogroup persist-key persist-tun ca ca.crt cert user.crt key user.key remote-cert-tls server tls-crypt ta.key cipher AES-256-CBC verb 3 script-security 2 up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf Here is the rule i add to NAT on server: sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o enp3s0 -j MASQUERADE BONUS: If someone can englighten me about this last command, it's say that everything comming from the tunel should be NAT? Thks a lot guys, don't hesitate if you need other infos! 🙂
TinCanTech Ukah wrote The only way to connect to my vpn via the tunnel is typing 10.0.0.1:32400 but i want to do it with the server IP PUBLIC too So .. you mean without openvpn ?
Ukah TinCanTech wrote So .. you mean without openvn ? No, i want to know if it's possible to redirect all the traffic to the tunnel with a rule for example, if a client want to access to the server ip public while he is connected to VPN
Ukah TinCanTech wrote That is how it is by default .. Are you saying that's normal that i can't access to my server which running openvpn server via tun0?
TinCanTech Ukah wrote Are you saying that's normal that i can't access to my server which running openvpn server via tun0 No and that is not your question ..... Ukah wrote TinCanTech wrote So .. you mean without openvn ? No, i want to know if it's possible to redirect all the traffic to the tunnel with a rule for example, if a client want to access to the server ip public while he is connected to VPN TinCanTech wrote That is how it is by default .. See --redirect-gateway def1 in The Manual v24x