LINUX.ORG.RU

Проблема с OpenVPN

 , ,


0

2

Здравствуйте! Пытаюсь настроить OpenVPN, но возникли проблемы. На сервере установил OpenVPN AS. Через него получил конфигурации клиента. Однако очень часто при подключении к VPN серверу возникает проблема: подключиться к серверу можно, но пинги не идут вообще. Однако в некоторых случайных случаях все работает нормально. Пробовал на сервер ставить 100% рабочий конфиг но не помогло.

tcpdump показывает, что сервер отвечает пустыми пакетами.

Параметры IPTable

tcpdump

В чем может быть проблема?

Ответ на: комментарий от XMs

Логи клиента ничего не показывают, а логи на сервере при запуске сервера показывают ошибку:

2018-11-29 02:04:18-0500 [-] PROC SET ERROR on /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal: [Errno 13] Permission denied: '/proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal': net/net:41,util/simplefile:11 (exceptions.IOError)

Лог сервера

Лог клиента

diman-pro
() автор топика
Ответ на: комментарий от XMs

Данные из config.db:

rowid,profile_id,name,value
1,1,vpn.server.group_pool.0,192.168.3.0/24
2,1,cs.ssl_method,SSLv3
3,1,vpn.server.port_share.ip_address,1.2.3.4
4,1,vpn.daemon.0.listen.port,443
5,1,auth.ldap.0.name,My LDAP servers
6,1,vpn.server.tls_auth,true
7,1,vpn.daemon.0.listen.ip_address,venet0
8,1,vpn.client.routing.reroute_dns,true
9,1,cs.https.ip_address,localhost
10,1,vpn.server.daemon.enable,true
11,1,vpn.daemon.0.client.netmask_bits,24
12,1,vpn.tls_refresh.interval,360
13,1,vpn.server.daemon.tcp.n_daemons,2
14,1,vpn.client.cipher,AES-256-CBC
15,1,auth.ldap.0.timeout,4
16,1,vpn.server.daemon.tcp.port,443
17,1,vpn.server.port_share.port,1234
18,1,cs.prof_sign_web,true
19,1,cs.cws_proto_v2,true
20,1,vpn.daemon.0.server.ip_address,venet0
21,1,vpn.server.routing.private_access,no
22,1,vpn.daemon.0.client.network,192.168.3.0
23,1,auth.pam.0.service,openvpnas
24,1,vpn.server.tls_version_min,1.2
25,1,auth.ldap.0.use_ssl,never
26,1,vpn.server.daemon.udp.n_daemons,2
27,1,sa.initial_run_groups.0,web_group
28,1,sa.initial_run_groups.1,openvpn_group
29,1,host.name,***IP***
30,1,auth.radius.0.acct_enable,false
31,1,vpn.tls_refresh.do_reauth,true
32,1,vpn.server.daemon.udp.port,443
33,1,vpn.server.port_share.service,admin+client
34,1,admin_ui.https.port,1025
35,1,cs.https.port,1025
36,1,admin_ui.https.ip_address,localhost
37,1,vpn.client.routing.reroute_gw,true
38,1,auth.module.type,local
39,1,vpn.client.basic,false
40,1,auth.ldap.0.ssl_verify,never
41,1,vpn.daemon.0.listen.protocol,tcp
42,1,auth.radius.0.name,My Radius servers
43,1,vpn.general.osi_layer,3
44,1,cs.tls_version_min,1.1
45,1,vpn.server.port_share.enable,true
46,1,vpn.server.cipher,AES-256-CBC
47,1,vpn.client.routing.inter_client,true
48,2,run_api.active_profile,Default
49,2,webui.edit_profile,Default
50,2,webui.welcome_shown,true
51,1,aui.eula_version,2
52,1,vpn.server.static.0.netmask_bits,24
53,1,vpn.server.routing.gateway_access,true
54,1,vpn.server.static.0.network,192.168.4.0
55,1,vpn.client.config_text,""
56,1,vpn.server.duplicate_cn,true
57,1,vpn.server.config_text,""
58,1,cs.cws_ui_offer.mac,false
59,1,cs.cws_ui_offer.linux,true
60,1,cs.cws_ui_offer.win,true
61,1,cs.cws_ui_offer.server_locked,false
62,1,cs.cws_ui_offer.android,true
63,1,cs.cws_ui_offer.ios,false
64,1,cs.cws_ui_offer.autologin,true
65,1,cs.admin_only,false
66,1,xmlrpc.relay_level,1
67,1,cs.cws_ui_offer.user_locked,true
68,1,vpn.server.google_auth.enable,false

Данные из конфига as.conf:

# OpenVPN AS 1.1 configuration file
#
# NOTE:  The ~ symbol used below expands to the directory that
# the configuration file is saved in

# remove for production
# DEBUG=false

# enable AS Connect functionality
AS_CONNECT=true

# temporary directory
tmp_dir=~/tmp

lic.dir=~/licenses

# run_start retries
run_start_retry.give_up=60
run_start_retry.resample=10

# enable client gateway
sa.show_c2s_routes=true

# certificates database
certs_db=sqlite:///~/db/certs.db

# user properties DB
user_prop_db=sqlite:///~/db/userprop.db

# configuration DB
config_db=sqlite:///~/db/config.db

# log DB
log_db=sqlite:///~/db/log.db

# wait this many seconds between failed retries
db_retry.interval=1

# how many retries to attempt before failing
db_retry.n_attempts=6

# On startup, wait up to n seconds for DB files to become
# available if they do not yet exist.  This is generally
# only useful on secondary nodes used for standby purposes.
# db_startup_wait=

# Node type: PRIMARY|SECONDARY.  Defaults to PRIMARY.
# node_type=

# bootstrap authentication via PAM -- allows
# admin to log into web UI before authentication
# system has been configured.  Configure PAM users
# allowed to access via the bootstrap auth mechanism.
boot_pam_service=openvpnas
boot_pam_users.0=openvpn
# boot_pam_users.1=
# boot_pam_users.2=
# boot_pam_users.3=
# boot_pam_users.4=

# System users that are allowed to access the server agent XML API.
# The user that the web server will run as should be in this list.
system_users_local.0=root
system_users_local.1=openvpn_as

# The user/group that the web server will run as
cs.user=openvpn_as
cs.group=openvpn_as

# socket directory
general.sock_dir=~/sock

# path to linux openvpn executable
# if undefined, find openvpn on the PATH
#general.openvpn_exe_path=

# source directory for OpenVPN Windows executable
# (Must have been built with MultiFileExtract)
sa.win_exe_dir=~/exe

# The company name will be shown in the UI
sa.company_name=OpenVPN, Inc.

# server agent socket
sa.sock=~/sock/sagent

# If enabled, automatically generate a client configuration
# when a client logs into the site and successfully authenticates
cs.auto_generate=true

# files for web server (PEM format)
cs.ca_bundle=~/web-ssl/ca.crt
cs.priv_key=~/web-ssl/server.key
cs.cert=~/web-ssl/server.crt

# web server will use three consecutive ports starting at this
# address, for use with the OpenVPN port share feature
cs.dynamic_port_base=870

# which service groups should be started during
# server agent initialization
sa.initial_run_groups.0=web_group
#sa.initial_run_groups.1=openvpn_group

# use this twisted reactor
sa.reactor=epoll

# The unit number of this particular AS configuration.
# Normally set to 0.  If you have multiple, independent AS instances
# running on the same machine, each should have a unique unit number.
sa.unit=0

# If true, open up web ports on the firewall using iptables
iptables.web=true

vpn.server.user=openvpn_as
vpn.server.group=openvpn_as

diman-pro
() автор топика
Ответ на: комментарий от XMs

Проблема скорее всего заключается в настройках машины, поскольку брал конфиги для openvpn as с другой машины, на которой vpn прекрасно работает, и на данной виртуалке были такие же проблемы.

Причем эти проблемы не всегда проявляются, что очень странно.

diman-pro
() автор топика
Ответ на: комментарий от diman-pro

Похоже, что проблема действительно в VPS, поскольку после нажатия на кнопку перенастроить сеть в Админ. панели VPS VPN стала работать стабильнее.

diman-pro
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.