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: eth1:

Server host interface details, eth0: eth1:

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
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

push "route"
push "redirect-gateway def1 bypass-dhcp"

keepalive 10 120

cipher BF-CBC

max-clients 10
keepalive 10 120

status openvpn-status.log

verb 3

;mute 20

At client.conf,

dev tap0
port 1194
remote 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

keepalive 10 60

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 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.