How do I describe a script that replaces the 'route' program?

How to customize and extend your OpenVPN installation.

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

Post Reply
User avatar
ogogon
OpenVpn Newbie
Posts: 7
Joined: Fri Jul 17, 2015 11:36 am

How do I describe a script that replaces the 'route' program?

Post by ogogon » Sat Dec 11, 2021 6:57 pm

Colleagues, tell me, please, how to correctly describe in the configurations of clients and servers a script that replaces the 'route' command?

I use OpenVPN on a router running FreeBSD and I support multiple routing tables (FIB, Forwarding Information Base). This means that all servers and clients running on the router must make routing entries not in one, but in several tables.

I understood from the description that it is possible to replace the standard route program with my alternative script. Unfortunately, I did not find specific details.

An attempt to add the line
iproute /usr/local/etc/openvpn/scripts/route.sh
to the config file resulted in an error.

Please tell me how can I solve my problem?

Thanks in advance for your reply,
ogogon.

User avatar
Pippin
Forum Team
Posts: 1200
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: How do I describe a script that replaces the 'route' program?

Post by Pippin » Sat Dec 11, 2021 7:20 pm

Take a look here:
https://build.openvpn.net/man/openvpn-2 ... vpn.8.html
under:
"SCRIPTING INTEGRATION"
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp

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

Re: How do I describe a script that replaces the 'route' program?

Post by TinCanTech » Sat Dec 11, 2021 7:46 pm

A bit out-of-date: https://community.openvpn.net/openvpn/w ... ilegedUser
ogogon wrote:
Sat Dec 11, 2021 6:57 pm
resulted in an error
Oh that error .. you need to tie an onion to your belt ..

User avatar
ogogon
OpenVpn Newbie
Posts: 7
Joined: Fri Jul 17, 2015 11:36 am

Re: How do I describe a script that replaces the 'route' program?

Post by ogogon » Sat Dec 11, 2021 10:31 pm

TinCanTech wrote:
Sat Dec 11, 2021 7:46 pm
A bit out-of-date: https://community.openvpn.net/openvpn/w ... ilegedUser
Thank you for the link sent. She's very good, but she doesn't seem to be able to help me.

There, in the section "Config Changes", the line for the configuration file is directly given. Here is such:
iproute /usr/local/sbin/unpriv-ip
This is exactly the line I tried to use, as I wrote about in the first message.

In response, I get the following messages in /var/log/messages:
Dec 12 01:00:00 gw openvpn[33964]: Options error: Unrecognized option or missing or extra parameter(s) in /usr/local/etc/openvpn/ovpn_client.conf:65: iproute (2.5.2)
Dec 12 01:00:00 gw openvpn[33964]: Use --help for more information.
Dec 12 01:00:00 gw ogogon: ./openvpn: WARNING: failed to start openvpn
Perhaps this is due to the fact that, as I already wrote in the first message, I use the FreeBSD platform, and it does not have the route2 subsystem and, accordingly, the 'ip' command.
TinCanTech wrote:
Sat Dec 11, 2021 6:57 pm
Oh that error .. you need to tie an onion to your belt ..
The onion did not help anymore, what else are we going to tie? Hope the rabbi has more ideas?

ogogon.

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

Re: How do I describe a script that replaces the 'route' program?

Post by TinCanTech » Sat Dec 11, 2021 11:37 pm

If you don't have iproute2 then how can you replace it ?

The use of option --iproute is specific.

User avatar
ogogon
OpenVpn Newbie
Posts: 7
Joined: Fri Jul 17, 2015 11:36 am

Re: How do I describe a script that replaces the 'route' program?

Post by ogogon » Sun Dec 12, 2021 8:24 am

TinCanTech wrote:
Sat Dec 11, 2021 11:37 pm
If you don't have iproute2 then how can you replace it ?
I beg your pardon, but apparently, you still did not read my first message very carefully.

I really didn't have the slightest intention of replacing the 'ip' command from the route2 packet with my script. And precisely because it does not exist. I am glad that you now understand this.

I want to replace with my script the 'route' command, which is used for the same on BSD platforms.

Or did the developers not think about such an option?

ogogon.

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

Re: How do I describe a script that replaces the 'route' program?

Post by TinCanTech » Sun Dec 12, 2021 2:18 pm

What you do not understand is what it is that Iproute2(ip) command is capable of and why it can be replaced.

Where-as, "replacing" the functionality of ifconfig and route has not been implemented.

Keep in mind, the developers are volunteers, also.

tunnel_boar
OpenVPN User
Posts: 25
Joined: Fri Dec 24, 2021 4:50 pm

Re: How do I describe a script that replaces the 'route' program?

Post by tunnel_boar » Sat Dec 25, 2021 12:54 am

ogogon wrote:
Sun Dec 12, 2021 8:24 am
TinCanTech wrote:
Sat Dec 11, 2021 11:37 pm
If you don't have iproute2 then how can you replace it ?
I beg your pardon, but apparently, you still did not read my first message very carefully.

I really didn't have the slightest intention of replacing the 'ip' command from the route2 packet with my script. And precisely because it does not exist. I am glad that you now understand this.

I want to replace with my script the 'route' command, which is used for the same on BSD platforms.

Or did the developers not think about such an option?

ogogon.
On behalf of the OpenVPN team I would like to apologize for TinCan's slightly irritable behavior at times. He tries to help as many people as possible and can get tired.

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

Re: How do I describe a script that replaces the 'route' program?

Post by TinCanTech » Sat Dec 25, 2021 1:04 am

tunnel_boar wrote:
Sat Dec 25, 2021 12:54 am
On behalf of the OpenVPN team
You have not proven who you are or why we should listen.


Would you care to offer an answer to the question of why iproute2 is required in order for it to be replaced ?

Or is your comment simply an opinion which you keep about me ? (In which case, your post would be Off-Topic)

tunnel_boar
OpenVPN User
Posts: 25
Joined: Fri Dec 24, 2021 4:50 pm

Re: How do I describe a script that replaces the 'route' program?

Post by tunnel_boar » Sat Dec 25, 2021 1:42 pm

I was just teasing before, relax.

But iproute2 is not required?

Am I missing something about the functionality of iproute2?

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

Re: How do I describe a script that replaces the 'route' program?

Post by TinCanTech » Sat Dec 25, 2021 2:43 pm

Perhaps you are too familiar with Linux Open Source to realise that the same OpenVPN source has to also work with Windblows, which is closed source.

Post Reply