Answer the question
In order to leave comments, you need to log in
How to set up an openvpn server so that clients go to one site on the Internet through the ip of the openvpn server?
I have a working openvpn network to access local network resources via the Internet.
What settings need to be added so that openvpn clients go to one Internet server (for example, to myip.ru/) through the ip address of the vpn server.
It is desirable that these settings be in the vpn server config, but in the client config it will also work.
Tell me please.
Client config:
remote 176.37.xx.xx 1194
client
proto tcp-client
dev tun
ca vpnca.crt
cert client-pqr.crt
key client-pqr.key
comp-lzo
user nobody
group nobody
persist-key
persist-tun
verb 3
port 1194
proto tcp-server
dev tun
client-to-client
tls-server
ca pki/vpnca.crt
cert pki/vpn-node.crt
key pki/vpn-node.key
dh pki/dh2048.pem
server 192.168.2.0 255.255.255.0
push "dhcp-option DNS 192.168.2.1"
keepalive 10 120
comp-lzo
max-clients 10
persist-key
persist-tun
user nobody
group nobody
status /var/log/openvpn-status.log
log-append /var/log/openvpn.log
verb 3
sndbuf 0
rcvbuf 0
client-config-dir clients
Answer the question
In order to leave comments, you need to log in
You need to give clients a route to the required site through your vpn server. Openvpn can do that.
push "route IP MASK"
where the IP and MASK is the subnet address and mask where your server is located. The route to the specified network is written on the client side, the VPN server will be the gateway.
By the way, I recommend using UDP for VPN, not TCP. It works much faster, this is especially true on bad communication channels.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question