There already are various articles that describe how to connect to a VPN using SoftEther on Linux. Even after following several of them, I wasn't able to connect to a VPN on my Manjaro Linux machine. I had issues especially on the last step where we need to create the routing rules manually. Here's what worked for me.
- Download SoftEther client from its website, and install the same.
- Start vpnclient using
sudo ./vpnclient start ./vpncmd- Enter
2for Management of VPN Client - Enter
(blank)for localhost - NicCreate (then enter the name, say "VPN")
- AccountCreate (then enter Account_Name, VPN_Server, Hub_Name, Username, Nic_Name)
- AccountPasswordSet. Specify
standardas the type. Many articles suggestedradius, but standard worked for me. - AccountConnect
- AccountList should now show status
Connectedfor Account_Name.
Exit vpncmd and run these commands on a shell.
-
echo 1 > /proc/sys/net/ipv4/ip_forwardRun this as root. (Actually I'm not sure if this is required.) -
sudo dhclient vpn_vpn -v. Here, we're assuming Nic_Name above is "VPN". In the output, note the Gateway_address. For example, I saw a lineDHCPACK of 192.168.30.12 from 192.168.30.1. Here192.168.30.1is the Gateway_address. - You can also find Gateway_address by running
ip route. Here you will see a route rule likedefault via 192.168.30.1 dev vpn_vpn. We don't need it. -
sudo ip route del default via 192.168.30.1. Replace192.168.30.1with your Gateway_address. -
sudo ip route add 192.168.4.0/24 via 192.168.30.1. Again, replace192.168.30.1with your Gateway_address, and replace192.168.4.0/24with the network address range you're trying to connect to. I my case, the remote network was in the range 192.168.4.*, so I used 192.168.4.0/24.
Thank you and wish you the best.
Top comments (2)
I found a much simpler solution using dhcpcd instead of dhclient based on a comment on the aur package page:
dhcpcd -b -4 -G [interface]
It seems, additionally, I had to manually set the ip address of the interface:
sudo ip addr add 192.168.100.10/24 dev [interface]
Replace 192.168.100.10 with an available ip address in the network