LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-15-2010, 06:48 AM   #16
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57

Quote:
Originally Posted by maceee View Post
right..
All keys and cert has been generated and are working for sure.
At client side there is the ovpn file alongside with correct keys and cert, else client would not be able to connect at all.
So it is not this kind of problem.
so it means that you try with 3 pc on the network:

1 x server pc
1 x client pc
1 x another client box pc
??
 
Old 01-15-2010, 06:51 AM   #17
maceee
Member
 
Registered: Nov 2008
Posts: 93

Original Poster
Rep: Reputation: 18
that's right....
first client connects successfully..i get ip correctly and ping also gateway BUT when second client connects, first client while he keeps be connected, he doesn;t ping gateway and no internet at all.
Maybe a DHCP problem?
I can;t really figure out
 
Old 01-15-2010, 07:33 AM   #18
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
Quote:
Originally Posted by maceee View Post
that's right....
first client connects successfully..i get ip correctly and ping also gateway BUT when second client connects, first client while he keeps be connected, he doesn;t ping gateway and no internet at all.
Maybe a DHCP problem?
I can;t really figure out
I recall that you can run the server with a debugging tail in the xterm. ... that should tell you whats happening whne the 2 logs in...

but you know, i have the impression lookingthe openvpn debug tail running that it locks itself , the openvpn server, wehne one client accesses... you see it as if in the xterm ...

pitty that no one can help you on hte board. It is too difficult things for regular users.
 
Old 01-15-2010, 08:02 AM   #19
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Are you by chance using the same cert for each client? I know that if you use the same client cert for multiple clients it will kick one out, you might want to check that. Here is my working config, look at the notes and look at my settigns, it should be a good guide. My setup is a bridged setup using a tap device, not a tun device.
Code:
# Which local IP address should OpenVPN
# listen on? (optional)
local 192.168.100.11

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# TCP or UDP server?
proto udp

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
dev tap0

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca /etc/openvpn/keys/hesco/ca.crt
cert /etc/openvpn/keys/hesco/hesco-server.crt
key /etc/openvpn/keys/hesco/hesco-server.key  # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys. 
dh /etc/openvpn/keys/hesco/dh2048.pem

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 192.168.100.12 255.255.255.0 10.8.0.50 10.8.0.100

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
server-bridge

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
push "route 192.168.168.0 255.255.255.0"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
cipher AES-128-CBC   # AES


# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
user nobody
group nogroup

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3

# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20
 
Old 01-15-2010, 08:04 AM   #20
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Cahnging the verbosity of the log to the highest or second highest (4 or 5) might also help as you could see what is going on better, meybe even post teh log where you see the error and we might be able to assist if you don't understand it.
 
Old 01-15-2010, 08:16 AM   #21
beadyallen
Member
 
Registered: Mar 2008
Location: UK
Distribution: Fedora, Gentoo
Posts: 209

Rep: Reputation: 36
As has been pointed out, you're using 'dev tap', which is used for ethernet bridging. However, you also used the 'server' option, not 'server-bridge'. So, do you want a bridge or routed VPN?
Basically it comes down to whether or not you want your external clients to 'become' part of your internal lan, (i.e. if you have an internal lan of 192.168.0.0/24 the external clients will get an ip in that range so that things like broadcast addresses (and hence netbios names in SAMBA) will work properly). Extra configuration is required for a bridged VPN, since you have to set up the bridge device that combines openvpn's tap device, and the local network interface.

Unless you explicitly need the above, you're probably alright with a routed VPN ('dev tun' and 'server'). In this case, assuming an internal lan of 192.168.0.0/24, your server and each of the clients gets another ip (say from the 10.8.0.0/24). Each client then has direct access to the server only, and uses the server as a router to access the internal network.

Apart from the confusion about tun/tap and server/server-bridge your config files look okay. It's really not that hard to configure openvpn, and the official openvpn howto is excellent, but it's very important to understand exactly what you want to achieve with it.

Post back if you're still confused, and I'm sure I would be trying to absorb the stuff above for the first time.

edit: Beaten to it

Last edited by beadyallen; 01-15-2010 at 08:18 AM.
 
Old 01-15-2010, 12:20 PM   #22
maceee
Member
 
Registered: Nov 2008
Posts: 93

Original Poster
Rep: Reputation: 18
thank you for your answer.
Can you kindly post your client conf and route table of yourr server
Many thnks in advance
 
Old 01-15-2010, 01:03 PM   #23
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Here is the server route printout
Code:
192.168.100.0   *               255.255.255.0   U     0      0        0 eth1
192.168.100.0   *               255.255.255.0   U     0      0        0 br0
default         192.168.100.1   0.0.0.0         UG    0      0        0 br0
default         192.168.100.1   0.0.0.0         UG    0      0        0 eth1
This is my client conf, but mind you these are Windows clients.
Code:
# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client

# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
dev tap

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one.  On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
dev-node HESCOVPN

# Are we connecting to a TCP or
# UDP server?  Use the same setting as
# on the server.
proto udp

# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote ip.address.of.server 1194

# Keep trying indefinitely to resolve the
# host name of the OpenVPN server.  Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite

# Most clients don't need to bind to
# a specific local port number.
nobind

# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nogroup

# Try to preserve some state across restarts.
persist-key
persist-tun

# Wireless networks often produce a lot
# of duplicate packets.  Set this flag
# to silence duplicate packet warnings.
mute-replay-warnings

# SSL/TLS parms.
# See the server config file for more
# description.  It's best to use
# a separate .crt/.key file pair
# for each client.  A single ca
# file can be used for all clients.
ca ca.crt
cert client.crt
key client.key

# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to "server".  This is an
# important precaution to protect against
# a potential attack discussed here:
#  http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to "server".  The build-key-server
# script in the easy-rsa folder will do this.
ns-cert-type server

# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
cipher AES-128-CBC 

# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
comp-lzo

# Set log file verbosity.
verb 3

# Silence repeating messages
;mute 20
 
Old 01-15-2010, 01:08 PM   #24
maceee
Member
 
Registered: Nov 2008
Posts: 93

Original Poster
Rep: Reputation: 18
yes but i have no eth interface at 192.168.100.0 range which is my vpn server
 
Old 01-15-2010, 02:17 PM   #25
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
So what does that matter, any private IP network will do, for instance your routes will look like 192.168.13.x if you are using 13 as your subnet. My configuration only even references 192.168.100.x anything one and that is the interface for teh server to listen on, that ip address is supposed to be the ip address of your VPN Server. I almost guarantee you if you take my configurations and plug them in, then add a tap device on your clients that this will work. (P.S. use a bridge script to setup your bridge (br0) on your sever)
 
Old 01-15-2010, 02:23 PM   #26
maceee
Member
 
Registered: Nov 2008
Posts: 93

Original Poster
Rep: Reputation: 18
thank you very much for your reply.
The only i do not know the how to is the bridge scritpt.
Can you kindly point a how to

many thanks
 
Old 01-15-2010, 03:21 PM   #27
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
http://www.google.com/#hl=en&source=...82d86320cf60e9

try any number of these links.
 
Old 01-16-2010, 05:30 AM   #28
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
Quote:
Originally Posted by maceee View Post
thank you very much for your reply.
The only i do not know the how to is the bridge scritpt.
Can you kindly point a how to

many thanks
Once you are finished with the installation of openvpn, and you finally find the way to make it, would you be interested to contribute together on an installer. Look here it is work in progress... so that you add your part regarding Openvpn. (Shot)
Quote:
cd /tmp
wget "http://easyldap.exofire.net/files/installer/easyldap-installer.sh"
sudo easyldap-installer.sh
Cheers

Last edited by frenchn00b; 01-16-2010 at 05:32 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenVPN] Tomato + Ubuntu pi314 Linux - Networking 2 04-22-2010 01:19 PM
OpenVPN configuration on Ubuntu 8.04 Server ice13berg Linux - Server 1 05-03-2009 10:05 AM
OpenVPN on Ubuntu 8.04 depam Linux - Software 1 08-09-2008 11:00 PM
OpenVPN client on Ubuntu rose_bud4201 Linux - Networking 2 01-31-2008 06:38 PM
pls pls pls help me ! i'm tired with httpd config on fedora apache 2.0.48 AngelOfTheDamn Fedora 0 01-24-2004 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration