Can not ping server, network unreachable

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
monkfood
OpenVpn Newbie
Posts: 6
Joined: Sun Apr 24, 2022 4:38 pm

Can not ping server, network unreachable

Post by monkfood » Tue May 03, 2022 5:35 am

Hi, 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

Code: Select all

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

Code: Select all

RTNETLINK answers: Network is unreachable
the ip routes table does not get any related entry

Code: Select all

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

Code: Select all

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

Code: Select all

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

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"
[/oconf=server]

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Can not ping server, network unreachable

Post by TinCanTech » Tue May 03, 2022 8:51 am

You have this:
monkfood wrote:
Tue May 03, 2022 5:35 am
server 192.168.255.0 255.255.255.0
which makes these redundant:
monkfood wrote:
Tue May 03, 2022 5:35 am
route 192.168.255.0 255.255.255.0
push "route 192.168.255.0 255.255.255.0 192.168.255.1"

monkfood
OpenVpn Newbie
Posts: 6
Joined: Sun Apr 24, 2022 4:38 pm

Re: Can not ping server, network unreachable

Post by monkfood » Tue May 03, 2022 8:32 pm

TinCanTech wrote:
Tue May 03, 2022 8:51 am
You have this:
monkfood wrote:
Tue May 03, 2022 5:35 am
server 192.168.255.0 255.255.255.0
which makes these redundant:
monkfood wrote:
Tue May 03, 2022 5:35 am
route 192.168.255.0 255.255.255.0
push "route 192.168.255.0 255.255.255.0 192.168.255.1"
Thanks for the reply, i thought so, it was a desperate attempt but of course it did not change anything on the problem

Post Reply