Bonjour à tous,
J’ai un soucis avec mon serveur OpenVPN sur un Raspberry, j’arrive à me connecter dessus à partir d’un poste client, mais je n’ai pas accès à internet. Je vais essayé de vous décrire au mieux la situation.
Box (192.168.1.254) - Routeur (192.168.2.1) - Raspberry (192.168.2.21, eth0) (10.8.0.1, tun0) - Client (192.168.2.20, eth0) (10.8.0.6, tun0)
La box est en DMZ vers le routeur, elle n’a pas d’autre fonction. Tout est désactiver dessus.
ifconfig serveur:
[code] ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:08:6a:c0
inet adr:192.168.2.21 Bcast:192.168.2.255 Masque:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:86417 errors:0 dropped:0 overruns:0 frame:0
TX packets:94185 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:35160153 (33.5 MiB) TX bytes:87541222 (83.4 MiB)
lo Link encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:5813 errors:0 dropped:0 overruns:0 frame:0
TX packets:5813 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:2988130 (2.8 MiB) TX bytes:2988130 (2.8 MiB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet adr:10.8.0.1 P-t-P:10.8.0.2 Masque:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:939 errors:0 dropped:0 overruns:0 frame:0
TX packets:205 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:100
RX bytes:54655 (53.3 KiB) TX bytes:25529 (24.9 KiB)
[/code]
ipconfig client
[code]Configuration IP de Windows
Carte Ethernet Ethernet :
Suffixe DNS propre … la connexion. . . :
Adresse IPv4. . . . . . . . . . . . . .: 192.168.2.20
Masque de sous-r‚seau. . . .ÿ. . . . . : 255.255.255.0
Passerelle par d‚faut. . . .ÿ. . . . . : 192.168.2.1
Carte Ethernet Ethernet 2 :
Suffixe DNS propre … la connexion. . . :
Adresse IPv4. . . . . . . . . . . . . .: 10.8.0.6
Masque de sous-r‚seau. . . .ÿ. . . . . : 255.255.255.252
Passerelle par d‚faut. . . .ÿ. . . . . :
[/code]
server.conf
[code]mode server
proto tcp
port 443
port-share 127.0.0.1 4443
dev tun
Cles et certificats
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
tls-auth ta.key 0
cipher AES-256-CBC
Reseau
server 10.8.0.0 255.255.255.0
push "dhcp-option DNS 10.8.0.1"
push "dhcp-option WINS 10.8.0.1"
push "redirect-gateway def1"
client-to-client
duplicate-cn
keepalive 30 60
Securite
user openvpn
group openvpn
chroot /etc/openvpn/jail
persist-key
persist-tun
comp-lzo
Log
verb 5
mute 20
status openvpn-status.log
log-append /var/log/openvpn/server.log[/code]
client.conf
[code]# Client
client
dev tun
proto tcp-client
remote IP DU SERVEUR 443
resolv-retry infinite
cipher AES-256-CBC
Cles
ca ca.crt
cert server.crt
key server.key
tls-auth ta.key 1
Securite
nobind
persist-key
persist-tun
comp-lzo
verb 3
[/code]
Route serveur
Table de routage IP du noyau
Destination Passerelle Genmask Indic Metric Ref Use Iface
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Route client (Windows)
[code]Liste d’Interfaces
7…d4 3d 7e bc 65 b5 …Killer e2200 Gigabit Ethernet Controller
4…00 ff 13 d6 17 a3 …TAP-Windows Adapter V9
1…Software Loopback Interface 1
IPv4 Table de routage
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.2.1 192.168.2.20 10
0.0.0.0 128.0.0.0 10.8.0.5 10.8.0.6 20
10.8.0.0 255.255.255.0 10.8.0.5 10.8.0.6 20
10.8.0.4 255.255.255.252 On-link 10.8.0.6 276
10.8.0.6 255.255.255.255 On-link 10.8.0.6 276
10.8.0.7 255.255.255.255 On-link 10.8.0.6 276
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
128.0.0.0 128.0.0.0 10.8.0.5 10.8.0.6 20
176.184.77.69 255.255.255.255 192.168.2.1 192.168.2.20 10
192.168.2.0 255.255.255.0 On-link 192.168.2.20 266
192.168.2.20 255.255.255.255 On-link 192.168.2.20 266
192.168.2.255 255.255.255.255 On-link 192.168.2.20 266
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 10.8.0.6 276
224.0.0.0 240.0.0.0 On-link 192.168.2.20 266
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 10.8.0.6 276
255.255.255.255 255.255.255.255 On-link 192.168.2.20 266[/code]
Iptables
[code] iptables-save
Generated by iptables-save v1.4.21 on Mon Aug 3 22:51:01 2015
*mangle
:PREROUTING ACCEPT [541:81230]
:INPUT ACCEPT [541:81230]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [498:330206]
:POSTROUTING ACCEPT [498:330206]
COMMIT
Completed on Mon Aug 3 22:51:01 2015
Generated by iptables-save v1.4.21 on Mon Aug 3 22:51:01 2015
*nat
:PREROUTING ACCEPT [11:2375]
:INPUT ACCEPT [3:194]
:OUTPUT ACCEPT [40:3258]
:POSTROUTING ACCEPT [40:3258]
-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
COMMIT
Completed on Mon Aug 3 22:51:01 2015
Generated by iptables-save v1.4.21 on Mon Aug 3 22:51:01 2015
*filter
:INPUT DROP [31:7353]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [300:171157]
-A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 1809 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 50000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 7500 -j ACCEPT
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 10.8.0.0/24 -j ACCEPT
COMMIT
Completed on Mon Aug 3 22:51:01 2015
Generated by iptables-save v1.4.21 on Mon Aug 3 22:51:01 2015
*raw
:PREROUTING ACCEPT [566:82254]
:OUTPUT ACCEPT [543:339506]
COMMIT
Completed on Mon Aug 3 22:51:01 2015
[/code]
IP forward
cat /proc/sys/net/ipv4/ip_forward
1
J’arrive à ping le client depuis le serveur et vice versa.
Je m’oriente vers un problème avec la table de routage (qui me parait complètement incohérente coté client), mais j’y connais pas grand chose Si vous avez des pistes je suis tout ouïe ! Merci beaucoup.