sc4tt3rbr4in
18-09-2013, 09:16
Ciao a tutti,
ho un problema con la configurazione di una vpn che non funziona se il client ha lo stessa classe d' indirizzo del modem/router, mi spiego meglio:
il server della vpn è raggiungibile via internet, attualmente tra il modem/router c'è un router con dhcp attivo, provo a fare uno schema:
------------------ ------------------ ---------------------- --------------------
| 10.8.0.1 | Internet | 192.168.0.1 | Lan | <- 192.168.0.2 | Lan | |
| Server VPN | <-- // --> | Modem/Router | <-----> | Router | <-----> | client vpn |
| | | | | 192.168.10.1 -> | | 192.168.10.210 |
------------------ ------------------ ---------------------- -------------------
ifconfig con vpn attiva:
eth0 Link encap:Ethernet HWaddr 00---
inet addr:192.168.10.210 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:156 errors:0 dropped:0 overruns:0 frame:0
TX packets:211 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19083 (18.6 KiB) TX bytes:24702 (24.1 KiB)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:513 (513.0 B) TX bytes:513 (513.0 B)
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.50 P-t-P:10.8.0.49 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:529 (529.0 B) TX bytes:567 (567.0 B)
route table
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.1 10.8.0.49 255.255.255.255 UGH 0 0 0 tun0
10.8.0.49 * 255.255.255.255 UH 0 0 0 tun0
192.168.0.0 10.8.0.49 255.255.255.0 UG 0 0 0 tun0
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
in questa condizione la vpn funziona correttamente e il client vpn è raggiungibile anche tramite il suo indirizzo lan locale 192.168.10.210.
Se invece collego il client direttamente al modem router, sempre con dhcp attivo:
------------------ ------------------ --------------------
| 10.8.0.1 | Internet | 192.168.0.1 | Lan | 192.168.0.12 |
| Server VPN | <-- // --> | Modem/Router | <-----> | client vpn |
| | | | | |
------------------ ------------------ -------------------
ifconfig prima di lanciare openvpn client
eth0 Link encap:Ethernet HWaddr 00
inet addr:192.168.0.12 Bcast:0.0.0.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:100 errors:0 dropped:0 overruns:0 frame:0
TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7186 (7.0 KiB) TX bytes:9273 (9.0 KiB)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:513 (513.0 B) TX bytes:513 (513.0 B)
route table
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
il client non riesce piu a collegarsi a internet ed al server vpn, e non è piu raggiungibile nemmeno su lan con il suo indirizzo 192.168.0.12
questo è il client.conf di opnevpn:
client
dev tun
proto udp
remote indirizzoserver portaserver
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
remote-cert-tls server
cipher AES-128-CBC
ca /var/etc/openvpn/keys/ca.crt
cert /var/etc/openvpn/keys/client3.crt
key /var/etc/openvpn/keys/client3.key
tls-auth /var/etc/openvpn/keys/tlsdm.key 1
verb 5
spero di essere stato abbastanza chiaro, non riesco proprio a capire come mai no si riesce a collegare, perché ho configurato altri client, su altre lan private, che accedono allo stesso server e funzionano correttamente. :confused:
ho un problema con la configurazione di una vpn che non funziona se il client ha lo stessa classe d' indirizzo del modem/router, mi spiego meglio:
il server della vpn è raggiungibile via internet, attualmente tra il modem/router c'è un router con dhcp attivo, provo a fare uno schema:
------------------ ------------------ ---------------------- --------------------
| 10.8.0.1 | Internet | 192.168.0.1 | Lan | <- 192.168.0.2 | Lan | |
| Server VPN | <-- // --> | Modem/Router | <-----> | Router | <-----> | client vpn |
| | | | | 192.168.10.1 -> | | 192.168.10.210 |
------------------ ------------------ ---------------------- -------------------
ifconfig con vpn attiva:
eth0 Link encap:Ethernet HWaddr 00---
inet addr:192.168.10.210 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:156 errors:0 dropped:0 overruns:0 frame:0
TX packets:211 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19083 (18.6 KiB) TX bytes:24702 (24.1 KiB)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:513 (513.0 B) TX bytes:513 (513.0 B)
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.50 P-t-P:10.8.0.49 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:529 (529.0 B) TX bytes:567 (567.0 B)
route table
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.1 10.8.0.49 255.255.255.255 UGH 0 0 0 tun0
10.8.0.49 * 255.255.255.255 UH 0 0 0 tun0
192.168.0.0 10.8.0.49 255.255.255.0 UG 0 0 0 tun0
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
in questa condizione la vpn funziona correttamente e il client vpn è raggiungibile anche tramite il suo indirizzo lan locale 192.168.10.210.
Se invece collego il client direttamente al modem router, sempre con dhcp attivo:
------------------ ------------------ --------------------
| 10.8.0.1 | Internet | 192.168.0.1 | Lan | 192.168.0.12 |
| Server VPN | <-- // --> | Modem/Router | <-----> | client vpn |
| | | | | |
------------------ ------------------ -------------------
ifconfig prima di lanciare openvpn client
eth0 Link encap:Ethernet HWaddr 00
inet addr:192.168.0.12 Bcast:0.0.0.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:100 errors:0 dropped:0 overruns:0 frame:0
TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7186 (7.0 KiB) TX bytes:9273 (9.0 KiB)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:513 (513.0 B) TX bytes:513 (513.0 B)
route table
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
il client non riesce piu a collegarsi a internet ed al server vpn, e non è piu raggiungibile nemmeno su lan con il suo indirizzo 192.168.0.12
questo è il client.conf di opnevpn:
client
dev tun
proto udp
remote indirizzoserver portaserver
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
remote-cert-tls server
cipher AES-128-CBC
ca /var/etc/openvpn/keys/ca.crt
cert /var/etc/openvpn/keys/client3.crt
key /var/etc/openvpn/keys/client3.key
tls-auth /var/etc/openvpn/keys/tlsdm.key 1
verb 5
spero di essere stato abbastanza chiaro, non riesco proprio a capire come mai no si riesce a collegare, perché ho configurato altri client, su altre lan private, che accedono allo stesso server e funzionano correttamente. :confused: