Would like to apply a patch to openvpn

yes it is, but I am really lost. I have a live ubuntu cd, but still don't know where to start

I think I will just try to follow that guide to redo it from source.. it is the easiest option because there is a guide I can follow.. I will see what can I do and report back.

If I were a Windows user, I would run Linux as a VM not a dual boot. Assuming the hardware is up to the task as I described.

1 Like

You coud also use a Linux Live CD.

1 Like

ok I am trying now to build the openvpn from the sdk
and when I try doing:

./scripts/feeds install openvpn

I get error:

awk: include/scan.awk: line 21: function asort never defined
awk: include/scan.awk: line 21: function asort never defined
awk: include/scan.awk: line 21: function asort never defined
awk: include/scan.awk: line 21: function asort never defined
WARNING: No feed for package 'openvpn' found, maybe it's already part of the standard packages?

what should I do?

You should not need to do that since OpenVPN is already included. Do the usual update -a and install -a to get your buildroot started, then make menuconfig and go to network / vpn and select openvpn-openssl.

thanks for your reply,..
but the next step is that i have to go to : cd ./package/feeds/base/openvpn/patches
and I cannot find it so i can put the patch inside
according to this:

I think i fixed that issue, will report later

Confirm that an unmodified build works first. Only after that, apply the third-party patch.

I built it using the sdk for my router, I will post the link in a moment :slight_smile:
also I will try using it and report success hopefully

hmmm, building failed with error
this is the log:

Applying ./patches/02-tunnelblick-openvpn_xorpatch-a.diff using plaintext: 
/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/host/bin/patch: **** Only garbage was found in the patch input.
Patch failed!  Please fix ./patches/02-tunnelblick-openvpn_xorpatch-a.diff!
Makefile:137: recipe for target '/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/openvpn-mbedtls/openvpn-2.4.3/.prepared_86abb06f731577b1ff1ae92d0a5b7a58' failed
make[3]: *** [/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/openvpn-mbedtls/openvpn-2.4.3/.prepared_86abb06f731577b1ff1ae92d0a5b7a58] Error 1
make[3]: Leaving directory '/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/feeds/base/package/network/services/openvpn'
package/Makefile:105: recipe for target 'package/feeds/base/openvpn/compile' failed
make[2]: *** [package/feeds/base/openvpn/compile] Error 2
make[2]: Leaving directory '/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64'
package/Makefile:101: recipe for target '/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/target-mips_24kc_musl-1.1.16/stamp/.package_compile' failed
make[1]: *** [/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/target-mips_24kc_musl-1.1.16/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64'
/home/tamer/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/include/toplevel.mk:191: recipe for target 'world' failed
make: *** [world] Error 2

i will try with the other patch posted on github, the original one, maybe the tunnelblick one has issues?

ok, had to use the raw patches... my mistake
will report soon

@Pink_Waters Please put code and log output in code blocks, else it's a garbled mess to read.

1 Like

ok everything is loaded.. now how can I set up vpn with my own OVPN file ?
luci works fine but does not have the additional options i need to put with my patch

OpenVPN should never be configured via LuCI, as the LuCI OpenVPN app is extremely convoluted, making configuration far more troublesome than it's worth.

@stangri's wiki will likely suit you best

ok how to configure it otherwise ? the wiki is kinda confusing

That wiki tells you exactly what you need to do... majority of it is copy and paste. You will need to login to your router via SSH.

  • You will need to remove the following line when you copy/paste, unless you want all local traffic being pushed through the VPN (i.e. if you're utilizing the VPN for remote access)
    uci add_list openvpn.vpnserver.push='redirect-gateway def1'
    

thanks for reply, is there a simpler way, like using my own openvpn file ? .ovpn ?

Are you utilizing a 3rd party VPN? If not, please post your ovpn, removing DDNS and port number (in code boxes)