Stuck on getting client for Raspberry Pi to work

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Wed Mar 22, 2023 9:44 am

I have used the script that I found here:https://forums.raspberrypi.com/viewtopic.php?t=262264

But the topic is locked, and the author hasn't been on the board for almost years. Installing worked as it should, and I replaced the config with the exact same config that my Windows pc is using to get to my server. And there it stops. It does not connet, I can't and if I try to use vpncmd, I get this (which I have seen a solution on for Ubuntu, but not for Raspberry):

Code: Select all

-- Alert: SoftEther VPN Kernel --
Fatal Error: The file "hamcore.se2" is missing or broken.
Please check hamcore.se2.

(First, reboot the computer. If this problem occurs again, please reinstall VPN software files.)
Can somebody please help me to the next step of this? I'm guessing that I also need to tell the client in some way to use account 0, or maybe not? Without the ability to use any form of configuration software on the Pi, I'm quite stuck.

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Wed Mar 22, 2023 11:27 pm

With a spare uSD card you could get SE "client for Raspberry Pi to work" in OpenWrt.
https://openwrt.org/toh/raspberry_pi_fo ... spberry_pi
https://openwrt.org/packages/pkgdata/so ... vpn-client

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Thu Mar 23, 2023 9:08 am

Thanks, but I already have one that takes care of Internet at the location (actually it's the car, I'm setting up a tunnel to be able to control stuff in it from outside with Home Assistant, even if the 4G card does not give me an external IP), and that needs direct access to my home network for it all to work. I would rather not have a third Pi in my car. Oh, and the Pi I'm trying to get it into runs Hass, Node-RED, J. River Media center with a 2 TB SSD with music and a few other things, so I can't repurpose that.

One thing, though: If I can get the OpenWRT client to only ble active on the 4G modem, not wifi, and only when the wifi is not connected (so the car is not parked outside the house), it would work.

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Thu Mar 23, 2023 10:47 am

Try OpenVPN client to connect to your SE server.
https://www.ovpn.com/en/guides/raspberry-pi-raspbian
No need to "make" it.

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Thu Mar 23, 2023 11:15 am

MIght be worth a shot, thanks! I have been runing that before I got SoftEther on the tunnel between my house and cabin by the sea (I work both places), so I can find one of my old setups.

Edit: Most of that seems to be for connecting to the OVPN service, but I can probably twist it to go to my server.

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Thu Mar 30, 2023 6:51 am

solo wrote:
Thu Mar 23, 2023 10:47 am
Try OpenVPN client to connect to your SE server.
https://www.ovpn.com/en/guides/raspberry-pi-raspbian
No need to "make" it.
I tried yesterday, following that link, but I stopped after installation, because that was how to connect to a VPN provider with a premade setup. I have tried to search for a "how to" for Pi and a personal VPN, but that wasn't easy to find. Do you have a suggestion as to how I should procede from here?

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Thu Mar 30, 2023 8:13 am

With SE VPN Server Manager get "openvpn_site_to_site_bridge_l2.ovpn" config, mod it if necessary (eg forwarded port/protocol, cipher/data-ciphers, etc.), and upload it to your Pi.

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Sat Apr 08, 2023 1:43 pm

Thanks again, I finally managed to get it to work with the file from SoftEther, by using the OpenWrt Pi that serves 4G and wifi Internet to the main Pi in the car. So now I can connect to it whereever it is. Only one problem: Each time it disconnects and then connects again (like when I park at the house and it changes from 4G to wifi) I get a new internal IP address. From looking at my server's DHCP server it seems like the OpenWrt OpenVPN client does not have a static MAC address for the tun adapter connceting to the server. Is it possible to set the IP from SoftEther? From what I read it should be possible to set it from user name/password, but that was not there in the Manage user screen.

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Sat Apr 08, 2023 1:55 pm

Mastiff wrote:
Sat Apr 08, 2023 1:43 pm
Is it possible to set the IP from SoftEther?
Yes.
you need to write the arbitrary virtual MAC address on the "Note" field on the user object. For example, the "Note" field will have the MAC address format which starts with "MAC:" followed by a 6-bytes ASCII-encoded HEX string, such like "MAC:ae:00:00:00:00:01". We recommend to use the "ae" on the first byte of the MAC address...
https://www.softether.org/5-download/history

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Sat Apr 08, 2023 2:26 pm

Thanks again! Weird result, though. I used the MAC ae0000001001, which got turned into ae0000001003 on the first reboot of OpenWrt and then ae0000001002 on the second and subsequent times. Any idea why that happens?


Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Sun Apr 09, 2023 10:39 am

Sorry for my lack of knowledge, but I don't understand what I should try in the second line. Also, when I look at the MAC table on the server, I see that there are three MACs for the same connection, and I have only set up one connection from OpenWrt. Can this be some weirdness in OpenWrt instead of in SoftEther?
Triple mac.jpg
You do not have the required permissions to view the files attached to this post.

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Sun Apr 09, 2023 11:13 am

DE is Developer Edition to install and test out. But first:
- in the ovpn config change "dev tap" to "dev tun"
- unless you're on RADIUS use the "MAC:ae:00:00:00:00:01" syntax, not your "ae0000000001"
- don't forget to turn off SE vDHCP and use your own DHCP server with "Static IP address reserve list" function (or similar)
If everything fails, next post on https://github.com/SoftEtherVPN/SoftEtherVPN/issues

EDIT
Use static IP instead of DHCP.

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Mon Apr 10, 2023 7:59 am

Actually the syntax is what you say, and what the manual said:
Softether user setup.jpg
But changing device to TAP made it disappear from both MAC and IP tables, even if it's shown as connected in "Manage sessions". My wife will come back with the car later today, so I'll connect to the car network and see if I should have removed persist-tun as well, I just changed the first line.

As for vDHCP, I have not used that, I believe that's the one with Virtual NAT and Virtual DHCP (Secure NAT). So I have been using my own DHCP server in Windows Server 2022 all along.
You do not have the required permissions to view the files attached to this post.

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Mon Apr 10, 2023 8:53 am

Mastiff wrote:
Mon Apr 10, 2023 7:59 am
I have been using my own DHCP server in Windows Server 2022 all along.
Have you made MAC-to-IP allocations in it?

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Mon Apr 10, 2023 6:39 pm

If you mean static addresses, I have done that for some of my devices, but not all. Like this, here's the attempt for the OpenWrt OpenVPN setup:
SoftEther client on DHCP static address.jpg
And when I connect a client (not the bridge from my home server, though) it gets the DHCP address in the 192.168.2.0 range, which is what my cabin server gives out.
You do not have the required permissions to view the files attached to this post.

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Mon Apr 10, 2023 7:38 pm

I got TAP working, sort of... But it's only getting a IPv6 address, when I look at the IP Address table, and I can't ping the SoftEther server. So something in the setup stops me from using TAP, it seems. Tomorrow I will go back to TUN, install the developer's edition and post to GitHub. Thanks for the help so far!

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Tue Apr 11, 2023 12:07 am

Mastiff wrote:
Mon Apr 10, 2023 7:38 pm
I got TAP working, sort of...
I wrote...
in the ovpn config change "dev tap" to "dev tun"
L3 works on TUN.

You have a small network, let go of DHCP, use static, give the Pi its iP :-)

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Tue Apr 11, 2023 6:23 am

Thanks for your patience! I was already using tun, that's where I got several MACs for the same connection. So now I'm back on tun. For the moment I only have the OpenWrt connected, not the Pi that's going to use that connection through it. It actually seems like it's getting another MAC for each time it connects, up to four, and then stabilizes. I am actually uncertain if this weirdness is possible to fix on the SoftEther end, maybe it's a weird combination of the stuff I'm using? Here is the current number of MACs:
Softether with four OpenWrt macs.jpg
But still it only has one IP:
Softether with four OpenWrt macs - only one IP.jpg
And that's given out by my DHCP server, or at least it looks like it is:
Softether with four OpenWrt macs - DHCP giving the IP.jpg
But it isn't, because setting the MAC to a static address does not make my DHCP server give out the static address, that address is not used, while the same .97 address is still used by OpenVPN from the OpenWrt client. So the address is given out somewhere else.
You do not have the required permissions to view the files attached to this post.

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Tue Apr 11, 2023 8:39 am

Pi --> OpenWrt NIC --> Static IP

Set it directly on the NIC.

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Tue Apr 11, 2023 10:08 am

I tried that now, by setting the Interface using tun0 to Static address (from unmanaged, which is the way it's described in the setup instructions for OpenVPN on OpenWrt) and chose the static address IPv4: 192.168.2.110/24, but that did not change anything, I can't ping in any direction. But the .97 is still there, for some reason. It's not possible to set a static address on the tun0 or on the OpenVPN setup. There is no other DHCP on this system than the Windows Server DHCP, and the adress is within the pool for that, so in some way it has to come from there. I'm just not getting the logic for which of the different MAC's I should assign to it. It seems to be the last of the MACs that are created in the MAC Address Table of SoftEther, but every time I choose that, there will be another the next time, so instead of the one ending in 3 that I have set as the static IP there will be one ending in 4, which goes to the .97 IP. But it also sems like it's settled down on .97, so I will try to use that for a few days and see if it works. I can live with that, as long as it keeps going there.

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: Stuck on getting client for Raspberry Pi to work

Post by solo » Tue Apr 11, 2023 10:57 am

Now with a static IP, switch to L2 - "dev tap".

Mastiff
Posts: 24
Joined: Tue Sep 04, 2018 4:20 pm

Re: Stuck on getting client for Raspberry Pi to work

Post by Mastiff » Sun Apr 16, 2023 9:01 am

It took a bit of doing, but finally I understood, and I believe I have it working! Tap, setting up OpenVPN interface with static IP, i finally decided on 192.168.2.105, and setting that interface as LAN, not WAN. That lets me contact everything I want over OpenVPN via 4G when it's away from the network of the server I have SoftEther running on. Then I set up that server DHCP with the static IP to the wifi card in OpenWrt, because when it's connected to the server it of course won't connect to the external IP of the same server. So now it's .105 no matter if the car system is connected by wifi or OpenVPN. Thanks a lot for your help!

Post Reply