Chaning VPN client IP range on Ubuntu

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
wahabqurashi
Posts: 10
Joined: Sat Apr 16, 2022 2:50 am

Chaning VPN client IP range on Ubuntu

Post by wahabqurashi » Sat Apr 16, 2022 3:11 am

Hi there,

I have installed the Softether VPN server on the Ubuntu-based server in my office. I am able to connect to the VPN service from any remote location using the Softether VPN client application and my client device gets an IP address of 192.168.30.X. I want to change this IP address range to 10.0.X.X. I am not sure how we can change the IP range in the ubuntu server as we don't have a GUI interface for Linux.Thanks

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

Re: Chaning VPN client IP range on Ubuntu

Post by solo » Sat Apr 16, 2022 10:20 am

There are 3 methods to make the change.

#1 GUI from remote Win/Wine - run vpnsmgr.exe

#2 CLI SE - run ./vpncmd and Change Virtual DHCP Server Function

#3 CLI Linux...

Code: Select all

systemctl stop vpnserver
cd /usr/local/vpnserver
root@ubuntu:/usr/local/vpnserver# nano vpn_server.config

			declare SecureNAT
			{
				bool Disabled true
				bool SaveLog false

				declare VirtualDhcpServer
				{
					string DhcpDnsServerAddress 192.168.30.1
					string DhcpDnsServerAddress2 0.0.0.0
					string DhcpDomainName $
					bool DhcpEnabled true
					uint DhcpExpireTimeSpan 7200
					string DhcpGatewayAddress 192.168.30.1
					string DhcpLeaseIPEnd 192.168.30.200
					string DhcpLeaseIPStart 192.168.30.10
					string DhcpPushRoutes $
					string DhcpSubnetMask 255.255.255.0
				}
				declare VirtualHost
				{
					string VirtualHostIp 192.168.30.1
					string VirtualHostIpSubnetMask 255.255.255.0


systemctl start vpnserver

wahabqurashi
Posts: 10
Joined: Sat Apr 16, 2022 2:50 am

Re: Chaning VPN client IP range on Ubuntu

Post by wahabqurashi » Sat Apr 16, 2022 5:56 pm

I have tried the last method. I have stopped the VPN server using
#systemctl stop vpnserver

I am able to change all the configs as you have mentioned below:

declare SecureNAT
{
bool Disabled true
bool SaveLog true

declare VirtualDhcpServer
{
string DhcpDnsServerAddress 10.8.0.1
string DhcpDnsServerAddress2 0.0.0.0
string DhcpDomainName $
bool DhcpEnabled true
uint DhcpExpireTimeSpan 7200
string DhcpGatewayAddress 10.8.0.1
string DhcpLeaseIPEnd 10.8.0.254
string DhcpLeaseIPStart 10.8.0.10
string DhcpPushRoutes $
string DhcpSubnetMask 255.255.255.0
}
declare VirtualHost
{
string VirtualHostIp 192.168.30.1
string VirtualHostIpSubnetMask 255.255.255.0


I have restarted the service as well. I am still getting the same 192.168.30.X range. Is there anything incorrect from my side?

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

Re: Chaning VPN client IP range on Ubuntu

Post by solo » Sun Apr 17, 2022 1:36 am

Yes, VirtualHostIp is incorrect. Works for me...

Code: Select all

                                declare VirtualDhcpServer
                                {
                                        string DhcpDnsServerAddress 10.8.0.1
                                        string DhcpDnsServerAddress2 0.0.0.0
                                        string DhcpDomainName $
                                        bool DhcpEnabled true
                                        uint DhcpExpireTimeSpan 7200
                                        string DhcpGatewayAddress 10.8.0.1
                                        string DhcpLeaseIPEnd 10.8.0.200
                                        string DhcpLeaseIPStart 10.8.0.10
                                        string DhcpPushRoutes $
                                        string DhcpSubnetMask 255.255.255.0
                                }
                                declare VirtualHost
                                {
                                        string VirtualHostIp 10.8.0.1
                                        string VirtualHostIpSubnetMask 255.255.255.0
on a Win client I get

Code: Select all

netstat -r
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0         10.8.0.1       10.8.0.10       1
          0.0.0.0          0.0.0.0      192.168.8.1   192.168.8.101       20
         10.8.0.0    255.255.255.0        10.8.0.10       10.8.0.10       1
        10.8.0.10  255.255.255.255        127.0.0.1       127.0.0.1       1
   10.255.255.255  255.255.255.255        10.8.0.10       10.8.0.10       1
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
     130.158.6.69  255.255.255.255      192.168.8.1   192.168.8.101       20
      192.168.8.0    255.255.255.0    192.168.8.101   192.168.8.101       20
    192.168.8.101  255.255.255.255        127.0.0.1       127.0.0.1       20
    192.168.8.255  255.255.255.255    192.168.8.101   192.168.8.101       20
        224.0.0.0        240.0.0.0        10.8.0.10       10.8.0.10       1
        224.0.0.0        240.0.0.0    192.168.8.101   192.168.8.101       20
  255.255.255.255  255.255.255.255        10.8.0.10               3       1
  255.255.255.255  255.255.255.255        10.8.0.10           10007       1
  255.255.255.255  255.255.255.255        10.8.0.10           10006       1
  255.255.255.255  255.255.255.255        10.8.0.10       10.8.0.10       1
  255.255.255.255  255.255.255.255    192.168.8.101   192.168.8.101       1
Default Gateway:          10.8.0.1
Also the client may need to: ipconfig /renew *VPN*

wahabqurashi
Posts: 10
Joined: Sat Apr 16, 2022 2:50 am

Re: Chaning VPN client IP range on Ubuntu

Post by wahabqurashi » Tue Apr 19, 2022 12:39 pm

It is resolved now. Thanks for your help.

Post Reply