Ubuntu VPN server & Clients

...hardware-drivers για servers & thin clients(web, ftp, κλπ)

Συντονιστής: the_eye

Ubuntu VPN server & Clients

Δημοσίευσηαπό kostastd » 09 Φεβ 2012, 13:43

Καλημέρα,

Έχω στήσει ένα VPN server (PPTP) σε Ubuntu 10.04.3 TLS. Όλα λειτουργούν άψογα. Όλοι οι Clients που τρέχουν Windows 7, MAC os x, Windows XP και Ubuntu 11.10 μπορούν να συνδεθούν
στον VPN Server και επίσης όλοι οι Client μπορούν να δούν τα κοινόχρηστα αρχεία του server. Οι IPs έχουν οριστεί ως εξής:
IP SERVER : 10.0.0.1
IP CLIENT : 10.0.0.8-100

2 απορίες/ερωτήσεις

1) 2 Clients που συνδέονται από το ίδιο router στον VPN server παίρνουν την ίδια IP, 10.0.0.8, Πώς γίνεται να παίρνει το κάθε PC διαφορετική IP; Όταν συνδέω 3 PC από 3 διαφορετικά router δεν υπάρχει πρόβλημα.
Παίρνουν σωστές IPs 10.0.0.8 - 9 - 10.

2) Τι ρυθμίσεις πρέπει να κάνω για να μπορούν να κάνουν file sharing οι clients μεταξύ τους μέσω VPN; Επίσης ο VPN server δεν μπορεί να δει τους shared folders των clients.

Ευχαριστώ
Ubuntu Mate 16.04 LTS 64bit
Προδιαγραφές ⇛ Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz│RAM 3GB│intel GMA 4500 │ Μητρική: D2824-A1│HD: SSD 120G - WD 160GB
Άβαταρ μέλους
kostastd
babeTUX
babeTUX
 
Δημοσιεύσεις: 74
Εγγραφή: 03 Μαρ 2009, 00:09
Εκτύπωση

Re: Ubuntu VPN server & Clients

Δημοσίευσηαπό sanctusmob » 16 Φεβ 2012, 23:26

Καλησπέρα...

Για το 1) δοκίμασε να βάλεις στο server.conf το παρακάτω
ifconfig-pool-persist iplist.txt 10 ##Στο dhcp section

Για το 2) θα πρέπει να μας δώσεις μερικές πληροφορίες ακόμη...
Ποιο είναι το network που είναι ο server και οι client. Τα route είναι σωστά στους client? Τα route είναι σωστά στον server?
Πως προσπαθείς να δεις τα shared folders? κτλ κτλ
-------------------------

There are 10 types of people in the world:
Those who understand binary, and those who don't...

-------------------------
Άβαταρ μέλους
sanctusmob
babeTUX
babeTUX
 
Δημοσιεύσεις: 73
Εγγραφή: 29 Οκτ 2009, 22:37
IRC: The-mob
Εκτύπωση

Re: Ubuntu VPN server & Clients

Δημοσίευσηαπό kostastd » 17 Φεβ 2012, 07:50

Λοιπόν,
Το 1 λύθηκε από μόνο του....μάλλον είχε φάει κόλλημα το webmin...anyway.

2) Τελικά κατάφερα να βλέπει ο server τους clients. Οι clients με Linux και Mac δεν έιχαν πρόβλημα και τους βλέπει ο server με samba χωρίς προβλήματα. Οι Clients με windows 7 και XP Απλά θέλανε ανοιχτά ports 1723 & 445 στο inbound. Επομένος, αυτό που έμεινε τώρα είναι να κάνω file sharing μεταξύ των clients με samba. Αυτή την στιγμή δεν μπορω να κάνω ping από client σε client.

Ο Server έχει IP 10.0.0.1 και οι clients 10.0.0.10-100. To router του server είναι 192.168.2.1 και το router των clients είναι 192.168.1.254.

Όσον αφορά τα routes, μάλλον εκεί έχω μαύρα μεσάνυχτα. Αν μπορείς να μου πεις τι πρέπει να ψάξω σχετικά με τα routes θα με βοηθούσε πολύ.
Το File Sharing θα γίνεται με Samba.

Ευχαριστώ
Ubuntu Mate 16.04 LTS 64bit
Προδιαγραφές ⇛ Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz│RAM 3GB│intel GMA 4500 │ Μητρική: D2824-A1│HD: SSD 120G - WD 160GB
Άβαταρ μέλους
kostastd
babeTUX
babeTUX
 
Δημοσιεύσεις: 74
Εγγραφή: 03 Μαρ 2009, 00:09
Εκτύπωση

Re: Ubuntu VPN server & Clients

Δημοσίευσηαπό sanctusmob » 17 Φεβ 2012, 09:44

<<Το 1 λύθηκε από μόνο του>>
Τίποτα δεν λύνεται από μόνο του. Ήταν δύσκολο να γίνεται αυτό που έλεγες.

<<μάλλον είχε φάει κόλλημα το webmin>>
To webmin δεν τρώει κολλήματα (και δεν κατάλαβα που κολλάει το webmin) , αλλά κάνε remove όπως και να έχει.

<<Τελικά κατάφερα να βλέπει ο server τους clients.>>
Μάλλον θέλεις να πεις οι client βλέπουν τον server.

<<Τελικά κατάφερα να βλέπει ο server τους clients. Οι clients με Linux και Mac δεν έιχαν πρόβλημα και τους βλέπει ο server με samba χωρίς προβλήματα. Οι Clients με windows 7 και XP Απλά θέλανε ανοιχτά ports 1723 & 445 στο inbound. Επομένος, αυτό που έμεινε τώρα είναι να κάνω file sharing μεταξύ των clients με samba.>>
Τι θέλεις ακριβός να κάνεις? Γιατί από ότι έχω καταλάβει έχεις κάνει samba share σε κάθε pc που είναι στο vpn...? Αν όντως έχεις κάνει έτσι να σου θυμίσω πως έχεις έναν server που εκτός από vpn μπορεί να κάνει και άλλα... όπως samba share.

<<Αυτή την στιγμή δεν μπορω να κάνω ping από client σε client.>>
Θα σε βοηθήσω αν μου πεις λεπτομέρειες...

Άρα έχουμε τον server στο δίκτυο 192.168.2.0/24 (υποθέτω) και με ip ας πούμε 192.168.2.250.
Έχουμε τους client στο δίκτυο 192.168.1.0/24 (υποθέτω) και με ip ας πούμε pc1 192.168.1.10 , pc2 192.168.1.11 , pc3 192.168.1.12.
Και το vpn με 10.0.0.0/24 με τον server 10.0.0.1 και τους client από 10.0.0.10-100.

Αν ξεκινήσουμε με το γιατί κάνουμε χρήση του vpn... Χρήση vpn κάνουμε όταν θέλουμε ένα απομακρυσμένος client να κάνει χρήση τον τοπικών μας πόρων. π.χ. έχουμε στην εταιρία τον server με το vpn και με δίκτυα και ips όπως αναφέρω παραπάνω. και έστω ότι μπαίνει στο vpn το pc1. Αυτό σημαίνει πως το pc1 έχει πρόσβαση στο server μέσω του tunnel του vpn και μέσω της ip 192.168.2.250 . (όπως και σε όλους τους πόρους που ανήκουν στο δίκτυο 192.168.2.0) Υποψιάζομαι πως εσύ κάνεις χρήση του δικτύου 10.0.0.0.

θα πρέπει να έχεις βάλει static route... στο server.conf ( κάτι τέτοιο push "route 192.168.2.0 255.255.255.0" )
Αν θέλεις δείξε μας το server.conf (αφαιρώντας ότι δεν θέλεις να δούμε)

Υ.Γ. Όλες οι υπηρεσίες θα πρέπει να τρέχουν στον server και όλοι οι client να συνδέονται σε αυτών και όχι να τρέχουν υπηρεσίες σε κάθε client και να επικοινωνούν οι client μεταξύ τους μέσω του server.
-------------------------

There are 10 types of people in the world:
Those who understand binary, and those who don't...

-------------------------
Άβαταρ μέλους
sanctusmob
babeTUX
babeTUX
 
Δημοσιεύσεις: 73
Εγγραφή: 29 Οκτ 2009, 22:37
IRC: The-mob
Εκτύπωση

Re: Ubuntu VPN server & Clients

Δημοσίευσηαπό kostastd » 19 Φεβ 2012, 02:04

http://imageshack.us/photo/my-images/94/mynetb.jpg
http://imageshack.us/photo/my-images/54 ... ctions.jpg
http://imageshack.us/photo/my-images/715/pptpserver.png
http://imageshack.us/photo/my-images/81 ... hernet.png

Κοίταξε τις Photo και μάλλον θα γίνω πιο κατανοητός.

Όλες οι υπηρεσίες στον server λειτουργούν μια χαρά μέσω VPN (apache, ftp, webmin).

1) Δηλαδή μπορώ να κάνω file sharing μεσω vpn χωρίς να είναι απαραίτητη η samba? Επειδή υπάρχουν 3 Oper.systems ρωτάω.

2)Από τον server μπορώ να δω όλα τα shared folders σε όλα τα PC. Από όλους τους Clients μπορώ να δω τον shared folder του server. Αυτό που δεν μπορώ να δω είναι ένα shared folder ενός client από άλλον Client.

3) Υπάρχει server.conf στο PPTPD? Που βρίσκεται αυτό; Μόνο στο Open VPN θυμάμαι server.conf.


ΥΓ. Η όλη κατάσταση είναι εντελώς για εκπαίδευση.
Ubuntu Mate 16.04 LTS 64bit
Προδιαγραφές ⇛ Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz│RAM 3GB│intel GMA 4500 │ Μητρική: D2824-A1│HD: SSD 120G - WD 160GB
Άβαταρ μέλους
kostastd
babeTUX
babeTUX
 
Δημοσιεύσεις: 74
Εγγραφή: 03 Μαρ 2009, 00:09
Εκτύπωση

Re: Ubuntu VPN server & Clients

Δημοσίευσηαπό kostastd » 19 Φεβ 2012, 03:29

Αυτό είναι το config του server

Κώδικας: Επιλογή όλων
###############################################################################
# $Id: pptpd.conf 4255 2004-10-03 18:44:00Z rene $
#
# Sample Poptop configuration file /etc/pptpd.conf
#
# Changes are effective when pptpd is restarted.
###############################################################################

# TAG: ppp
#   Path to the pppd program, default '/usr/sbin/pppd' on Linux
#
#ppp /usr/sbin/pppd

# TAG: option
#   Specifies the location of the PPP options file.
#   By default PPP looks in '/etc/ppp/options'
#
option   /etc/ppp/pptpd-options

# TAG: debug
#   Turns on (more) debugging to syslog
#
debug

# TAG: stimeout
#   Specifies timeout (in seconds) on starting ctrl connection
#
# stimeout 10

# TAG: noipparam
#       Suppress the passing of the client's IP address to PPP, which is
#       done by default otherwise.
#
#noipparam

# TAG: logwtmp
#   Use wtmp(5) to record client connections and disconnections.
#
logwtmp

# TAG: bcrelay <if>
#   Turns on broadcast relay to clients from interface <if>
#
#bcrelay eth1

# TAG: localip
# TAG: remoteip
#   Specifies the local and remote IP address ranges.
#
#       Any addresses work as long as the local machine takes care of the
#       routing.  But if you want to use MS-Windows networking, you should
#       use IP addresses out of the LAN address space and use the proxyarp
#       option in the pppd options file, or run bcrelay.
#
#   You can specify single IP addresses seperated by commas or you can
#   specify ranges, or both. For example:
#
#      10.0.0.1-254
#
#   IMPORTANT RESTRICTIONS:
#
#   1. No spaces are permitted between commas or within addresses.
#
#   2. If you give more IP addresses than MAX_CONNECTIONS, it will
#      start at the beginning of the list and go until it gets
#      MAX_CONNECTIONS IPs. Others will be ignored.
#
#   3. No shortcuts in ranges! ie. 234-8 does not mean 234 to 238,
#      you must type 234-238 if you mean this.
#
#   4. If you give a single localIP, that's ok - all local IPs will
#      be set to the given one. You MUST still give at least one remote
#      IP for each simultaneous client.
#
# (Recommended)
localip   10.0.0.1
remoteip   10.0.0.10-100
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245
Ubuntu Mate 16.04 LTS 64bit
Προδιαγραφές ⇛ Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz│RAM 3GB│intel GMA 4500 │ Μητρική: D2824-A1│HD: SSD 120G - WD 160GB
Άβαταρ μέλους
kostastd
babeTUX
babeTUX
 
Δημοσιεύσεις: 74
Εγγραφή: 03 Μαρ 2009, 00:09
Εκτύπωση

Re: Ubuntu VPN server & Clients

Δημοσίευσηαπό kostastd » 19 Φεβ 2012, 03:56

/etc/ppp/pptpd-options

Κώδικας: Επιλογή όλων
###############################################################################
# $Id: pptpd-options 4643 2006-11-06 18:42:43Z rene $
#
# Sample Poptop PPP options file /etc/ppp/pptpd-options
# Options used by PPP when a connection arrives from a client.
# This file is pointed to by /etc/pptpd.conf option keyword.
# Changes are effective on the next connection.  See "man pppd".
#
# You are expected to change this file to suit your system.  As
# packaged, it requires PPP 2.4.2 and the kernel MPPE module.
###############################################################################


# Authentication

# Name of the local system for authentication purposes
# (must match the second field in /etc/ppp/chap-secrets entries)
name pptpd

# Optional: domain name to use for authentication
# domain mydomain.net

# Strip the domain prefix from the username before authentication.
# (applies if you use pppd with chapms-strip-domain patch)
#chapms-strip-domain


# Encryption
# Debian: on systems with a kernel built with the package
# kernel-patch-mppe >= 2.4.2 and using ppp >= 2.4.2, ...
# {{{
# Require the peer to authenticate itself using MS-CHAPv2 [Microsoft
# Challenge Handshake Authentication Protocol, Version 2] authentication.
require-mschap-v2
# Require MPPE 128-bit encryption
# (note that MPPE requires the use of MSCHAP-V2 during authentication)
# }}}




# Network and Routing

# If pppd is acting as a server for Microsoft Windows clients, this
# option allows pppd to supply one or two DNS (Domain Name Server)
# addresses to the clients.  The first instance of this option
# specifies the primary DNS address; the second instance (if given)
# specifies the secondary DNS address.
# Attention! This information may not be taken into account by a Windows
# client. See KB311218 in Microsoft's knowledge base for more information.
#ms-dns 10.0.0.1
#ms-dns 10.0.0.2

# If pppd is acting as a server for Microsoft Windows or "Samba"
# clients, this option allows pppd to supply one or two WINS (Windows
# Internet Name Services) server addresses to the clients.  The first
# instance of this option specifies the primary WINS address; the
# second instance (if given) specifies the secondary WINS address.
#ms-wins 10.0.0.3
#ms-wins 10.0.0.4

# Add an entry to this system's ARP [Address Resolution Protocol]
# table with the IP address of the peer and the Ethernet address of this
# system.  This will have the effect of making the peer appear to other
# systems to be on the local ethernet.
# (you do not need this if your PPTP server is responsible for routing
# packets to the clients -- James Cameron)
proxyarp

# Debian: do not replace the default route
nodefaultroute


# Logging

# Enable connection debugging facilities.
# (see your syslog configuration for where pppd sends to)
debug

# Print out all the option values which have been set.
# (often requested by mailing list to verify options)
#dump


# Miscellaneous

# Create a UUCP-style lock file for the pseudo-tty to ensure exclusive
# access.

# Disable BSD-Compress compression
nobsdcomp
auth
refuse-mschap
require-mppe-128
refuse-pap
refuse-chap
lock
Ubuntu Mate 16.04 LTS 64bit
Προδιαγραφές ⇛ Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz│RAM 3GB│intel GMA 4500 │ Μητρική: D2824-A1│HD: SSD 120G - WD 160GB
Άβαταρ μέλους
kostastd
babeTUX
babeTUX
 
Δημοσιεύσεις: 74
Εγγραφή: 03 Μαρ 2009, 00:09
Εκτύπωση

Re: Ubuntu VPN server & Clients

Δημοσίευσηαπό sanctusmob » 19 Φεβ 2012, 14:34

1) Δηλαδή μπορώ να κάνω file sharing μεσω vpn χωρίς να είναι απαραίτητη η samba? Επειδή υπάρχουν 3 Oper.systems ρωτάω.

Δεν κατάλαβα ακριβός τι θέλεις να πείς εδώ. Αυτό που σου είπα είναι πως θα πρέπει να υπάρχει ένα samba shared στον server ή παραπάνω ανάλογα με τις ανάγκες σου και όλοι οι client να συνδέονται σε αυτό (όχι ο κάθε client να έχει ένα samba share). Και το ftp είναι ένας τρόπος να έχεις κοινόχρηστους κάποιους πόρους του συστήματος σου. Το τι πρωτόκολλο θα κάνεις χρήση για να βλέπεις τους κοινόχρηστους πόρους είναι δικό σου θέμα.

2)Από τον server μπορώ να δω όλα τα shared folders σε όλα τα PC. Από όλους τους Clients μπορώ να δω τον shared folder του server. Αυτό που δεν μπορώ να δω είναι ένα shared folder ενός client από άλλον Client.

Θέλω να μου πεις θα εξής σύμφωνα με πλάνο σου.
Από το pc 4 να κάνεις σε command prompt
ping 192.168.2.4
ping 10.0.0.14
start \\192.168.2.4\ΌνομαΚοινόχρηστουΦακέλου
start \\10.0.0.14\ΌνομαΚοινόχρηστουΦακέλου

Και στον server σου το routing table
route

3) Υπάρχει server.conf στο PPTPD? Που βρίσκεται αυτό; Μόνο στο Open VPN θυμάμαι server.conf.

Ναι δεν είχε προσέξει ότι μιλάς για PPTD... όσα σου έλεγα αφορούσαν το OpenVPN...
Δεν έχω ασχοληθεί ποτέ με PPPTD ( μόνο με OpenVPN όπως κατάλαβες ).

Παρόλα αυτά θα το κοιτάξω και αν βρω κάτι θα σε ενημερώσω.
-------------------------

There are 10 types of people in the world:
Those who understand binary, and those who don't...

-------------------------
Άβαταρ μέλους
sanctusmob
babeTUX
babeTUX
 
Δημοσιεύσεις: 73
Εγγραφή: 29 Οκτ 2009, 22:37
IRC: The-mob
Εκτύπωση


  • ΣΧΕΤΙΚΑ ΘΕΜΑΤΑ
    ΑΠΑΝΤΗΣΕΙΣ
    ΠΡΟΒΟΛΕΣ
    ΣΥΓΓΡΑΦΕΑΣ

Επιστροφή στο Servers & Thin Clients

cron