Hello,
I have established a successfully connection between a server and a client. And I also add commands in configuration file to route all the traffic over OpenVPN. and I think it's also done because, when OpenVPN is connected and I check whatsmyip.org, I see the IP of my server. The next thing I need to do is to monitor the traffic over OpenVPN. I found in internet that i can use management interface in OpenVPN. when i run the commend :
openvpn --management 127.0.0.1 7505
I get this error:
Options error: You must define TUN/TAP device (--dev)
And I have the command 'dev tun' in server configuration file.
Then I went the other way and I tried to do it using config file and added this command:
openvpn management 127.0.0.1 7505
in server config file. (i'm not sure it will work or not since i got that error in command line)
for using management interface i need to telnet to the 127.0.0.1. But i get this error:
[root@myBackupVPS ~]# telnet localhost 7505
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying ::1...
telnet: connect to address ::1: Connection refused
I don't know if this is because of the openvpn or my VPS restrictions.
This is my whole story. Is there anyone who could help me make it work to monitor OpenVPN trraffic.
Thank you very much
Here is my configurations:
Client:
client
dev tun
proto udp
remote 192.227.xx.xx 1194 # - Your server IP and OpenVPN Port
resolv-retry infinite
nobind
tun-mtu 1500
tun-mtu-extra 32
redirect-gateway def1
mssfix 1450
persist-key
persist-tun
ca ca.crt
auth-user-pass
comp-lzo
reneg-sec 0
verb 3
Server:
local 192.227.xx.xx # server ip address
port 1194 # default port
proto udp #protocol
dev tun
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login
client-cert-not-required
username-as-common-name
server 1.2.3.0 255.255.255.0
openvpn management localhost 7505
push "redirect-gateway def1"
push "route 1.2.3.0 255.255.255.0"
push "dhcp-option DNS 8.8.8.8"