Overriding a pushed "route" in the client's config throws an error

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
User avatar
Holmes.Sherlock
OpenVPN User
Posts: 40
Joined: Wed Jul 06, 2011 4:51 am

Overriding a pushed "route" in the client's config throws an error

Post by Holmes.Sherlock » Sat May 15, 2021 4:51 pm

I want to override the routes pushed by the server in the client.

Code: Select all

route 192.168.52.0 255.255.255.0
route 192.168.53.0 255.255.255.0
route 192.168.48.0 255.255.240.0
route 192.35.222.0 255.255.255.0
route-nopull
While this works as expected, the following errors appear in the log:

Code: Select all

Options error: option 'dhcp-option' cannot be used in this context ([PUSH-OPTIONS])
Options error: option 'dhcp-option' cannot be used in this context ([PUSH-OPTIONS])
Options error: option 'route' cannot be used in this context ([PUSH-OPTIONS])
Options error: option 'route' cannot be used in this context ([PUSH-OPTIONS])
Options error: option 'route' cannot be used in this context ([PUSH-OPTIONS])
Options error: option 'dhcp-option' cannot be used in this context ([PUSH-OPTIONS])
.
.
.
ERROR: Linux route add command failed: external program exited with error status: 2
What bothers me is, I am not sure where I can safely disregard the errors, or even how I can make those disappear.

Following this https://openvpn.net/faq/overriding-a-pu ... -an-error/, I pushedthe `route-nopull` option down after all the client routes are set. But, that didn't help.

Can anybody please help?

My full client configuration is below.

client

client
dev tun
remote <vpn_server_ip> 1194
nobind

cipher AES-256-CBC
auth SHA512
tls-cipher TLS-RSA-WITH-AES-256-CBC-SHA
keepalive 10 60

persist-key
persist-tun
persist-local-ip
persist-remote-ip

mssfix
tun-mtu 1500

route 192.168.52.0 255.255.255.0
route 192.168.53.0 255.255.255.0
route 192.168.48.0 255.255.240.0
route 192.35.222.0 255.255.255.0
route-nopull

remote-cert-tls server

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

Re: Overriding a pushed "route" in the client's config throws an error

Post by TinCanTech » Sat May 15, 2021 5:17 pm

Don't use --route-nopull ever!


Use --pull-filter, see the manual.

Post Reply