Page 1 of 1
The server configuration file cannot set multiple "push route"
Posted: Mon Oct 17, 2022 10:32 am
by mohuangNPC
If I set two "push route", the server can start normally,config like this:
Code: Select all
# to reach other private subnets behind
# the server. Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
push "route 10.110.120.0 255.255.255.0"
push "route 10.221.2.0 255.255.255.0"
But if I set more than two, config like this:
Code: Select all
# Push routes to the client to allow it
# to reach other private subnets behind
# the server. Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
push "route 10.110.120.0 255.255.255.0"
push "route 10.221.2.0 255.255.255.0"
push "route 172.16.0.1 255.255.255.0"
The server will fail to start, and the error is:
Code: Select all
Options error: Unrecognized option or missing or extra parameter(s) in server.ovpn:142: push (2.5.7)
Use --help for more information.
Has anyone encountered this problem, please help me
Re: The server configuration file cannot set multiple "push route"
Posted: Mon Oct 17, 2022 12:22 pm
by ordex
The error is related to the last route you added, not to the number of routes in total.
172.16.0.1 is not a valid network address. It should be 172.16.0.0
Re: The server configuration file cannot set multiple "push route"
Posted: Mon Oct 17, 2022 12:36 pm
by TinCanTech
I cannot replicate this problem.
Using:
Code: Select all
push "route 10.11.12.1 255.255.255.0"
Does
not cause the server to fail.
Re: The server configuration file cannot set multiple "push route"
Posted: Tue Oct 18, 2022 12:04 am
by mohuangNPC
I tried it and the result is that it cannot be changed to any ip. My system is window server 2022, a configuration file edited with notepad. Could it be an encoding issue? Because the two "push routes" that take effect are from the original configuration file I modified
Re: The server configuration file cannot set multiple "push route"
Posted: Tue Oct 18, 2022 12:07 am
by mohuangNPC
but the fact is that no matter what ip is added, an error will be reported. Will it be a file encoding problem, because the two "push routes" that take effect are the configuration that I modified from the original configuration file. But if I incrementally add "push route", it will report an error, for example, will the window server not add a newline after it by default?
Re: The server configuration file cannot set multiple "push route"
Posted: Tue Oct 18, 2022 12:10 am
by mohuangNPC
ordex wrote: ↑Mon Oct 17, 2022 12:22 pm
The error is related to the last route you added, not to the number of routes in total.
172.16.0.1 is not a valid network address. It should be 172.16.0.0
I tried it and the result is that it cannot be changed to any ip. My system is window server 2022, a configuration file edited with notepad. Could it be an encoding issue? Because the two "push routes" that take effect are from the original configuration file I modified
Re: The server configuration file cannot set multiple "push route"
Posted: Tue Oct 18, 2022 12:13 am
by mohuangNPC
TinCanTech wrote: ↑Mon Oct 17, 2022 12:36 pm
I cannot replicate this problem.
Using:
Code: Select all
push "route 10.11.12.1 255.255.255.0"
Does
not cause the server to fail.
but the fact is that no matter what ip is added, an error will be reported. Will it be a file encoding problem, because the two "push routes" that take effect are the configuration that I modified from the original configuration file. But if I incrementally add "push route", it will report an error, for example, will the window server not add a newline after it by default?
Re: The server configuration file cannot set multiple "push route"
Posted: Tue Oct 18, 2022 7:33 am
by ordex
mohuangNPC wrote: ↑Tue Oct 18, 2022 12:07 am
but the fact is that no matter what ip is added, an error will be reported. Will it be a file encoding problem, because the two "push routes" that take effect are the configuration that I modified from the original configuration file. But if I incrementally add "push route", it will report an error, for example, will the window server not add a newline after it by default?
it could well be an encoding issue (especially if you are modifying the file on windows). You could try to recreate the file from scratch o modify it with a different tool.