I am trying to implement the proxy-arp setup described in OpenVPN 2 Cookbook (page 65) but it doesn't quite work. Clients do not correctly reach the LAN behind the OpenVPN server. I am trying to ping a host on the LAN from a remote OpenVPN client.
The server's subnet, i.e. LAN, is 10.60.2.0/24 and OpenVPN serves 10.61.0.0/16 for the clients, as can be seen below.
The main interface is eth0, IP forwarding is activated and no special routes are set on the LAN. I have also not activated any proxy_arp settings (i.e. /proc/sys/net/ipv4/conf/eth0/proxy_arp), as the recipe doesn't mention anything regarding this. Not that setting or unsetting proxy_arp changes anything, anyway.
The server is a KVM-based virtual machine (bridged to the 10.60.2.0/24 subnet) running Ubuntu 11.04 Server and OpenVPN 2.1.3. The client is Ubuntu 11.04 Desktop.
Using tcpdump I can see that ICMP requests (ping) from a connected client reach the LAN (10.60.2.0/24) correctly and the pinged host replies but those ICMP replies seem to get lost somewhere:
Code: Select all
# On host 10.60.2.40 on the LAN, the client is 10.61.0.2
23:12:19.771667 IP 10.61.0.2 > 10.60.2.40: ICMP echo request, id 9926, seq 629, length 64
23:12:19.771686 IP 10.60.2.40 > 10.61.0.2: ICMP echo reply, id 9926, seq 629, length 64
Code: Select all
Address HWtype HWaddress Flags Mask Iface
10.60.2.40 ether 0a:34:9d:e4:c9:78 C eth0
10.60.2.30 ether 00:22:19:98:c4:5e C eth0
10.60.2.10 ether 00:90:7f:41:61:64 C eth0
10.61.0.2 * <from_interface> MP eth0
Thanks in advance!
The server configuration:
Code: Select all
port 1194
proto udp
dev tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key
dh /etc/openvpn/dh2048.pem
tls-auth /etc/openvpn/ta.key 0
verb 3
server 10.61.0.0 255.255.0.0
topology subnet
push "route 10.60.2.0 255.255.255.0"
push "dhcp-option DNS 10.60.2.40"
keepalive 10 30
comp-lzo
persist-key
persist-tun
plugin /usr/lib/openvpn/openvpn-auth-pam.so openvpn
client-to-client
client-cert-not-required
username-as-common-name
script-security 2
client-connect /etc/openvpn/scripts/proxyarp-connect.sh
client-disconnect /etc/openvpn/scripts/proxyarp-disconnect.sh
status /var/log/openvpn/status.log
log-append /var/log/openvpn/openvpn.log
Code: Select all
#!/bin/bash
/usr/sbin/arp -i eth0 -Ds $ifconfig_pool_remote_ip eth0 pub
Code: Select all
#!/bin/bash
/usr/sbin/arp -i eth0 -d $ifconfig_pool_remote_ip
Code: Select all
client
proto udp
remote vpn.example.com
port 1194
dev tun
nobind
comp-lzo
ca /etc/openvpn/server.ca.crt
tls-auth /etc/openvpn/ta.key 1
auth-user-pass
tls-remote vpn.example.com
ns-cert-type server
explicit-exit-notify 5
pull
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf