1

i have a situation where i have a server on the IP range of 192.168.255.0/24 and a subnet on the range of 10.0.0.0/24

I state the problem here before adding the config. I am pushing the route to the server network with push "route 192.168.255.0 255.255.255.0 192.168.255.1" this I tested with 2 different client machines

TEST 1 the first throws an error telling RTNETLINK answers: Network is unreachable the ip routes table does not get any related entry

root@127:/etc/openvpn/client# ip route
default via 192.168.88.1 dev eth0 proto dhcp metric 100
10.0.0.0/24 dev tun0 proto kernel scope link src 10.0.0.1
192.168.88.0/24 dev eth0 proto kernel scope link src 192.168.88.154 metric 100
213.136.74.54 via 192.168.88.1 dev eth0

the same happens when i try to add it manually ip route add 192.168.255.0/24 via 192.168.255.1 dev tun0

TEST 2 the second is a mac and it throws no error but puts the route in the wrong interface i guess it should be utun3 not en0

Internet:
Destination        Gateway            Flags           Netif Expire
default            192.168.88.1       UGScg             en0
10/24              10.0.0.2           UGSc            utun3
10.0.0.2           10.0.0.2           UH              utun3
192.168.255        192.168.255.1      UGSc              en0

Here my config

server 192.168.255.0 255.255.255.0
verb 3
key /etc/openvpn/pki/private/VPN.greenhive.at.key
ca /etc/openvpn/pki/ca.crt
cert /etc/openvpn/pki/issued/VPN.greenhive.at.crt
dh /etc/openvpn/pki/dh.pem
tls-auth /etc/openvpn/pki/ta.key
key-direction 0
keepalive 10 60
persist-key
persist-tun

proto udp
port 1194
dev tun
status /tmp/openvpn-status.log
topology subnet
client-config-dir ccd

#user nobody
#group nogroup
comp-lzo no
client-to-client

### Route Configurations Below
route 192.168.255.0 255.255.255.0
route 10.0.0.0 255.255.255.0
route 10.0.1.0 255.255.255.0

### Push Configurations Below
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "comp-lzo no"
push "route 192.168.255.0 255.255.255.0 192.168.255.1"
3
  • 1
    You appear to be using the same 192.168.255.0/24 subnet as a network physically connected to your server and for your OpenVPN subnet. You can't do that. Pick a different subnet for OpenVPN to connect its clients to the server
    – roaima
    May 3 at 8:38
  • you have to understand that openvpn is a router by itself. So you have to integrate a router (openvpn) within a router (your server), then tell openvpn to instruct the server which route it has ("route ...") and to your client which route it give to them (push "route ...")
    – dominix
    May 3 at 9:14
  • Hi, the client I tested it with is my macbook and it definitively does no have anything on the en0. Moreover it does not even have an ethernet attached. so i have no clue how that entry got there other than via the openvpn script May 3 at 20:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.