Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2372 connectés 

  FORUM HardWare.fr
  Linux et OS Alternatifs
  Installation

  OpenVPN: Lan accessible mais Internet pas accessible

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

OpenVPN: Lan accessible mais Internet pas accessible

n°1281539
boobax
il BuongiornoSiVedeDalTacchino
Posté le 10-06-2011 à 09:50:54  profilanswer
 

Bonjour,
Ca fait 8h que je galere mais je ne parviens pas a acceder a internet depuis le VPN.
J'accede a tout mon LAN sans pbm.
 
(MOI)192.168.0.11--->192.168.0.0||--->INTERNET--->||192.168.1.1--->192.168.1.11(VPN)
 
Voici mon /etc/openvpn/server.conf

# main configuration #
mode server
 
local 192.168.1.11  
port 1194
proto udp
 
script-security 2
 
# bridging directive - this is needed to use the br0
dev tap0
# script to attach the tap0 interface to the bridge
up "/etc/openvpn/up.sh br0 tap0 1500"
down "/etc/openvpn/down.sh br0 tap0"
 
persist-key
persist-tun
 
#certificates and encryption
ca keys/ca.crt
cert keys/server.crt
key keys/server.key  # This file should be kept secret
dh keys/dh1024.pem
 
cipher BF-CBC   # Blowfish (default)
comp-lzo        # compression
 
# enable communication between vpn clients
client-to-client
 
# enable multiple access from the same client certificate
duplicate-cn
 
# DHCP configuration #
# ipp.txt saves the status of the dhcp leases
ifconfig-pool-persist ipp.txt
# pool of addresses available for VPN leases
# format: <server IP> <netmask> <pool start IP> <pool end IP>
server-bridge 192.168.1.11 255.255.255.0 192.168.1.220 192.168.1.229
# additional option to give to dhcp clients
push "dhcp-option DNS 192.168.1.1"
push "redirect-gateway def1"
push "route 192.168.1.0 255.255.255.0 192.168.1.1"
 
# maximium number of clients connected at a time
max-clients 10
 
# log and security #
user nobody
group nogroup
keepalive 10 120
status openvpn-status.log
verb 3


 
ifconfig
 


br0       Link encap:Ethernet  HWaddr x  
          inet adr:192.168.1.11  Bcast:192.168.1.255  Masque:255.255.255.0
          adr inet6: x/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10109 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6529 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0  
          RX bytes:1073505 (1.0 MiB)  TX bytes:936947 (914.9 KiB)
 
eth1      Link encap:Ethernet  HWaddr x  
          inet adr:192.168.1.11  Bcast:192.168.1.255  Masque:255.255.255.0
          adr inet6: x/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9828 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7252 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000  
          RX bytes:1212885 (1.1 MiB)  TX bytes:1006940 (983.3 KiB)
          Interruption:19 Adresse de base:0x6000  
 
lo        Link encap:Boucle locale  
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:268 errors:0 dropped:0 overruns:0 frame:0
          TX packets:268 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0  
          RX bytes:18552 (18.1 KiB)  TX bytes:18552 (18.1 KiB)
 
tap0      Link encap:Ethernet  HWaddr 66:d4:35:cd:a6:8f  
          adr inet6: x/64 Scope:Lien
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:113 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1048 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:100  
          RX bytes:9245 (9.0 KiB)  TX bytes:86083 (84.0 KiB)
 


 
/etc/openvpn/up.sh
 

#!/bin/sh
 
BR=$1
DEV=$2
MTU=$3
/sbin/ifconfig $DEV mtu $MTU promisc up
/usr/sbin/brctl addif $BR $DEV


 
/etc/openvpn/down.sh
 

#!/bin/sh
 
BR=$1
DEV=$2
 
/usr/sbin/brctl delif $BR $DEV
/sbin/ifconfig $DEV down


 
route -n
 

Table de routage IP du noyau
Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 br0


 
brctl show
 

bridge name bridge id  STP enabled interfaces
br0  8000.003018a62792 no  eth1
                            tap0


 
J'ai mis net.ipv4.ip_forward=1 dans /etc/sysctl.conf pour activer le routage
 
Dans Iptables j'ai essayé tous types de configuration. Voici les dernieres commandes :
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 192.168.1.1
iptables -A FORWARD -i tap0 -j ACCEPT
iptables -A INPUT -i tap+ -j ACCEPT
iptables -A FORWARD -i tap+ -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.1/24 -o eth1 -j MASQUERADE
iptables -A INPUT -i tap0 -j ACCEPT
iptables -A INPUT -i br0 -j ACCEPT
iptables -A FORWARD -i br0 -j ACCEPT
 
Qui donnent :
 

Chain INPUT (policy ACCEPT)
target     prot opt source               destination          
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
 
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination          
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
 
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination


 

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination          
 
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination              
SNAT       all  --  anywhere             anywhere            to:192.168.1.1  
MASQUERADE  all  --  192.168.1.0/24       anywhere            
 
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination


 
Sur le client connecté au VPN :
 

C:\Documents and Settings\Administrateur>ping 192.168.1.1
 
Envoi d'une requête 'ping' sur 192.168.1.1 avec 32 octets de données :
 
Réponse de 192.168.1.1 : octets=32 temps=56 ms TTL=64


C:\Documents and Settings\Administrateur>ping google.fr
 
Envoi d'une requête 'ping' sur google.fr [209.85.147.103] avec 32 octe
ées :
 
Réponse de 192.168.1.11 : Impossible de joindre l'hôte de destination.


Carte Ethernet Connexion réseau sans fil:
 
        Suffixe DNS propre à la connexion :
        Description . . . . . . . . . . . : Carte Mini de réseau local sans fil
1397 de Dell
        Adresse physique . . . . . . . . .: x
        DHCP activé. . . . . . . . . . . : Oui
        Configuration automatique activée . . . . : Oui
        Adresse IP. . . . . . . . . . . . : 192.168.0.11
        Masque de sous-réseau . . . . . . : 255.255.255.0
        Passerelle par défaut . . . . . . : 192.168.0.254
        Serveur DHCP. . . . . . . . . . . : 192.168.0.254
        Serveurs DNS . . . . . . . . . .  : 212.27.40.240
                                            212.27.40.241
        Bail obtenu . . . . . . . . . . . : vendredi 10 juin 2011 05:25:39
        Bail expirant . . . . . . . . . . : lundi 20 juin 2011 05:25:39
 
Carte Ethernet Connexion au réseau local 2:
 
        Suffixe DNS propre à la connexion :
        Description . . . . . . . . . . . : TAP-Win32 Adapter V8
        Adresse physique . . . . . . . . .: x
        DHCP activé. . . . . . . . . . . : Oui
        Configuration automatique activée . . . . : Oui
        Adresse IP. . . . . . . . . . . . : 192.168.1.220
        Masque de sous-réseau . . . . . . : 255.255.255.0
        Passerelle par défaut . . . . . . : 192.168.1.11
        Serveur DHCP. . . . . . . . . . . : 192.168.1.0
        Serveurs DNS . . . . . . . . . .  : 192.168.1.1
        Bail obtenu . . . . . . . . . . . : vendredi 10 juin 2011 09:43:53
        Bail expirant . . . . . . . . . . : samedi 9 juin 2012 09:43:53
 


C:\Documents and Settings\Administrateur>route print
===========================================================================
Liste d'Interfaces
0x1 ........................... MS TCP Loopback interface
0x2 ...x ...... Realtek PCIe GBE Family Controller - Miniport d'
ordonnancement de paquets
0x3 ...x ...... Carte Mini de rÚseau local sans fil 1397 de Dell
 - Miniport d'ordonnancement de paquets
0x20005 ...x...... TAP-Win32 Adapter V8 - Miniport d'ordonnance
ment de paquets
===========================================================================
===========================================================================
Itinéraires actifs :
Destination réseau    Masque réseau  Adr. passerelle   Adr. interface Métrique
          0.0.0.0          0.0.0.0    192.168.0.254    192.168.0.11       25
          0.0.0.0        128.0.0.0     192.168.1.11   192.168.1.220       1
     XXX.XXX.XXX.XXX  255.255.255.255    192.168.0.254    192.168.0.11       1
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
        128.0.0.0        128.0.0.0     192.168.1.11   192.168.1.220       1
      192.168.0.0    255.255.255.0     192.168.0.11    192.168.0.11       25
     192.168.0.11  255.255.255.255        127.0.0.1       127.0.0.1       25
    192.168.0.255  255.255.255.255     192.168.0.11    192.168.0.11       25
      192.168.1.0    255.255.255.0    192.168.1.220   192.168.1.220       30
      192.168.1.0    255.255.255.0      192.168.1.1   192.168.1.220       1
    192.168.1.220  255.255.255.255        127.0.0.1       127.0.0.1       30
    192.168.1.255  255.255.255.255    192.168.1.220   192.168.1.220       30
        224.0.0.0        240.0.0.0     192.168.0.11    192.168.0.11       25
        224.0.0.0        240.0.0.0    192.168.1.220   192.168.1.220       30
  255.255.255.255  255.255.255.255     192.168.0.11               2       1
  255.255.255.255  255.255.255.255     192.168.0.11    192.168.0.11       1
  255.255.255.255  255.255.255.255    192.168.1.220   192.168.1.220       1
Passerelle par défaut :      192.168.1.11
===========================================================================
Itinéraires persistants :
  Aucun


 
Je vois toujours pas ce qui cloche ! Je pense que c'est iptables.
Vous pouvez m'aider s'il vous plait.


Message édité par boobax le 10-06-2011 à 09:57:56
mood
Publicité
Posté le 10-06-2011 à 09:50:54  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Linux et OS Alternatifs
  Installation

  OpenVPN: Lan accessible mais Internet pas accessible

 

Sujets relatifs
[Iptables] Routage de l'IP Wan vers une autre IP Internetmonter une solution libre de VPN : openvpn ou autre ?
Démarrer PC sans OS (internet)mediatomb pas accessible au démarrage
OpenVpn sur HP-UX, possible ?Ipcop: pas d'accès à internet
Installer the gimp sans internetProbleme de firewall et serveur openvpn
[Résolu] Détecter une nouvelle adresse Mac sur un réseau LAN 
Plus de sujets relatifs à : OpenVPN: Lan accessible mais Internet pas accessible


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR