Hi,
I've recently set up OpenVPN on my Raspberry Pi. Everything seems to work nicely - I can access my home network resources (and internet access) from outside of my home.
Just puzzled by the error below:
[b]Sun Aug 02 09:41:41 2015 Warning: address 10.0.0.22 is not a network address in relation to netmask 255.0.0.0[/b]
I've searched quite a few threads, and tinkered with various IP settings in the files below, but all outcomes result in a connection, but loss of access, both to my internal resources and external internet access.
OpenVPN log:
Sun Aug 02 09:41:27 2015 OpenVPN 2.3.7 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [IPv6] built on Jul 9 2015
Sun Aug 02 09:41:27 2015 library versions: OpenSSL 1.0.1p 9 Jul 2015, LZO 2.08
Enter Management Password:
Sun Aug 02 09:41:34 2015 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sun Aug 02 09:41:34 2015 Control Channel Authentication: tls-auth using INLINE static key file
Sun Aug 02 09:41:34 2015 UDPv4 link local: [undef]
Sun Aug 02 09:41:34 2015 UDPv4 link remote: [AF_INET]x.x.x.x:1194
Sun Aug 02 09:41:34 2015 [[xxxxxxx]] Peer Connection Initiated with [AF_INET]x.x.x.x:1194
Sun Aug 02 09:41:36 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sun Aug 02 09:41:36 2015 open_tun, tt->ipv6=0
Sun Aug 02 09:41:36 2015 TAP-WIN32 device [OpenVPN] opened: \\.\Global\{048B4064-E193-420E-BCF8-909BA9DEBB86}.tap
Sun Aug 02 09:41:36 2015 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.0.10/255.255.255.252 on interface {048B4064-E193-420E-BCF8-909BA9DEBB86} [DHCP-serv: 10.8.0.9, lease-time: 31536000]
Sun Aug 02 09:41:36 2015 Successful ARP Flush on interface [3] {048B4064-E193-420E-BCF8-909BA9DEBB86}
Sun Aug 02 09:41:41 2015 Warning: address 10.0.0.22 is not a network address in relation to netmask 255.0.0.0
Sun Aug 02 09:41:41 2015 ROUTE: route addition failed using CreateIpForwardEntry: The parameter is incorrect. [status=87 if_index=3]
Sun Aug 02 09:41:41 2015 env_block: add PATH=C:\Windows\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun Aug 02 09:41:41 2015 ROUTE: route addition failed using CreateIpForwardEntry: The object already exists. [status=5010 if_index=3]
Sun Aug 02 09:41:41 2015 env_block: add PATH=C:\Windows\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun Aug 02 09:41:41 2015 Initialization Sequence Completed
/etc/interfaces:
auto lo
iface lo inet loopback
auto eth0
#allow-hotplug eth0
iface eth0 inet static
address 10.0.0.22
netmask 255.0.0.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.138
pre-up /etc/firewall-openvpn-rules.sh
#auto wlan0
#allow-hotplug wlan0
#iface wlan0 inet manual
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#auto wlan1
#allow-hotplug wlan1
#iface wlan1 inet manual
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
ifconfig:
eth0 Link encap:Ethernet HWaddr b8:27:eb:de:30:bb
inet addr:10.0.0.22 Bcast:10.0.0.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:345067 errors:0 dropped:0 overruns:0 frame:0
TX packets:340940 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:307458759 (293.2 MiB) TX bytes:324621497 (309.5 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:29299 errors:0 dropped:0 overruns:0 frame:0
TX packets:29299 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2412370 (2.3 MiB) TX bytes:2412370 (2.3 MiB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:115742 errors:0 dropped:0 overruns:0 frame:0
TX packets:223163 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:6467205 (6.1 MiB) TX bytes:291482046 (277.9 MiB)
/etc/firewall-openvpn-rules.sh:
#!/bin/sh
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source 10.0.0.22
/etc/openvpn/server.conf
local 10.0.0.22
dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/x.crt
key /etc/openvpn/easy-rsa/keys/x.key
dh /etc/openvpn/easy-rsa/keys/dh1024.pem
server 10.8.0.0 255.255.255.0
# server and remote endpoints
ifconfig 10.8.0.1 10.8.0.2
# Add route to Client routing table for the OpenVPN Server
push "route 10.8.0.1 255.255.255.255"
# Add route to Client routing table for the OpenVPN Subnet
push "route 10.8.0.0 255.255.255.0"
# your local subnet
push "route 10.0.0.22 255.0.0.0"
push "dhcp-option DNS 10.0.0.138"
push "redirect-gateway def1"
client-to-client
duplicate-cn
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
cipher AES-128-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn-status.log 20
log /var/log/openvpn.log
verb 1
Something to do with..?:
push "route 10.0.0.22 255.0.0.0"
Thanks in advance for any pointers...