Hi,
I have a problem with my openvpn server. if I ping with internal openvpn ip (Server ping 192.168.9.6) i can establish communication but in other case if I ping with 192.168.11.204 I can't establish communication.
I have done a picture to see easier the components (public ips are fake).
Openvpn.log I have seen this.
Thu Nov 24 10:20:54 2011 us=241047 vpn-seafi/82.62.111.123:1195 MULTI: bad source address from client [192.168.11.201], packet dropped
Thank you for your help!!
SERVER
My server.conf
# Local address to listen on. i.e. the OpenVPN server's LAN address
local 192.168.0.22
# The default OpenVPN port
port 1195
# Protocol used to transmit between OpenVPN nodes
proto udp
# Interface for the OpevVPN tunnel
dev tun0
# Required keys and certificates
ca /etc/openvpn/certs/ca.crt
cert /etc/openvpn/certs/vpn-server.crt
key /etc/openvpn/keys/vpn-server.key # This file should be kept secret
dh /etc/openvpn/dh2048.pem
# The server directive instructs this OpenVPN instance to act as the central node.
# The network IP address and netmask are used for the point-to-point connections
# between the OpenVPN server and the client nodes. Only the server and the client
# need to know about this subnet.
server 192.168.9.0 255.255.255.0
# Create a file for persistent IP addresses. Helpful for intermittent connections.
ifconfig-pool-persist /etc/openvpn/ipp.txt
# Advertise the server's network to connecting clients
push "route 192.168.0.0 255.255.255.0"
# Specific client configurations
client-config-dir client-configs
# Route server-side traffic bound for the client network
route 192.168.11.0 255.255.255.0
# Periodically check connectivity through the tunnel and restart if connectivity
# is lost
keepalive 10 120
# Cipher to use for encryption
cipher BF-CBC # Blowfish (default)
max-clients 5
# Downgrade to an unpriviledged user for security after initialization
user nobody
group nobody
# Use a persistent key and tunnel interface. Helpful if running as an
# unpriviledged user and the connection goes down.
persist-key
persist-tun
# Log location and verbosity level
status /var/log/openvpn-status.log
log-append /var/log/openvpn.log
verb 5
# Fork to the backgroud on successful initialization
daemon
server interfaces
eth0 Link encap:Ethernet direcciónHW 00:50:56:81:3f:45
Direc. inet:192.168.0.22 Difus.:0.0.0.0 Másc:255.255.255.0
Dirección inet6: fe80::250:56ff:fe81:3f45/64 Alcance:Enlace
ACTIVO DIFUSIÃN FUNCIONANDO MULTICAST MTU:1500 Métrica:1
Paquetes RX:20525 errores:0 perdidos:2889 overruns:0 frame:0
Paquetes TX:774 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:1000
Bytes RX:1746832 (1.7 MB) TX bytes:79513 (79.5 KB)
Interrupción:18 Dirección base: 0x2000
lo Link encap:Bucle local
Direc. inet:127.0.0.1 Másc:255.0.0.0
Dirección inet6: ::1/128 Alcance:Anfitrión
ACTIVO BUCLE FUNCIONANDO MTU:16436 Métrica:1
Paquetes RX:0 errores:0 perdidos:0 overruns:0 frame:0
Paquetes TX:0 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:0
Bytes RX:0 (0.0 B) TX bytes:0 (0.0 B)
tun0 Link encap:UNSPEC direccionHW 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
Direc. inet:192.168.9.1 P-t-P:192.168.9.2 Másc:255.255.255.255
ACTIVO PUNTO A PUNTO FUNCIONANDO NOARP MULTICAST MTU:1500 Métrica:1
Paquetes RX:16 errores:0 perdidos:0 overruns:0 frame:0
Paquetes TX:5 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:100
Bytes RX:1156 (1.1 KB) TX bytes:420 (420.0 B)
ccd vpn-seafi File in Server
iroute 192.168.11.0 255.255.255.0
push "route 192.168.0.0 255.255.255.0 vpn_gateway"
server routes
Tabla de rutas IP del nucleo
Destino Pasarela Genmask Indic Métric Ref Uso Interfaz
default 192.168.0.17 0.0.0.0 UG 100 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.9.0 192.168.9.2 255.255.255.0 UG 0 0 0 tun0
192.168.9.2 * 255.255.255.255 UH 0 0 0 tun0
192.168.11.0 192.168.9.2 255.255.255.0 UG 0 0 0 tun0
Ping server tests
ping 192.168.9.6
PING 192.168.9.6 (192.168.9.6) 56(84) bytes of data.
64 bytes from 192.168.9.6: icmp_req=1 ttl=64 time=68.4 ms
64 bytes from 192.168.9.6: icmp_req=2 ttl=64 time=66.6 ms
PING 192.168.11.204 (192.168.11.204) 56(84) bytes of data.
^C
--- 192.168.11.204 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
CLIENT
client.conf
# Instructs OpenVPN to run in client mode, requests IP address and
# special instructions (like routes) from the server.
client
# Interface for tunnel
dev tun0
# Remote server to connect to. Can be domain name or IP address.
remote 62.43.111.123 1195
# Certificates and keys required for connection
ca /etc/openvpn/certs/ca.crt
cert /etc/openvpn/certs/vpn-seafi.crt
key /etc/openvpn/keys/vpn-seafi.key
# Symmetric cipher - Must be the same as the server's
cipher BF-CBC
# Protocol and Port - Must be the same on both server and client.
proto udp
port 1195
# Log to file instead of syslog
log-append /var/log/openvpn.log
verb 9
# Since the OpenVPN client is acting as a gateway for other machines
# on the client-side network, run as a daemon and downgrade user
# priviledges.
user nobody
group nobody
daemon
# Use a persistent key and tunnel interface.
persist-tun
persist-key
client interfaces
eth0 Link encap:Ethernet direccionHW 00:0c:29:d9:ce:18
Direc. inet:192.168.11.204 Difus.:0.0.0.0 Másc:255.255.255.0
Dirección inet6: fe80::20c:29ff:fed9:ce18/64 Alcance:Enlace
ACTIVO DIFUSIÃN FUNCIONANDO MULTICAST MTU:1500 Métrica:1
Paquetes RX:1571 errores:0 perdidos:0 overruns:0 frame:0
Paquetes TX:737 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:1000
Bytes RX:132188 (132.1 KB) TX bytes:66919 (66.9 KB)
Interrupción:18 Dirección base: 0x1400
lo Link encap:Bucle local
Direc. inet:127.0.0.1 Másc:255.0.0.0
Dirección inet6: ::1/128 Alcance:Anfitrión
ACTIVO BUCLE FUNCIONANDO MTU:16436 Métrica:1
Paquetes RX:0 errores:0 perdidos:0 overruns:0 frame:0
Paquetes TX:0 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:0
Bytes RX:0 (0.0 B) TX bytes:0 (0.0 B)
tun0 Link encap:UNSPEC direcciónHW 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
Direc. inet:192.168.9.6 P-t-P:192.168.9.5 Másc:255.255.255.255
ACTIVO PUNTO A PUNTO FUNCIONANDO NOARP MULTICAST MTU:1500 Métrica:1
Paquetes RX:0 errores:0 perdidos:0 overruns:0 frame:0
Paquetes TX:17 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:100
Bytes RX:0 (0.0 B) TX bytes:1216 (1.2 KB)
client routes
Tabla de rutas IP del nucleo
Destino Pasarela Genmask Indic Metrica Ref Uso Interfaz
default 192.168.11.1 0.0.0.0 UG 100 0 0 eth0
192.168.0.0 192.168.9.5 255.255.255.0 UG 0 0 0 tun0
192.168.9.1 192.168.9.5 255.255.255.255 UGH 0 0 0 tun0
192.168.9.5 * 255.255.255.255 UH 0 0 0 tun0
192.168.11.0 * 255.255.255.0 U 0 0 0 eth0
CLIENT PING TESTS
PING 192.168.0.189 (192.168.0.189) 56(84) bytes of data.
^C
--- 192.168.0.189 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1005ms
PING 192.168.9.1 (192.168.9.1) 56(84) bytes of data.
64 bytes from 192.168.9.1: icmp_req=1 ttl=64 time=67.4 ms
64 bytes from 192.168.9.1: icmp_req=2 ttl=64 time=65.7 ms
I have ip forwarding enabled in the server and client.
net.ipv4.ip_forward = 1
Tracert beetwen my pc client with the other network
Traza a 192.168.0.7 sobre caminos de 30 saltos como máximo.
1 <1 ms 2 ms 1 ms 192.168.11.204
2 * * * Tiempo de espera agotado para esta solicitud.
3 * ^C