• [^] # Re: Pourquoi 2 tunnels croisés entre les 2 mêmes machines ?

    Posté par . En réponse au message Connecter deux réseaux OpenVPN. Évalué à 1.

    Depuis un client de VPN2

    └─ $ ▶ route -n
    Table de routage IP du noyau
    Destination Passerelle Genmask Indic Metric Ref Use Iface
    0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 enp14s0
    10.8.6.0 (VPN1) 10.8.5.1 (VPN2) 255.255.255.0 UG 0 0 0 tun0
    10.8.6.1 (VPN1) 10.8.5.1 (VPN2) 255.255.255.255 UGH 0 0 0 tun0
    10.8.5.0 (VPN2) 0.0.0.0 255.255.255.0 U 0 0 0 tun0
    10.8.5.1 (VPN2) 10.8.5.1 (VPN2) 255.255.255.255 UGH 0 0 0 tun0
    169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp14s0
    192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 enp14s0
    
    └─ $ ▶ traceroute 10.8.5.1 (VPN2)
    traceroute to 10.8.5.1 (VPN2) (10.8.5.1 (VPN2)), 30 hops max, 60 byte packets
     1 10.8.5.1 (VPN2) (10.8.5.1 (VPN2)) 328.468 ms 328.457 ms 328.453 ms
    
     └─ $ ▶ traceroute 10.8.6.1 (VPN1)
    traceroute to 10.8.6.1 (VPN1) (10.8.6.1 (VPN1)), 30 hops max, 60 byte packets
     1 10.8.5.1 (VPN2) (10.8.5.1 (VPN2)) 464.628 ms 559.468 ms 706.238 ms
     2 * * *
     3 * * *
    [...]
    29 * * *
    30 * * *
    

    Dans le fichier /etc/openvpn/server.conf de VPN2

    topology subnet
    server 10.8.5.0 255.255.255.0
    # server and remote endpoints
    ifconfig 10.8.5.1 10.8.5.2
    # Add route to Client routing table for the OpenVPN Server
    push "route 10.8.5.1 255.255.255.255"
    push "route 10.8.6.1 255.255.255.255"
    # Add route to Client routing table for the OPenVPN Subnet
    push "route 10.8.5.0 255.255.255.0"
    push "route 10.8.6.0 255.255.255.0"
    

    et push "redirect-gateway def1 bypass-dhcp" est commenté

    Donation Bitcoin : 1N8QGrhJGWdZNQNSspm3rSGjtXaXv9Ngat