0

I am new to openvpn. I try to create openvpn tunnel between two hosts. Both hosts have two interfaces. Say eth0 and eth1. So I created two config files, server.conf, server1.conf. At client side, client.conf and client1.conf.

Client host interface details, eth0: 192.168.14.110 eth1: 192.168.14.111

Server host interface details, eth0: 192.168.14.190 eth1: 192.168.14.191

I tried both tun and tap mechanism. But openvpn connection not established. I tried openvpn tutorial and ubuntu tutorial.

My example server.conf file is,

mode server
tls-server
port 1194
proto udp
#dev tun0
dev tap0

ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh1024.pem
tls-auth ta.key 0 # This file is secret


server-bridge 192.168.14.190 255.255.0.0 192.168.14.210 192.168.14.215
push "route 192.168.14.190 255.255.0.0"
push "redirect-gateway def1 bypass-dhcp"
client-to-client
duplicate-cn

keepalive 10 120

cipher BF-CBC
comp-lzo

max-clients 10
keepalive 10 120

persist-key
persist-tun
status openvpn-status.log

verb 3

;mute 20

At client.conf,

dev tap0
port 1194
client
remote 192.168.14.190 1194

# allow script execution
script-security 2

# routing information
redirect-private bypass-dhcp bypass-dns


ca       ca.crt
cert     client1.crt
key      client1.key
tls-auth ta.key 1
verify-x509-name server name

comp-lzo
keepalive 10 60
persist-key
persist-tun

But, not able to run vpn tunnel and even it not created.

One instant connection established comes, but not able to ping.

I done IP forward also. what is my end mistake, please help me on this. Thanks, kumar raj

  • You need to define more clearly what is it that you exactly want. Do you want to combine these two Ethernet domains on the separate hosts into one broadcast domain? Do you want to route traffic between the two Ethernet networks on the different hosts? – Tero Kilkanen Jul 7 '15 at 12:49
  • Anyway, one big problem in this configuration is the netmask you are using. The netmask 255.255.0.0 covers all the IP networks you have in your hosts, and therefore no routing is performed on traffic between those hosts. – Tero Kilkanen Jul 7 '15 at 12:50
  • Hello,thanks for suggestions. It is two ubuntu hosts both have above interface and ip address. I tried to create tunnel using tun, but not able to success in createing it. Alsi when I run openvpn,it creates following error, " Linux ifconfig failed: could not execute external program Exiting ". Why the eroor comes please advice me. – user680288 Jul 8 '15 at 7:36
  • It is still too vague what exactly you want. A network diagram would help with understanding the main goal. – Tero Kilkanen Jul 8 '15 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.