Vai al contenuto
PLC Forum


. VPN


telnet84

Messaggi consigliati

Salve ragazzi... questa volta non so proprio da dove iniziare... ho bisogno di un immensa mano.ù

Ho un plc wago modello 750-8100 con uscita ethernet, mi hanno detto che è client VPN.. 

Se vado nella pagina di gestione trovo quello allegato in foto..

 

Ora dovrei fare una VPN tra lui che si trova in un luogo A e un pc che si trova in luogo B..

Il problema che non so da dove iniziare... 

 

Mi date una mano per cortesia devo uscirne fuori..

Grazie anticipatamente.

 

VPN.JPG

Link al commento
Condividi su altri siti


Beh, direi che gestisce connessioni OpenVPN e IPsec. Quindi dal lato dove hai il PC occorre che il firewall, o comunque un oggetto dentro la rete, faccia da server VPN con uno di questi protocolli.

Per semplicità sarebbe meglio demandare al router questa funzione, anche perchè poi occorre dichiarare una rotta per far si che la SEDE A comunichi con il PLC della SEDE B

Link al commento
Condividi su altri siti

Grazie @Andrea Annoni per lo meno mi hai chiarito un minimo le idee..

In poche parole io con un semplice pc e il programma openVPN non potrei gestire una cosa del genere, avrei bisogno di un router che gestica questa questa connessione VPN.

Se ho capito bene sapresti consigliarmi qualcosa, perchè in tal caso non penso che un semplice router telecom possa andare bene...

Un ultima cosa dal lato del plc oltre alla configurazione come client non ho bisogno di nulla, solo del plc collegato ad internet!!??

 

 

Link al commento
Condividi su altri siti

Se vuoi uare direttamente il PC per far atterrare anche la VPN devi installare un software che ti permetta di fare server VPN. Io non ne consoco ma non escludo che esistano.

E poi vanno aperte le porte della VPN utilizzate sul router verso il PC. Secondo me non è proprio un lavoro "elegante"....più che altro perchè è poco sicuro far accedere in VPN a una PC.

 

Io uso i router di Mikrotik che gestiscono tutte le VPN (sia client che server) e sono molto versatili. Praticamente puoi fare tutto quello che vuoi.

 

Se l'obbiettivo è accedere al PLC per configurarlo no, non ti serve altro.

Link al commento
Condividi su altri siti

Tutti i MikroTik hanno stesse funzioni. Utilizzano tutti il sistema operativo RouterOS.

 

cambiano le prestazioni; se devi solo gestire un tunnel vpn va bene anche quello.

Anche se in genere io consiglio almeno un RB952

Link al commento
Condividi su altri siti

Ora ti faccio un altra domanda mettiamo che debba inserire in questa configurazione un altro pc che si trova in un luogo C riesco a vedere il plc installando il mikrotik con la vpn server nella rete del computer B dal luogo C ??

 

In alternativa non converrebbe prendere un VPS server cloud e configurare il server lì?

 

 

Link al commento
Condividi su altri siti

Sul plc dovrai dichiarare l’IP del server..... se il router lo sposti da B a C cambia l’indirizzo.

puoi però lasciare il router in B e accedere da altre postazioni o con altri tunnel o pubblicando le porte (non bellissimo).

 

Altrimenti si, puoi realizzare una VPS (magari con il CHR MikroTik) e fargli fare da concentratore delle VPN 

Link al commento
Condividi su altri siti

del_user_212017

Non ho compreso bene:

il PLC che è anche client VPN sta in luogo A e poi hai due PC in luogo B e luogo C e da B e da C vuoi accedere al PLC in A ?

Il client VPN si connette del PLC in A si collega ad un VPN server solo alla volta.

Se presso il PLC in A c'è qualcuno che cambia la configurazione alla bisogna, puoi farlo, se no la vedo dura perche cambiare la config da remoto .. se qualcosa poi non va, ti tagli le gambe da solo.

Se accendi il VPN server in B, allora il PLC può collegarsi verso B e da C puoi aprire un'altra sessione verso il server in B.

Diversamente ancora puoi accendere un VPN server in A e aprire tutte le sessioni che vuoi verso A da qualsiasi parte. Allo scopo un banale Raspberry con su OpenVPN basta e avanza a meno che il router di A non offra già out of the box la funzione.

Link al commento
Condividi su altri siti

Ciao @stef70 grazie per aver risposto.. 

Si il mio obiettivo é quello di poter accedere diciamo da B e C verso il plc tenendo conto che i due PC e il plc si trovo o tutti in luoghi diversi.. 

 

Sto cercando di capire con il vostro prezioso aiuto quale sia la soluzione migliore... Avevo sentito parlare anche di server VPS in cloud che gestisca la vpn ma non so da dove iniziare... 

 

Link al commento
Condividi su altri siti

del_user_212017

OK.

Ma la rete LAN dove sono ubicati i "pezzi" A, B, C, etc... di chi è? è tua? chi la gestisce? è esposta su internet? come è esposta? con un firewall? c'è un proxy? chi sa se i protocolli passano?

Posso dirti come gestiscono i PLC i nostri fornitori.

Abbiamo 40 stabilimenti con PLC e altra roba e diversi fornitori ciascuno manutiene i propri.

Tutti gli stabilimenti si vedono tra di loro in LAN

Nel sito principale c'è un firewall che collega la LAN con la rete pubblica e il firewall fa da terminatore VPN IPSec

Il fornitore pippo si collega in VPN IPSec con noi, viene profilato ovvero il frewall lo fa andare solo sui suoi PLC e così via gli altri fornitori.

Chiaro che la tua situazione è molto diversa a livello di volumi... ma il principio è lo stesso identico.

 

Il VPS trattasi di un Virtual Private Server ovvero un server tutto tuo, virtuale, nel cloud di Amazon, Google, Aruba, 1and1 o dei mille altri fornitori.

Questo VPS e esposto su internet di suo. Potrebbe essere la soluzione, ma prima conviene capire meglio la architettura di rete di A B e C

Modificato: da stef70
Link al commento
Condividi su altri siti

Se vuoi usare direttamente il PLC sei obbligato a usare OpenVPN o IPsec.  Te testare se OpenVPN puoi farla girare su porte differenti (qual'ora non dovesse funzionare sulle standard), ma presumo di si dato che è una semplice importazione della conf.

Le soluzioni sono molteplici; dipende un po' dal tuo grado di consocenza delle reti.

 

Quella che ritengo più "semplice" è mettere un router che fa anche VPN server (come dicevo io uso Mikrotik) in uno dei due siti che hanno un IP pubblico.

Il PLC fa da client verso questo router; viene dichirata poiuna rotta in modo che la subnet del sito  veda il PLC direttamente ( a tua scelta se con NAT o con rotte di ritorno per essere trasparente).

Gli eventuali altri PC o siti che devono vedere il PLC posso fare una VPN verso il sito dove c'è il server VPN e vedere il PLC. Oppure ancora pubblicare delle porte che attrvaerso una destination-nat ruotano le richieste sul PLC.

 

La condizione migliore e semplificata è che i due siti abbiano subnet differenti per evitare overlapping; che comunque sarebbe gestibile ma bisognerebbe giocare con le chain dei router.

 

 

 

 

Il costo dell'operazione può anche essere di solo 20€ per un hAP-Lite; qualcuno si è azzardato a fare servizi del genere con un RB931 da 10€.  L'ideale a mio parere è un RB952 che è già in architettura ARM e costa sulle 40€.

Link al commento
Condividi su altri siti

Salve ragazzi, rieccomi a rompere le scatole..

Diciamo che per il momento ho seguito il consiglio di @Andrea Annoni...

Ho acquistato un router mikrotik nello specifico un Hap lite anche solo per sperimentare e provare.

Volevo provare a fare una vpn per raggiungere il plc.

Ho seguito questa  guida per la configurazione ma al momento della connessione open vpn mi resta così... 

 

 

Sun Nov 08 17:38:48 2020 Current Parameter Settings:
Sun Nov 08 17:38:48 2020   config = 'client.ovpn'
Sun Nov 08 17:38:48 2020   mode = 0
Sun Nov 08 17:38:48 2020   show_ciphers = DISABLED
Sun Nov 08 17:38:48 2020   show_digests = DISABLED
Sun Nov 08 17:38:48 2020   show_engines = DISABLED
Sun Nov 08 17:38:48 2020   genkey = DISABLED
Sun Nov 08 17:38:48 2020   key_pass_file = '[UNDEF]'
Sun Nov 08 17:38:48 2020   show_tls_ciphers = DISABLED
Sun Nov 08 17:38:48 2020   connect_retry_max = 0
Sun Nov 08 17:38:48 2020 NOTE: --mute triggered...
Sun Nov 08 17:38:48 2020 285 variation(s) on previous 10 message(s) suppressed by --mute
Sun Nov 08 17:38:48 2020 OpenVPN 2.4.9 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Apr 16 2020
Sun Nov 08 17:38:48 2020 Windows version 6.2 (Windows 8 or greater) 64bit
Sun Nov 08 17:38:48 2020 library versions: OpenSSL 1.1.1f  31 Mar 2020, LZO 2.10
Sun Nov 08 17:38:48 2020 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Sun Nov 08 17:38:48 2020 Need hold release from management interface, waiting...
Sun Nov 08 17:38:48 2020 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Sun Nov 08 17:38:48 2020 MANAGEMENT: CMD 'state on'
Sun Nov 08 17:38:48 2020 MANAGEMENT: CMD 'log all on'
Sun Nov 08 17:38:48 2020 MANAGEMENT: CMD 'echo all on'
Sun Nov 08 17:38:48 2020 MANAGEMENT: CMD 'bytecount 5'
Sun Nov 08 17:38:48 2020 MANAGEMENT: CMD 'hold off'
Sun Nov 08 17:38:48 2020 MANAGEMENT: CMD 'hold release'
Sun Nov 08 17:38:53 2020 MANAGEMENT: CMD 'password [...]'
Sun Nov 08 17:38:53 2020 Control Channel MTU parms [ L:1623 D:1210 EF:40 EB:0 ET:0 EL:3 ]
Sun Nov 08 17:38:53 2020 Data Channel MTU parms [ L:1623 D:1450 EF:123 EB:406 ET:0 EL:3 ]
Sun Nov 08 17:38:53 2020 Local Options String (VER=V4): 'V4,dev-type tun,link-mtu 1559,tun-mtu 1500,proto TCPv4_CLIENT,cipher AES-256-CBC,auth SHA1,keysize 256,key-method 2,tls-client'
Sun Nov 08 17:38:53 2020 Expected Remote Options String (VER=V4): 'V4,dev-type tun,link-mtu 1559,tun-mtu 1500,proto TCPv4_SERVER,cipher AES-256-CBC,auth SHA1,keysize 256,key-method 2,tls-server'
Sun Nov 08 17:38:53 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]192.168.1.198:1194
Sun Nov 08 17:38:53 2020 Socket Buffers: R=[65536->65536] S=[65536->65536]
Sun Nov 08 17:38:53 2020 Attempting to establish TCP connection with [AF_INET]192.168.1.198:1194 [nonblock]
Sun Nov 08 17:38:53 2020 MANAGEMENT: >STATE:1604853533,TCP_CONNECT,,,,,,

Dove sbaglio, datemi per cortesia una mano perchè vorrei almeno riuscire a fare questa cavolo  di VPN..

Grazie in anticipo.

Modificato: da telnet84
Link al commento
Condividi su altri siti

Su OpenVPN la parte più "complessa" è la generazione dei certificati.

Nei LOG del Mikrotik cosa vedi? è li che trovi il problema e la soluzione.

 

Penso che la guida che hai messo nel link sia corretta; ma io trovo più sbrigativo farlo a "manina".

Per prima cosa resetta il Mikrotik e assicurati di rimuovere la default conf (altrimenti hai anche tutta la parte di filter rule da gestire).

Poi segui questi passi:

 

## Generare certificati

/certificate
add name=ca_template common-name=FIREWALL_CA key-usage=key-cert-sign,crl-sign  key-size=1024 days-valid=3650
add name=firewall01_template common-name=FIREWALL_FW  key-size=1024 days-valid=3650
add name=client01_template common-name=FIREWALL_CLIENT  key-size=1024 days-valid=3650

/certificate
sign ca_template ca-crl-host=127.0.0.1 name=FIREWALL_CA
sign firewall01_template ca=FIREWALL_CA name=FIREWALL_FW
sign client01_template ca=FIREWALL_CA name=FIREWALL_CLIENT

/certificate
set FIREWALL_CA trusted=yes
set FIREWALL_FW trusted=yes


/certificate export-certificate FIREWALL_CA
/certificate export-certificate FIREWALL_CLIENT export-passphrase=12345678

 

#Rimuovere chiave dai certificati
openssl rsa -in cert_export_Client.key -out Client.key


## OpenVPN Server

/ip pool add name=ovpn-pool ranges=172.16.15.150-172.16.15.254

/ppp profile
add change-tcp-mss=default comment="" local-address=172.16.250.1 name="OpenVPN_Profile" only-one=default use-compression=default use-encryption=required

 

 

/interface ovpn-server server
set auth=sha1,md5 certificate=FIREWALL_FW cipher=aes128 default-profile=OpenVPN_Profile enabled=yes  keepalive-timeout=disabled max-mtu=1440 mode=ip netmask=24 port=1194 require-client-certificate=no


/ip firewall filter
add action=accept chain=input comment="OpenVPN" disabled=no dst-port=1194 protocol=tcp


/ip firewall nat add chain=srcnat  src-address=172.16.15.0/24 out-interface=ether1 action=masquerade


## Creazione Utente
/ppp secret
add caller-id="" comment="" disabled=no limit-bytes-in=0 limit-bytes-out=0 name="utente" password="password" routes="" service=any

 

 

Ricordati che se il Mikrotik non è il router (non ha la pppoe attestata direttamente) devi aprire la porta 1194UDP e TCP (Mikrotik su RoS6 non gestisce correttamente UDP) verso il Mikrotik.

 

 

Poi importa i certificati creati in un file che dovrà avere esternsione .ovpn

Di seguito la falsa riga:

 

client
dev tun
proto tcp
remote xx.xx.xx.xx 1194
resolv-retry infinite
nobind
persist-key
persist-tun
cipher AES-128-CBC
auth SHA1
pull
auth-user-pass authEffeci.cfg
route 192.168.1.0 255.255.255.0 172.16.250.1
ping 15
verb 3
tls-client
<ca>
-----BEGIN CERTIFICATE-----
..............
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
..............
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN RSA PRIVATE KEY-----
..............
-----END RSA PRIVATE KEY-----
</key>

 

 

 

 

Questo è il file che poi dovrai importare nel PLC;

 

 

 

 

 

 

Link al commento
Condividi su altri siti

1 ora fa, Andrea Annoni ha scritto:

#Rimuovere chiave dai certificati
openssl rsa -in cert_export_Client.key -out Client.key

 

Andrea perdonami ma mi da errore su questa riga..

Link al commento
Condividi su altri siti

Allora ho seguito i tuoi passi, ma provando da pc con OpenVPN GUI mi restituisce questi errori.

 

Sun Nov 08 20:29:44 2020 OpenVPN 2.4.9 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Apr 16 2020
Sun Nov 08 20:29:44 2020 Windows version 6.2 (Windows 8 or greater) 64bit
Sun Nov 08 20:29:44 2020 library versions: OpenSSL 1.1.1f  31 Mar 2020, LZO 2.10
Enter Management Password:
Sun Nov 08 20:29:44 2020 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Sun Nov 08 20:29:44 2020 Need hold release from management interface, waiting...
Sun Nov 08 20:29:45 2020 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Sun Nov 08 20:29:45 2020 MANAGEMENT: CMD 'state on'
Sun Nov 08 20:29:45 2020 MANAGEMENT: CMD 'log all on'
Sun Nov 08 20:29:45 2020 MANAGEMENT: CMD 'echo all on'
Sun Nov 08 20:29:45 2020 MANAGEMENT: CMD 'bytecount 5'
Sun Nov 08 20:29:45 2020 MANAGEMENT: CMD 'hold off'
Sun Nov 08 20:29:45 2020 MANAGEMENT: CMD 'hold release'
Sun Nov 08 20:29:45 2020 WARNING: --ping should normally be used with --ping-restart or --ping-exit
Sun Nov 08 20:29:45 2020 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Sun Nov 08 20:29:45 2020 OpenSSL: error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag
Sun Nov 08 20:29:45 2020 OpenSSL: error:0D06C03A:asn1 encoding routines:asn1_d2i_ex_primitive:nested asn1 error
Sun Nov 08 20:29:45 2020 OpenSSL: error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error
Sun Nov 08 20:29:45 2020 OpenSSL: error:04093004:rsa routines:old_rsa_priv_decode:RSA lib
Sun Nov 08 20:29:45 2020 OpenSSL: error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag
Sun Nov 08 20:29:45 2020 OpenSSL: error:0D06C03A:asn1 encoding routines:asn1_d2i_ex_primitive:nested asn1 error
Sun Nov 08 20:29:45 2020 OpenSSL: error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error
Sun Nov 08 20:29:45 2020 OpenSSL: error:0907B00D:PEM routines:PEM_read_bio_PrivateKey:ASN1 lib
Sun Nov 08 20:29:45 2020 Cannot load private key file [[INLINE]]
Sun Nov 08 20:29:45 2020 SIGUSR1[soft,private-key-password-failure] received, process restarting
Sun Nov 08 20:29:45 2020 MANAGEMENT: >STATE:1604863785,RECONNECTING,private-key-password-failure,,,,,
Sun Nov 08 20:29:45 2020 Restart pause, 5 second(s)
Sun Nov 08 20:29:47 2020 SIGTERM[hard,init_instance] received, process exiting
Sun Nov 08 20:29:47 2020 MANAGEMENT: >STATE:1604863787,EXITING,init_instance,,,,,

 

Link al commento
Condividi su altri siti

I log li devi vedere dal Mikrotik.

 

Comunque o  stai sbagliando a importare i certificati oppure non hai messo le credenziali corrette; se le inserisci nel file non servono nel PLC e viceversa

Link al commento
Condividi su altri siti

Ok Andrea.

Ti chiedo ancora una cortesia, come avrai capito è la prima volta che mi imbatto in queste cose e non ho molte cose chiare, magari tu, dall'alto della tua esperienza potrai chiarirle, anche perchè fare le cose con il copia e incolla non mi è mai piaciuto.

 

Allora una cosa non mi è chiara, 

io ho impostato nel quick setup di mikrotik, diciamo nella sezione internet un ip  che è 192.168.1.198

nel gateway 192.168.1.1 (preciso che il mikrotik è collegato ad un modem Tim che mi fa da gateway ovviamente ha un indirizzo che è 192.168.1.1)

 

Poi nella sezione lan network sempre del mikrotik e della scheda quick setup  ho un ip che è 192.168.88.1 e dhcp 192.168.88.50-192.168.88.254

 

Ora quando vado a generare il certificato devo farlo puntare a l'indirizzo 192.168.88.1 è quello del mikrotik  o all' indirizzo della porta wan eth1 192.168.1.198?

Quando creo il pool degli indirizzi per la rete locale  devo puntare a cosa a gli indirizzi della lan quindi al 192.168.88.2-192.168.88.250 ?

E per il remote Address?

 

Scusami ma sto facendo proprio confusione con gli indirizzi, non riesco a trovargli una logica.

Grazie infinitamente, per l'aiuto che mi stai dando.

 

 

Link al commento
Condividi su altri siti

.... scusa la battuta ma se non ami fare il copia incolla i quick set sono proprio da abolire!!! (Io li detesto).

 

 

nei certificati non devi inserire alcun ip.

al limite nel file di configurazione; e li devi inserire l’IP pubblico che ti da Tim 

 

il pool di indirizzi per la vpn deve essere diverso dalla Lan è in questo caso anche dalla wan. Per cui puoi utilizzare le subnet in esempio.

 

Link al commento
Condividi su altri siti

Eccomi di nuovo qui.. con delle buone e cattive notizie...

Iniziamo dalle buone.. Dopo vare peripezie e seguendo la tua guida sono arriva a dama.. nel senso che sono riuscito a far stabilire una connessione VPN verso il router mikrotik.

Questo è stato fatto per prova, da locale tramite un pc con openvpn gui e poi anche da remoto provado con una connessione che non era la stessa a quella dove risiede il mikrotik.. Tutto funzionante.. sono riuscito a stabilire la connessione VPN. 

Fatto ciò, carico la stessa configurazione nel plc e qui arriva la brutta notizia.. non viene stabilita la connessione vpn... anzi, siccome una volta caricato il file di configurazione per rendere effettive le modifiche bisogna riavviare il plc, al suo riavvio mi disabilita i servizi VPN perchè mi dice che non riconosce i parametri della VPN.

 

Di seguito vorrei allegarti il file di configurazione di esempio che si trova all'interno del plc.

 

#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# 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 tcp
;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 tap
;dev tun

# 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 ca.crt
;cert server.crt
;key server.key  # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh2048.pem 2048
;dh dh2048.pem

# Network topology
# Should be subnet (addressing via IP)
# unless Windows clients v2.0.9 and lower have to
# be supported (then net30, i.e. a /30 per client)
# Defaults to net30 (not recommended)
;topology subnet

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
;server 10.8.0.0 255.255.255.0

# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
;ifconfig-pool-persist ipp.txt

# 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 10.8.0.4 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.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"

# 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

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to . block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
;tls-auth ta.key 0 # This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC        # Blowfish (default)
;cipher AES-128-CBC   # AES
;cipher DES-EDE3-CBC  # Triple-DES

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

# 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

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it.  Use one
# or the other (but not both).
;log         openvpn.log
;log-append  openvpn.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 . 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

 

Fatto ciò detto papale papale.. non so più dove andare a parare... 😔

 

 

Modificato: da telnet84
Link al commento
Condividi su altri siti

A quanto pare devi editare questo file rimuovendo i ; e inserendo i vari parametri.

Hai provato a farlo?

 

 

Se può esserti utile questo era un esempio di un vecchio utente che utilizzava anche lui Wago; unica perplessità è il protocollo UDP che Mikrotik non gestisce....al limite prova a metterlo anche come TCP

 

client
dev tun
proto udp
remote 78.XXX.XXX.XX 1194
resolv-retry infinite
nobind
# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nogroup
persist-key
persist-tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/wago.crt
key /etc/openvpn/keys/wago.key
ns-cert-type server
comp-lzo

cipher BF-CBC # Blowfish
status /etc/openvpn/openvpn-status.log

# Set log file verbosity.
verb 4
Modificato: da Andrea Annoni
Link al commento
Condividi su altri siti

Crea un account o accedi per commentare

Devi essere un utente per poter lasciare un commento

Crea un account

Registrati per un nuovo account nella nostra comunità. è facile!

Registra un nuovo account

Accedi

Hai già un account? Accedi qui.

Accedi ora
×
×
  • Crea nuovo/a...