Page 1 of 1

linux vpn client does not work

Posted: Sun Jan 12, 2025 6:13 am
by kagami
I installed a VPN server on a Linux machine, and then installed a VPN client on another Linux machine. I successfully connected the VPN client to the VPN server, but when I used the iptables command on the VPN server, it did not show the client's IP. The same operation was successful on a Windows machine.
Here are the results of running the iptables command and the sessionlist command. Among them, SID-DEYANG-5 corresponds to the Windows machine, and SID-LOCAL-4 corresponds to the Linux machine.

Code: Select all

VPN Server/DEFAULT>iptable
IpTable command - Get the IP Address Table Database
Item        |Value
------------+----------------------------
ID          |4088665124
Session Name|SID-DEYANG-5
IP Address  |169.254.37.212
Created at  |2025-01-12 14:01:13
Updated at  |2025-01-12 14:02:40
Location    |On 'iZbp1ezziqb3x5yfcf0fcqZ'
------------+----------------------------
ID          |2056045139
Session Name|SID-DEYANG-5
IP Address  |fe80::c749:d6a7:c08e:a035
Created at  |2025-01-12 14:01:13
Updated at  |2025-01-12 14:02:43
Location    |On 'iZbp1ezziqb3x5yfcf0fcqZ'
The command completed successfully.

Code: Select all

VPN Server/DEFAULT>sessionlist
SessionList command - Get List of Connected Sessions
Item            |Value
----------------+-------------
Session Name    |SID-LOCAL-4
VLAN ID         |-
Location        |Local Session
User Name       |local
Source Host Name|xx.xx.xx.xx
TCP Connections |2 / 2
Transfer Bytes  |13,912
Transfer Packets|116
----------------+-------------
Session Name    |SID-DEYANG-5
VLAN ID         |-
Location        |Local Session
User Name       |deyang
Source Host Name|xx.xx.xx.xx
TCP Connections |2 / 2
Transfer Bytes  |13,526
Transfer Packets|138
The command completed successfully.
On the Linux machine where I installed the VPN client, I used the niccreate command to create a network adapter, but it still didn't work.

Code: Select all

VPN Client>niclist
NicList command - Get List of Virtual Network Adapters
Item                        |Value
----------------------------+-----------------------------------
Virtual Network Adapter Name|dulv
Status                      |Enabled
MAC Address                 |5E12148D30D0
Version                     |Version 4.42 Build 9798   (English)
The command completed successfully.

Code: Select all

VPN Client>accountget
AccountGet command - Get Setting of VPN Connection Setting 
Name of VPN Connection Setting: local

Item                                                 |Value
-----------------------------------------------------+--------------------------------
VPN Connection Setting Name                          |local
Destination VPN Server Host Name                     |xx.xxx.xxx.xxx
Destination VPN Server Port Number                   |5555
Destination VPN Server Virtual Hub Name              |default
Proxy Server Type                                    |Direct TCP/IP Connection
Verify Server Certificate                            |Disable
Device Name Used for Connection                      |dulv
Authentication Type                                  |Standard Password Authentication
User Name                                            |local
Number of TCP Connections to Use in VPN Communication|1
Interval between Establishing Each TCP Connection    |1
Connection Life of Each TCP Connection               |Infinite
Use Half Duplex Mode                                 |Disable
Encryption by SSL                                    |Enable
Data Compression                                     |Disable
Connect by Bridge / Router Mode                      |Disable
Connect by Monitoring Mode                           |Disable
No Adjustment for Routing Table                      |Disable
Do not Use QoS Control Function                      |Disable
The command completed successfully.
What should I do to solve this problem? Thank you for your help.

Re: linux vpn client do not work

Posted: Sun Jan 12, 2025 7:13 am
by solo

Re: linux vpn client do not work

Posted: Sun Jan 12, 2025 8:11 am
by kagami
solo wrote:
Sun Jan 12, 2025 7:13 am
viewtopic.php?f=7&t=68894&p=101124#p101124
Thank you for your reply. I tried the method mentioned in the link and encountered other problems. Since I am using a rented cloud server, after I executed the ip route del default command, I was unable to connect to the server. Is it possible to not execute this command?

Re: linux vpn client does not work

Posted: Sun Jan 12, 2025 8:20 am
by solo

Re: linux vpn client does not work

Posted: Mon Jan 13, 2025 6:12 am
by kagami
solo wrote:
Sun Jan 12, 2025 8:20 am
viewtopic.php?f=7&t=68335&p=99223#p99223
I referred to the idea in this post to solve this problem. I created a network adapter on a Linux machine using niccreate, but this adapter doesn't have an IP address. The result of checking with ifconfig is as follows.

Code: Select all

vpn_dulv: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5c12:14ff:fe8d:30d0  prefixlen 64  scopeid 0x20<link>
        ether 5e:12:14:8d:30:d0  txqueuelen 1000  (Ethernet)
        RX packets 280  bytes 34262 (33.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 368  bytes 35128 (34.3 KiB)
        TX errors 0  dropped 233 overruns 0  carrier 0  collisions 0
Then I used the ip addr add command to configure an IP address for this adapter. After adding the IP, the result of checking with ifconfig is as follows.

Code: Select all

vpn_dulv: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.37.10  netmask 255.255.0.0  broadcast 0.0.0.0
        inet6 fe80::5c12:14ff:fe8d:30d0  prefixlen 64  scopeid 0x20<link>
        ether 5e:12:14:8d:30:d0  txqueuelen 1000  (Ethernet)
        RX packets 5862  bytes 529058 (516.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17097  bytes 911580 (890.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Then I used the accountconnect command to connect to the VPN. At this time, the client program will automatically add a route. The result of checking with the ip route show command is as follows.

Code: Select all

169.254.0.0/16 dev vpn_dulv proto kernel scope link src 169.254.37.10 
Note that if you use the accountconnect command to connect to the VPN first and then configure the IP for the network adapter, it won't work. You must configure the IP first and then connect to the VPN.If you have already connected to the VPN before configuring the IP, don't worry. You just need to restart the client program.

Anyway, thank you so much on helping me solving this problem!