Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

[VPNC] le vpn ne fonctionne qu'au boot

1 réponse
Avatar
Siddharta
Bonjour,

J'utilise vpnc sur freebsd 6.1 pour me connecter sur des sites distants
en vpn. Au d=E9marrage de mon laptop j'arrive a etablir le tunnel vpn et
'pinguer' le reseau distant. Une fois d=E9connect=E9 avec la commande
vpnc-disconnect je 'ping' =E0 nouveau google, jusque la pas de probleme.
Par contre si je re tente une connexion vpn , une fois le mot de passe
rentr=E9 le tunnel semble s'=E9tablir correctement toutefois je ne 'ping'
plus le reseau distant. Vous trouverez ci dessous l'ensemble de mes
tests effectu=E9s. Je ne comprends pas car les routes semblent bien
configur=E9es, le resov.conf est bien mis a jour ... bref je ne
comprends pas pourquoi ca ne marche plus une seconde fois ... si
quelqu'un avait une piste ou un d=E9but de r=E9ponse je suis plus que
preneur.

Je vous souhaite une agr=E9able journ=E9e.

----------------------> configuration pour internet
# netstat -rn
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif
Expire
default 192.168.0.3 UGS 0 5876 fxp0
127.0.0.1 127.0.0.1 UH 0 26 lo0
192.168.0 link#2 UC 0 0 fxp0
192.168.0.3 00:0f:b5:bc:4c:ee UHLW 2 521 fxp0
1154

Internet6:
Destination Gateway Flags
Netif Expire
::1 ::1 UH
lo0
fe80::%fxp0/64 link#2 UC
fxp0
fe80::20f:1fff:fec1:de99%fxp0 00:0f:1f:c1:de:99 UHL
lo0
fe80::%lo0/64 fe80::1%lo0 U
lo0
fe80::1%lo0 link#4 UHL
lo0
ff01:2::/32 link#2 UC
fxp0
ff01:4::/32 ::1 UC
lo0
ff02::%fxp0/32 link#2 UC
fxp0
ff02::%lo0/32 ::1 UC
lo0

-----------------------> d=E9marrage de vpnc pour la premiere fois
depuis le boot

[root@MiniTinouaf /usr/home/tinom]# vpnc /etc/vpnc/stave.conf
Enter password for toto@21.23.119.193:
add host 21.23.119.193: gateway 192.168.0.3
delete net default
add net default: gateway 10.1.9.1
VPNC started in background (pid: 1065)...

----------------------> je ping le reseau distant

[root@MiniTinouaf /usr/home/tinom]# ping 10.1.0.5
PING 10.1.0.5 (10.1.0.5): 56 data bytes
64 bytes from 10.1.0.5: icmp_seq=3D0 ttl=3D128 time=3D36.032 ms
64 bytes from 10.1.0.5: icmp_seq=3D1 ttl=3D128 time=3D34.938 ms
64 bytes from 10.1.0.5: icmp_seq=3D2 ttl=3D128 time=3D37.957 ms
^C
--- 10.1.0.5 ping statistics ---
4 packets transmitted, 3 packets received, 25% packet loss
round-trip min/avg/max/stddev =3D 34.938/36.309/37.957/1.248 ms


[root@MiniTinouaf /usr/home/tinom]# netstat -rn
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif
Expire
default 10.1.9.1 UGS 0 53 tun0
127.0.0.1 127.0.0.1 UH 0 26 lo0
10.1.9.1 10.1.9.1 UH 1 0 tun0
192.168.0 link#2 UC 0 0 fxp0
192.168.0.3 00:0f:b5:bc:4c:ee UHLW 2 537 fxp0
1196
21.23.119.193 192.168.0.3 UGHS 0 53 fxp0

Internet6:
Destination Gateway Flags
Netif Expire
::1 ::1 UH
lo0
fe80::%fxp0/64 link#2 UC
fxp0
fe80::20f:1fff:fec1:de99%fxp0 00:0f:1f:c1:de:99 UHL
lo0
fe80::%lo0/64 fe80::1%lo0 U
lo0
fe80::1%lo0 link#4 UHL
lo0
fe80::%tun0/64 link#5 UC
tun0
fe80::20f:1fff:fec1:de99%tun0 link#5 UHL
lo0
ff01:2::/32 link#2 UC
fxp0
ff01:4::/32 ::1 UC
lo0
ff01:5::/32 link#5 UC
tun0
ff02::%fxp0/32 link#2 UC
fxp0
ff02::%lo0/32 ::1 UC
lo0
ff02::%tun0/32 link#5 UC
tun0

[root@MiniTinouaf /usr/home/tinom]# ifconfig
fwe0: flags=3D108802<BROADCAST,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
options=3D8<VLAN_MTU>
ether 32:4f:c0:02:a4:30
ch 1 dma -1
fxp0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3D8<VLAN_MTU>
inet6 fe80::20f:1fff:fec1:de99%fxp0 prefixlen 64 scopeid 0x2
inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:0f:1f:c1:de:99
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
plip0: flags=3D108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
inet 127.0.0.1 netmask 0xff000000
tun0: flags=3D8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1412
inet6 fe80::20f:1fff:fec1:de99%tun0 prefixlen 64 scopeid 0x5
inet 10.1.9.1 --> 10.1.9.1 netmask 0xffffffff
Opened by PID 1040

--------------------------> je coupe la connexion vpn

[root@MiniTinouaf /usr/home/tinom]# vpnc-disconnect
Terminating vpnc daemon (pid: 1065)


[root@MiniTinouaf /usr/home/tinom]#ping google.fr
PING google.fr (72.14.221.104): 56 data bytes
64 bytes from 72.14.221.104: icmp_seq=3D0 ttl=3D240 time=3D39.747 ms
64 bytes from 72.14.221.104: icmp_seq=3D1 ttl=3D240 time=3D40.214 ms
64 bytes from 72.14.221.104: icmp_seq=3D2 ttl=3D240 time=3D39.398 ms
^C
--- google.fr ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev =3D 39.398/39.786/40.214/0.334 ms

[root@MiniTinouaf /usr/home/tinom]## netstat -rn
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif
Expire
default 192.168.0.3 UGS 0 30 fxp0
127.0.0.1 127.0.0.1 UH 0 26 lo0
192.168.0 link#2 UC 0 0 fxp0
192.168.0.3 00:0f:b5:bc:4c:ee UHLW 2 542 fxp0
1174

Internet6:
Destination Gateway Flags
Netif Expire
::1 ::1 UH
lo0
fe80::%fxp0/64 link#2 UC
fxp0
fe80::20f:1fff:fec1:de99%fxp0 00:0f:1f:c1:de:99 UHL
lo0
fe80::%lo0/64 fe80::1%lo0 U
lo0
fe80::1%lo0 link#4 UHL
lo0
fe80::%tun0/64 link#5 UC
tun0
fe80::20f:1fff:fec1:de99%tun0 link#5 UHL
lo0
ff01:2::/32 link#2 UC
fxp0
ff01:4::/32 ::1 UC
lo0
ff01:5::/32 link#5 UC
tun0
ff02::%fxp0/32 link#2 UC
fxp0
ff02::%lo0/32 ::1 UC
lo0
ff02::%tun0/32 link#5 UC
tun0


[root@MiniTinouaf /usr/home/tinom]# ifconfig
fwe0: flags=3D108802<BROADCAST,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
options=3D8<VLAN_MTU>
ether 32:4f:c0:02:a4:30
ch 1 dma -1
fxp0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3D8<VLAN_MTU>
inet6 fe80::20f:1fff:fec1:de99%fxp0 prefixlen 64 scopeid 0x2
inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:0f:1f:c1:de:99
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
plip0: flags=3D108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
inet 127.0.0.1 netmask 0xff000000
tun0: flags=3D8010<POINTOPOINT,MULTICAST> mtu 1412
inet6 fe80::20f:1fff:fec1:de99%tun0 prefixlen 64 scopeid 0x5
inet 10.1.9.1 --> 10.1.9.1 netmask 0xffffffff

-----------------------------------> je relance la connexion vpn

[root@MiniTinouaf /usr/home/tinom]# vpnc /etc/vpnc/stave.conf
Enter password for toto@21.23.119.193:
add host 21.23.119.193: gateway 192.168.0.3
delete net default
add net default: gateway 10.1.9.1
VPNC started in background (pid: 1129)...

-----------------------> PROBLEME : je ne ping plus le reseau distant

[root@MiniTinouaf /usr/home/tinom]# ping 10.1.0.5
PING 10.1.0.5 (10.1.0.5): 56 data bytes
^C
--- 10.1.0.5 ping statistics ---
14 packets transmitted, 0 packets received, 100% packet loss

[root@MiniTinouaf /usr/home/tinom]# netstat -rn
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif
Expire
default 10.1.9.1 UGS 0 54 tun0
127.0.0.1 127.0.0.1 UH 0 26 lo0
10.1.9.1 10.1.9.1 UH 1 0 tun0
192.168.0 link#2 UC 0 0 fxp0
192.168.0.3 00:0f:b5:bc:4c:ee UHLW 2 550 fxp0
1198
21.23.119.193 192.168.0.3 UGHS 0 55 fxp0

Internet6:
Destination Gateway Flags
Netif Expire
::1 ::1 UH
lo0
fe80::%fxp0/64 link#2 UC
fxp0
fe80::20f:1fff:fec1:de99%fxp0 00:0f:1f:c1:de:99 UHL
lo0
fe80::%lo0/64 fe80::1%lo0 U
lo0
fe80::1%lo0 link#4 UHL
lo0
fe80::%tun0/64 link#5 UC
tun0
fe80::20f:1fff:fec1:de99%tun0 link#5 UHL
lo0
ff01:2::/32 link#2 UC
fxp0
ff01:4::/32 ::1 UC
lo0
ff01:5::/32 link#5 UC
tun0
ff02::%fxp0/32 link#2 UC
fxp0
ff02::%lo0/32 ::1 UC
lo0
ff02::%tun0/32 link#5 UC
tun0

[root@MiniTinouaf /usr/home/tinom]# ifconfig
fwe0: flags=3D108802<BROADCAST,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
options=3D8<VLAN_MTU>
ether 32:4f:c0:02:a4:30
ch 1 dma -1
fxp0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3D8<VLAN_MTU>
inet6 fe80::20f:1fff:fec1:de99%fxp0 prefixlen 64 scopeid 0x2
inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:0f:1f:c1:de:99
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
plip0: flags=3D108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
inet 127.0.0.1 netmask 0xff000000
tun0: flags=3D8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1412
inet6 fe80::20f:1fff:fec1:de99%tun0 prefixlen 64 scopeid 0x5
inet 10.1.9.1 --> 10.1.9.1 netmask 0xffffffff
Opened by PID 1104
[root@MiniTinouaf /usr/home/tinom]#

1 réponse

Avatar
Siddharta

Bonjour,

J'utilise vpnc sur freebsd 6.1 pour me connecter sur des sites distants
en vpn. Au démarrage de mon laptop j'arrive a etablir le tunnel vpn et
'pinguer' le reseau distant. Une fois déconnecté avec la commande
vpnc-disconnect je 'ping' à nouveau google, jusque la pas de probleme.
Par contre si je re tente une connexion vpn , une fois le mot de passe
rentré le tunnel semble s'établir correctement toutefois je ne 'ping'
plus le reseau distant. Vous trouverez ci dessous l'ensemble de mes
tests effectués. Je ne comprends pas car les routes semblent bien
configurées, le resov.conf est bien mis a jour ... bref je ne
comprends pas pourquoi ca ne marche plus une seconde fois ... si
quelqu'un avait une piste ou un début de réponse je suis plus que
preneur.

Je vous souhaite une agréable journée.


Bonjour,

Alors voila j'ai ecris a un gars de vpnc-devel qui m'a indiqué
comment contourner ce problem :
il suffit d'indiquer un mauvais password lors de la reconnection ca
permet de 'flusher' l'anteriorité des connections, puis ensuite se
reconnecter avec le bon password et ca roule!!
Il m'a aussi parlé d'un script qui permettrait d'indiquer
automatiquement un mauvais password dans le cas d'une connexion avec
password pré-renseigné.

Pour info voici le message original en anglais (des fois que j'aurais
mal traduit ;) )

-------- Forwarded Message --------
From: Anton Altaparmakov
To: vpnc list to send bug reports and discussions with developers

Subject: Re: [vpnc-devel] Fwd: Vpnc only work the first time
Date: Fri, 01 Dec 2006 08:28:25 +0000

Hi,

Known problem. When you re-connect after the disconnect, connect with
the wrong password. That will fail to connect obviously but it will
clear the old connection from the server. Then connect again this time
with the correct password and it will work.

We wrote a script to do that where vpnc-connect actually connects with
a
random password first and only then connects again with the correct
password (if entered in the config file or prompts for password if not
entered in the config file).

Best regards,

Anton