• [^] # Re: Côté routage

    Posté par . En réponse au message Problème mise en place PiVPN (OpenVPN sur raspberry). Évalué à -5. Dernière modification le 19 avril 2017 à 22:15.

    Bon alors là je sèche (pour le moment :P ).
    Via l'interface graphique sur Xubuntu rien ne fonctionne mais si je me connecte au vpn en lançant la commande suivante

    sudo openvpn --cd /tmp/ --config monUser.ovpn
    

    ça fonctionne à moitié (le DNS ne semble plus fonctionner (youtube kapout) mais j'arrive a ping/curl les machines du lan et du VPN et l'IP affiché par curl est bien celle du VPN) :

    Wed Apr 19 21:50:57 2017 OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Feb 2 2016
    Wed Apr 19 21:50:57 2017 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
    Enter Private Key Password: **************************
    Wed Apr 19 21:51:05 2017 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
    Wed Apr 19 21:51:05 2017 Control Channel Authentication: tls-auth using INLINE static key file
    Wed Apr 19 21:51:05 2017 UDPv4 link local: [undef]
    Wed Apr 19 21:51:05 2017 UDPv4 link remote: [AF_INET]192.168.1.8:1194
    Wed Apr 19 21:51:10 2017 [server] Peer Connection Initiated with [AF_INET]192.168.1.8:1194
    Wed Apr 19 21:51:12 2017 TUN/TAP device tun0 opened
    Wed Apr 19 21:51:12 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
    Wed Apr 19 21:51:12 2017 /sbin/ip link set dev tun0 up mtu 1500
    Wed Apr 19 21:51:12 2017 /sbin/ip addr add dev tun0 10.8.0.6/24 broadcast 10.8.0.255
    RTNETLINK answers: File exists
    Wed Apr 19 21:51:12 2017 ERROR: Linux route add command failed: external program exited with error status: 2
    Wed Apr 19 21:51:12 2017 Initialization Sequence Completed
    

    Voila le retour de route sur Xubuntu connecté au vpn

    └─ $ ▶ route
    Table de routage IP du noyau
    Destination Passerelle Genmask Indic Metric Ref Use Iface
    default 10.8.0.1 128.0.0.0 UG 0 0 0 tun0
    default 192.168.1.1 0.0.0.0 UG 100 0 0 enp14s0
    10.8.0.0 * 255.255.255.0 U 0 0 0 tun0
    10.8.0.1 10.8.0.1 255.255.255.255 UGH 0 0 0 tun0
    128.0.0.0 10.8.0.1 128.0.0.0 UG 0 0 0 tun0
    link-local * 255.255.0.0 U 1000 0 0 tun0
    192.168.1.0 10.8.0.1 255.255.255.0 UG 0 0 0 tun0
    192.168.1.0 * 255.255.255.0 U 100 0 0 enp14s0
    vpn.0rion * 255.255.255.255 UH 0 0 0 enp14s0
    

    Je suis aussi en train d'essayer sur Debian (un serv en cours de prepa) et là j'arrive à me connecter au VPN, à pinger les autres clients du VPN, le Lan et l'internet par contre quand je check mon IP avec curl je vois l'IP du client Debian et non l'IP du VPN):

    root@0rionServer1:/home/voxpopuli# openvpn --cd /etc/openvpn --config 0rionServer1.ovpn
    Wed Apr 19 22:02:55 2017 OpenVPN 2.3.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Nov 12 2015
    Wed Apr 19 22:02:55 2017 library versions: OpenSSL 1.0.1t 3 May 2016, LZO 2.08
    Wed Apr 19 22:02:55 2017 Control Channel Authentication: tls-auth using INLINE static key file
    Wed Apr 19 22:02:55 2017 UDPv4 link local: [undef]
    Wed Apr 19 22:02:55 2017 UDPv4 link remote: [AF_INET]192.168.1.8:1194
    Wed Apr 19 22:03:00 2017 [server] Peer Connection Initiated with [AF_INET]192.168.1.8:1194
    Wed Apr 19 22:03:02 2017 TUN/TAP device tun0 opened
    Wed Apr 19 22:03:02 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
    Wed Apr 19 22:03:02 2017 /sbin/ip link set dev tun0 up mtu 1500
    Wed Apr 19 22:03:02 2017 /sbin/ip addr add dev tun0 10.8.0.4/24 broadcast 10.8.0.255
    RTNETLINK answers: File exists
    Wed Apr 19 22:03:02 2017 ERROR: Linux route add command failed: external program exited with error status: 2
    RTNETLINK answers: File exists
    Wed Apr 19 22:03:02 2017 ERROR: Linux route add command failed: external program exited with error status: 2
    Wed Apr 19 22:03:02 2017 Initialization Sequence Completed
    

    Le retour de route sur Debian est légèrement différent

    Table de routage IP du noyau
    Destination Passerelle Genmask Indic Metric Ref Use Iface
    default 10.8.0.1 128.0.0.0 UG 0 0 0 tun0
    default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
    10.8.0.0 * 255.255.255.0 U 0 0 0 tun0
    10.8.0.1 10.8.0.1 255.255.255.255 UGH 0 0 0 tun0
    128.0.0.0 10.8.0.1 128.0.0.0 UG 0 0 0 tun0
    192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
    vpn.0rion 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0
    

    PS: désolé si c'est long, j'ai préféré poster full détails, si ça peut aider c'est ça de pris :)

    Donation Bitcoin : 1N8QGrhJGWdZNQNSspm3rSGjtXaXv9Ngat