PDA

View Full Version : Problemi con OpenVPN, no fa il routing


Herod2k
13-06-2012, 03:45
Salve a tutti,

ho un problema con OpenVPN, il cliente e il server si vedono pero i clients non navigano su internet attraverso il server. Vado per punti.

Questo è il mio scopo:
ho un computer server (debian 6) in una server farm e due computer clients uno archlinux e l'altro windows 7, vorrei connettere i 3 (e piu computer piu avanti) tutti al server debian e far navigare tutti i computer utilizzando la connessione del server.
Fin qui tutto normale, secondo le guide che ho letto dovrebbe essere semplicissimo.

Il mio problema:
Ho installato OpenVPN sul server con certificato TLS ho installato OpenVPN sui i client ho generato i certificati dei clients, ho aperto le porte del server, lancio openvpn sia sul server che sui clients, si connettono, si vedono pero i clients non navigano.
Ovvero se il server diventa 10.8.0.1 e gli altri sono 10.8.0.2 e .3 tutti e 3 si pingano, posso anche entrare in ssh dal .2 al .1 senza problemi quindi ho creato la vpn pero i clients non navigano, se pingo il server risponde, se pingo google no.

I files di configurazione:

server.conf

local xxx.xxx.xxx.xxx
port 1193
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.8.0.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
tls-auth ta.key 0
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3


client.conf (sia su linux che su windows sono uguali cambia solo i certificato praticamente)

client
dev tun
proto udp
remote xxx.xxx.xxx.xxx 1193
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert cyberjandry.crt
key cyberjandry.key
ns-cert-type server
tls-auth ta.key 1
comp-lzo
verb 3


Mi sono anche assicurato che ip_forward fosse a uno con:
echo 1 > /proc/sys/net/ipv4/ip_forward
e ho configurato il firwall cosi:
iptables -A INPUT -p udp --dport 1193 -s 10.8.0.0/24 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -s 10.8.0.0/24 -j ACCEPT
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT

I logs:
log del server:
Wed Jun 13 03:21:48 2012 OpenVPN 2.1.3 x86_64-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Feb 21 2012
Wed Jun 13 03:21:48 2012 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Wed Jun 13 03:21:48 2012 Diffie-Hellman initialized with 2048 bit key
Wed Jun 13 03:21:48 2012 /usr/bin/openssl-vulnkey -q -b 2048 -m <modulus omitted>
Wed Jun 13 03:21:48 2012 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Wed Jun 13 03:21:48 2012 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 13 03:21:48 2012 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 13 03:21:48 2012 TLS-Auth MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Jun 13 03:21:48 2012 Socket Buffers: R=[124928->131072] S=[124928->131072]
Wed Jun 13 03:21:48 2012 ROUTE default_gateway=91.121.208.254
Wed Jun 13 03:21:48 2012 TUN/TAP device tun0 opened
Wed Jun 13 03:21:48 2012 TUN/TAP TX queue length set to 100
Wed Jun 13 03:21:48 2012 /sbin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
Wed Jun 13 03:21:48 2012 /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2
Wed Jun 13 03:21:49 2012 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Jun 13 03:21:49 2012 GID set to nogroup
Wed Jun 13 03:21:49 2012 UID set to nobody
Wed Jun 13 03:21:49 2012 UDPv4 link local (bound): [AF_INET]xxx.xxx.xxx.xxx:1193
Wed Jun 13 03:21:49 2012 UDPv4 link remote: [undef]
Wed Jun 13 03:21:49 2012 MULTI: multi_init called, r=256 v=256
Wed Jun 13 03:21:49 2012 IFCONFIG POOL: base=10.8.0.4 size=62
Wed Jun 13 03:21:49 2012 IFCONFIG POOL LIST
Wed Jun 13 03:21:49 2012 cyberjandry,10.8.0.4
Wed Jun 13 03:21:49 2012 hades,10.8.0.8
Wed Jun 13 03:21:49 2012 Initialization Sequence Completed
Wed Jun 13 03:22:58 2012 MULTI: multi_create_instance called
Wed Jun 13 03:22:58 2012 58.35.172.192:6947 Re-using SSL/TLS context
Wed Jun 13 03:22:58 2012 58.35.172.192:6947 LZO compression initialized
Wed Jun 13 03:22:58 2012 58.35.172.192:6947 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Jun 13 03:22:58 2012 58.35.172.192:6947 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Jun 13 03:22:58 2012 58.35.172.192:6947 Local Options hash (VER=V4): '14168603'
Wed Jun 13 03:22:58 2012 58.35.172.192:6947 Expected Remote Options hash (VER=V4): '504e774e'
Wed Jun 13 03:22:58 2012 58.35.172.192:6947 TLS: Initial packet from [AF_INET]58.35.172.192:6947, sid=527db04a 3a6a334c
Wed Jun 13 03:23:45 2012 58.35.172.192:6947 VERIFY OK: depth=1, /C=IT/ST=Roma/L=Roma/O=esempio/CN=esempio_CA/emailAddress=nobody@example.com
Wed Jun 13 03:23:45 2012 58.35.172.192:6947 VERIFY OK: depth=0, /C=IT/ST=Roma/L=Roma/O=esempio/CN=cyberjandry/emailAddress=nobody@example.com
Wed Jun 13 03:23:58 2012 58.35.172.192:6947 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Wed Jun 13 03:23:58 2012 58.35.172.192:6947 TLS Error: TLS handshake failed
Wed Jun 13 03:23:58 2012 58.35.172.192:6947 SIGUSR1[soft,tls-error] received, client-instance restarting
Wed Jun 13 03:24:00 2012 MULTI: multi_create_instance called
Wed Jun 13 03:24:00 2012 58.35.172.192:6970 Re-using SSL/TLS context
Wed Jun 13 03:24:00 2012 58.35.172.192:6970 LZO compression initialized
Wed Jun 13 03:24:00 2012 58.35.172.192:6970 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Jun 13 03:24:00 2012 58.35.172.192:6970 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Jun 13 03:24:00 2012 58.35.172.192:6970 Local Options hash (VER=V4): '14168603'
Wed Jun 13 03:24:00 2012 58.35.172.192:6970 Expected Remote Options hash (VER=V4): '504e774e'
Wed Jun 13 03:24:00 2012 58.35.172.192:6970 TLS: Initial packet from [AF_INET]58.35.172.192:6970, sid=fa8f04a1 e05ed8f1
Wed Jun 13 03:24:18 2012 58.35.172.192:6970 VERIFY OK: depth=1, /C=IT/ST=Roma/L=Roma/O=esempio/CN=esempio_CA/emailAddress=nobody@example.com
Wed Jun 13 03:24:18 2012 58.35.172.192:6970 VERIFY OK: depth=0, /C=IT/ST=Roma/L=Roma/O=esempio/CN=cyberjandry/emailAddress=nobody@example.com
Wed Jun 13 03:24:28 2012 58.35.172.192:6970 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Jun 13 03:24:28 2012 58.35.172.192:6970 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 13 03:24:28 2012 58.35.172.192:6970 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Jun 13 03:24:28 2012 58.35.172.192:6970 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 13 03:24:28 2012 58.35.172.192:6970 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Wed Jun 13 03:24:28 2012 58.35.172.192:6970 [cyberjandry] Peer Connection Initiated with [AF_INET]58.35.172.192:6970
Wed Jun 13 03:24:28 2012 cyberjandry/58.35.172.192:6970 MULTI: Learn: 10.8.0.6 -> cyberjandry/58.35.172.192:6970
Wed Jun 13 03:24:28 2012 cyberjandry/58.35.172.192:6970 MULTI: primary virtual IP for cyberjandry/58.35.172.192:6970: 10.8.0.6
Wed Jun 13 03:24:39 2012 cyberjandry/58.35.172.192:6970 PUSH: Received control message: 'PUSH_REQUEST'
Wed Jun 13 03:24:39 2012 cyberjandry/58.35.172.192:6970 SENT CONTROL [cyberjandry]: 'PUSH_REPLY,route 10.8.0.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 208.67.222.222,dhcp-option DNS 208.67.220.220,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5' (status=1)
Wed Jun 13 03:24:44 2012 cyberjandry/58.35.172.192:6970 PUSH: Received control message: 'PUSH_REQUEST'
Wed Jun 13 03:24:44 2012 cyberjandry/58.35.172.192:6970 SENT CONTROL [cyberjandry]: 'PUSH_REPLY,route 10.8.0.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 208.67.222.222,dhcp-option DNS 208.67.220.220,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5' (status=1)

Log client Archlinux
Wed Jun 13 09:30:44 2012 OpenVPN 2.2.2 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] [eurephia] built on Jan 3 2012
Wed Jun 13 09:30:44 2012 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Wed Jun 13 09:30:44 2012 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Wed Jun 13 09:30:44 2012 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 13 09:30:44 2012 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 13 09:30:44 2012 LZO compression initialized
Wed Jun 13 09:30:44 2012 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Jun 13 09:30:44 2012 Socket Buffers: R=[163840->131072] S=[163840->131072]
Wed Jun 13 09:30:44 2012 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Jun 13 09:30:44 2012 Local Options hash (VER=V4): '504e774e'
Wed Jun 13 09:30:44 2012 Expected Remote Options hash (VER=V4): '14168603'
Wed Jun 13 09:30:44 2012 UDPv4 link local: [undef]
Wed Jun 13 09:30:44 2012 UDPv4 link remote: xxx.xxx.xxx.xxx:1193
Wed Jun 13 09:30:45 2012 TLS: Initial packet from xxx.xxx.xxx.xxx:1193, sid=f9bf27ab 693e1eaf
Wed Jun 13 09:30:47 2012 VERIFY OK: depth=1, /C=IT/ST=Roma/L=Roma/O=esempio/CN=esempio_CA/emailAddress=nobody@example.com
Wed Jun 13 09:30:47 2012 VERIFY OK: nsCertType=SERVER
Wed Jun 13 09:30:47 2012 VERIFY OK: depth=0, /C=IT/ST=Roma/L=Roma/O=esempio/CN=server/emailAddress=nobody@example.com
Wed Jun 13 09:31:03 2012 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Jun 13 09:31:03 2012 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 13 09:31:03 2012 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Jun 13 09:31:03 2012 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 13 09:31:06 2012 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Wed Jun 13 09:31:06 2012 [server] Peer Connection Initiated with xxx.xxx.xxx.xxx:1193
Wed Jun 13 09:31:09 2012 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Wed Jun 13 09:31:09 2012 PUSH: Received control message: 'PUSH_REPLY,route 10.8.0.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 208.67.222.222,dhcp-option DNS 208.67.220.220,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5'
Wed Jun 13 09:31:09 2012 OPTIONS IMPORT: timers and/or timeouts modified
Wed Jun 13 09:31:09 2012 OPTIONS IMPORT: --ifconfig/up options modified
Wed Jun 13 09:31:09 2012 OPTIONS IMPORT: route options modified
Wed Jun 13 09:31:09 2012 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed Jun 13 09:31:09 2012 ROUTE default_gateway=192.168.2.1
Wed Jun 13 09:31:09 2012 TUN/TAP device tun0 opened
Wed Jun 13 09:31:09 2012 TUN/TAP TX queue length set to 100
Wed Jun 13 09:31:09 2012 /usr/sbin/ip link set dev tun0 up mtu 1500
Wed Jun 13 09:31:09 2012 /usr/sbin/ip addr add dev tun0 local 10.8.0.6 peer 10.8.0.5
Wed Jun 13 09:31:09 2012 /usr/sbin/ip route add xxx.xxx.xxx.xxx/32 via 192.168.2.1
Wed Jun 13 09:31:09 2012 /usr/sbin/ip route add 0.0.0.0/1 via 10.8.0.5
Wed Jun 13 09:31:09 2012 /usr/sbin/ip route add 128.0.0.0/1 via 10.8.0.5
Wed Jun 13 09:31:09 2012 /usr/sbin/ip route add 10.8.0.0/24 via 10.8.0.5
Wed Jun 13 09:31:09 2012 /usr/sbin/ip route add 10.8.0.1/32 via 10.8.0.5
Wed Jun 13 09:31:09 2012 Initialization Sequence Completed

ifconfig server:
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:186 errors:0 dropped:0 overruns:0 frame:0
TX packets:121 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:12247 (11.9 KiB) TX bytes:10807 (10.5 KiB)

ifconfig client:
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 metric 1
inet 10.8.0.6 netmask 255.255.255.255 destination 10.8.0.5
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 9 bytes 864 (864.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 29 bytes 2061 (2.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Ping dal client una volta connesso alla vpn:
PING www-cctld.l.google.com (74.125.71.94) 56(84) bytes of data.
From 10.8.0.1 icmp_seq=2 Destination Port Unreachable
From 10.8.0.1 icmp_seq=4 Destination Port Unreachable


PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data.
64 bytes from 10.8.0.1: icmp_req=4 ttl=64 time=393 ms
64 bytes from 10.8.0.1: icmp_req=5 ttl=64 time=393 ms
64 bytes from 10.8.0.1: icmp_req=6 ttl=64 time=394 ms
64 bytes from 10.8.0.1: icmp_req=7 ttl=64 time=393 ms
64 bytes from 10.8.0.1: icmp_req=8 ttl=64 time=393 ms
64 bytes from 10.8.0.1: icmp_req=9 ttl=64 time=393 ms

Le prove che ho fatto:
Tante, troppe, sono 3 giorni che faccio solo questo, cmq posso dire che
- ho disabilitato il firewall sulla macchina, per vedere se era un problema di iptables,
- ho provato il protocollo tcp al posto di udp
- ho provato la stessa configurazione del server su un'altro server debian pulito pulito, ma con lo stesso risultato.
- ho provato svariate regole di iptables
- ho provato ad usare tap e non tun
- ho provato a mettere l'ip fisso come in questa guida: http://guide.debianizzati.org/index.php/Openvpn


Insomma sono a corto di idee, se ne avete qualcuna voi, benvenga.

Grazie mille

H2K

eaman
14-06-2012, 04:58
Come sono le tabelle di routing del server, in particolare ha una rotta di default per 0.0.0.0 per uscire all'esterno? C'e' qualcuno che fa NAT per quella classe A privata 10.8.0.0/24?
Non e' che cerca di instradare il traffico della rete privata 10.8.0.0 su un gateway esterno che non ne vuole sapere, o non fa tornare indietro i pacchetti?

Nel caso, prova a far fare al server un NAT sulla scheda di rete con cui esce verso internet per tutti i pacchetti in uscita per la rete 10.8.0.0/24 .

Herod2k
14-06-2012, 14:41
grazie, appena posso ti mando le tabelle di routing del server e del client.

eaman
14-06-2012, 20:51
Te fagli sul server:

iptables -t nat -A POSTROUTING -s 192.168.8.0/24 -o scheda_di_rete_da_cui_esce -j MASQUERADE
E spera!

Herod2k
17-06-2012, 08:39
Alla fine mi hanno dato un'altro server su cui montare la vpn, l'altro aveva un lag eccessivo anche se fossi riuscito far andare i clients avrebbero navigato eccessivamente lenti.

Cambiato il server ma il problema persiste, ho provato anche con il comando di nat che mi hai dato però non va e credo di aver capito qual'è l'errore.

OpenVPN assegna con il dhcp l'ip 10.8.0.6 al mio client
pero se vado a vedere la tabella di routing (che monta in automatico) una volta lanciato openvpn vedo questo:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
192.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 venet0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 venet0


e tra le schede di rete del server vedo questo:
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

insomma tutto punta all'indirizzo 10.8.0.2 pero questo indirizzo non esiste, openvpn mi assegna il .6 e pero istrada tutto sul .2

Uff..

Questa è la scheda di rete sul client:
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 metric 1
inet 10.8.0.6 netmask 255.255.255.255 destination 10.8.0.5
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

e questa è la tabella di routing sul client una volta lanciato OpenVPN
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 192.168.2.1 0.0.0.0 UG 302 0 0 eth0
10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0
10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
121.127.248.84 192.168.2.1 255.255.255.255 UGH 0 0 0 eth0
128.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0
192.168.2.0 0.0.0.0 255.255.255.0 U 302 0 0 eth0

Anche il client cerca di andare sul .5 che pero non esiste.

Idee?

Grazie

H2K

Herod2k
17-06-2012, 10:59
Mi sono accorto che sulle guide dicono che gli ip sono giusti:
https://wiki.archlinux.org/index.php/OpenVPN
client e ip sono gli stessi dei miei, idem qui:
http://tipupdate.com/how-to-install-openvpn-on-centos-vps/
:muro: :muro: :muro: :muro:

eaman
17-06-2012, 12:34
Magari parti senza dhcp, configura le rotte manualmente, guarda se funziona.
Poi metti a posto il dhcp.

E fai riferimento a: https://wiki.archlinux.org/index.php/OpenVPN#Advanced_OpenVPN_configuration

Herod2k
17-06-2012, 12:51
E fai riferimento a: https://wiki.archlinux.org/index.php/OpenVPN#Advanced_OpenVPN_configuration
la guida di Archlinux l'ho già provata putroppo e senza ottenere il risultato sperato.
Cmq me la rileggo non sia mai che mi sia sfuggito qualche cosa.

eaman
17-06-2012, 13:09
Io ai principianti facevo usare come riferimento:
- http://openvpn.net/index.php/open-source/documentation/howto.html#quick

per la prima configurazione con chiavi statiche.

GL.

Herod2k
17-06-2012, 15:40
Io ai principianti facevo usare come riferimento:
- http://openvpn.net/index.php/open-source/documentation/howto.html#quick

per la prima configurazione con chiavi statiche.

GL.

Per le chiavi statiche ho seguito questa di guida:
http://guide.debianizzati.org/index.php/Openvpn
e funziona
10.0.0.1 e 10.0.0.2 si vedono e si pingano a vicenda, no problem, il problema è sempre la navigazione non riesco ad uscire. dal client attraverso il server.

H2K

P.s grazie mille per l'aiuto che mi stai dando.

Herod2k
18-06-2012, 06:19
Ho risolto!
in questo ultimo server che mi avevano dato, c'era CentOs e mi ero dimenticato di spengere il firewall che c'è di default
un bel /etc/init.d/iptables stop
ed ha cominciato a funzionare tutto perfettamente. :eek: :eek: :eek: a volte le soluzioni sono veramente idiozie.

Avrei un paio di domande aggiuntive:
- c'è una maniera per tirare fuori le statistiche del traffico dei vari utenti connessi alla vpn?
- c'è una maniera (lato server) per dire ai client, instrada tutto sul server, meno ... non so, torrent, msn, skype, emule ...

Stiamo montando il server vpn solo per la navigazione, e visto che paghiamo la banda, non vorrei che qualche furbo accenda uTorrent con la vpn accesa.

Grazie

H2K

wizard1993
18-06-2012, 09:05
- c'è una maniera (lato server) per dire ai client, instrada tutto sul server, meno ... non so, torrent, msn, skype, emule ...


con iptable droppi tutto quello che non è protocollo https o http, oppure tutto quello che non proviene da porte definite (che ne so, la 80, la 423, la 20 e la 21)
puoi prendere spunto da questo
http://www.cyberciti.biz/tips/linux-iptables-11-how-to-block-or-open-httpweb-service.html

Herod2k
18-06-2012, 10:20
con iptable droppi tutto quello che non è protocollo https o http, oppure tutto quello che non proviene da porte definite (che ne so, la 80, la 423, la 20 e la 21)
puoi prendere spunto da questo
http://www.cyberciti.biz/tips/linux-iptables-11-how-to-block-or-open-httpweb-service.html

ci avevo pensato anche io, pero cosi facendo se faccio un drop, non si possono proprio connettere, io pensavo a qualche cosa tipo:
- web, email, ftp, => 10.8.0.1
- skype, torrents, emule e altro => 192.168.0.1
insomma reindirizzare tutto fuori dalla vpn senza essere troppo drastici.

H2K

eaman
18-06-2012, 12:02
Congraturazioni!

Secondo me la cosa migliore che puoi fare e' reindirizzare tutto il trafico con porta dest 80 sulla 3128 di un server proxy come squid3, e da li bloccare anche eventuali siti non graditi.
Poi semplicemente togli il NAT e non fai uscire quella rete privata.

Se proprio servisse puoi nattargli qualche protocollo in particolare: imap,pop, ssh.

Poi fai girare un software di statistica sul traffico di squid (anche webalizer), e puoi vedere in tempo reale chi sta guardando cosa in caso di intaso (sqstat).

Herod2k
18-06-2012, 12:11
ok, quindi mi pare di capire che far passare alcune porte sulla vpn e altre no, senza bloccare il traffico (torrent, skype, etc etc) non sia fattibile.

Squid è una delle soluzioni que stavo valutando, metterlo come dici tu, in trasparent mode e guardarmi le statistiche da la.

Grazie mille.

H2K

eaman
18-06-2012, 19:59
ok, quindi mi pare di capire che far passare alcune porte sulla vpn e altre no, senza bloccare il traffico (torrent, skype, etc etc) non sia fattibile.

Ma non e' che devi bloccare, la vpn e' su una rete privata: o le fai un po' di NAT o ci metti un proxy trasparente per http oppure quella rete non esce.

Vai di squid3 in modalita' trasparente e dnsmasq per la cache DNS, cosi' blocchi facebook / youtube e quant'altro con la massima flessibilita'.

massimilianonball
18-07-2012, 09:51
Hai messo a 1 l'ipenablerouter..??

Se non lo fai il routing non va..

Herod2k
19-07-2012, 02:05
Hai messo a 1 l'ipenablerouter..??

Se non lo fai il routing non va..

Trovai la soluzione al post numero 11, era un problema di firewall, grazie lo stesso.

fgdytrheudgd
03-10-2015, 11:02
ciao ragazzi,
io ho un problema simile,
l'open vps funziona sul telefono, ma se uso il telefono come router wi fi internet su computer non va,
consiglio su come farlo andare?
grazie