Форум русскоязычного сообщества Ubuntu


Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

Автор Тема: Клиенты не подключаются к openvpn серверу  (Прочитано 5244 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн aleksandrnovikov

  • Автор темы
  • Любитель
  • *
  • Сообщений: 57
    • Просмотр профиля
Помогите настроить, гугль не помог, сдаюсь. Сервер на vps с kvm. С техподдержкой связывлся, говорят ограничений никаких.
Конфиг сервера
#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# TCP or UDP server?
;proto tcp
proto udp

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key  # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys.
dh /etc/openvpn/dh2048.pem

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0

# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
tls-auth ta.key 0 # This file is secret
key-direction 0

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC        # Blowfish (default)
cipher AES-128-CBC   # AES
auth SHA256
;cipher DES-EDE3-CBC  # Triple-DES

# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
user nobody
group nogroup

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it.  Use one
# or the other (but not both).
log         openvpn.log
;log-append  openvpn.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3

# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20
Конфиг клиента
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server.     #
#                                            #
# This configuration can be used by multiple #
# clients, however each client should have   #
# its own cert and key files.                #
#                                            #
# On Windows, you might want to rename this  #
# file so it has a .ovpn extension           #
##############################################

# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client

# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one.  On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap

# Are we connecting to a TCP or
# UDP server?  Use the same setting as
# on the server.
;proto tcp
proto udp

# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote 1.1.1.1 1194
;remote my-server-2 1194

# Choose a random host from the remote
# list for load-balancing.  Otherwise
# try hosts in the order specified.
;remote-random

# Keep trying indefinitely to resolve the
# host name of the OpenVPN server.  Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite

# Most clients don't need to bind to
# a specific local port number.
nobind

# Downgrade privileges after initialization (non-Windows only)
user nobody
group nogroup

# Try to preserve some state across restarts.
persist-key
persist-tun

# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here.  See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]

# Wireless networks often produce a lot
# of duplicate packets.  Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings

# SSL/TLS parms.
# See the server config file for more
# description.  It's best to use
# a separate .crt/.key file pair
# for each client.  A single ca
# file can be used for all clients.
#ca ca.crt
#cert client.crt
#key client.key

# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to "server".  This is an
# important precaution to protect against
# a potential attack discussed here:
#  http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to "server".  The build-key-server
# script in the easy-rsa folder will do this.
ns-cert-type server

# If a tls-auth key is used on the server
# then every client must also have the key.
;tls-auth ta.key 1

# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
cipher AES-128-CBC
auth SHA256
key-direction 1

# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
comp-lzo

# Set log file verbosity.
verb 3

# Silence repeating messages
;mute 20
<ca>
-----BEGIN CERTIFICATE-----
MIIEtzCCA5+gAwIBAgIJAOPJHUNjeVwRMA0GCSqGSIb3DQEBCwUAMIGYMQswCQYD
VQQGEwJSVTENMAsGA1UECBMEVFVMQTENMAsGA1UEBxMEVFVMQTERMA8GA1UEChMI
NG1haW5lcmExDjAMBgNVBAsTBXZwbmNhMRQwEgYDVQQDEws0bWFpbmVyYSBDQTEP
MA0GA1UEKRMGc2VydmVyMSEwHwYJKoZIhvcNAQkBFhI0bWFpbmVyYUBnbWFpbC5j
b20wHhcNMTcwMzI4MTAyODQyWhcNMjcwMzI2MTAyODQyWjCBmDELMAkGA1UEBhMC
UlUxDTALBgNVBAgTBFRVTEExDTALBgNVBAcTBFRVTEExETAPBgNVBAoTCDRtYWlu
ZXJhMQ4wDAYDVQQLEwV2cG5jYTEUMBIGA1UEAxMLNG1haW5lcmEgQ0ExDzANBgNV
BCkTBnNlcnZlcjEhMB8GCSqGSIb3DQEJARYSNG1haW5lcmFAZ21haWwuY29tMIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwgOv2nwUG3P88S4ODgjAYUVx
fryogF5t62Ui2S6ADhszxoYh7kUmu3twyyO57OQdKJ8e8gGc1h10U9i+cA56w/MT
51y4sdqZorwErPWmS2Tr3kQ3rvzQ083cthUHNnhqVQxG4EcYo0UhwiFfhJ78B8K0
HEKFBXn/Q1QMFyiy/sD9Hc3SzeZHHbOE1PXGGffFS3iEXHiQDiyDoc0cgfBey1HA
EtTC8NGXjssfAOs6Dlryt/txv/WmOEJiGbgpLUM0MUdTzZrE5EafknyPoHx+C1XY
ysmFxYTeSaemMTSlzszPV/9hPLWdmyCdPrz5POFrPlIGbCGfC+JSikS0mlxd/wID
AQABo4IBADCB/TAdBgNVHQ4EFgQU07nScNxxN42Px+sBVxFmzKlrIqUwgc0GA1Ud
IwSBxTCBwoAU07nScNxxN42Px+s5VxFmzKlrIqWhgZ6kgZswgZgxCzAJBgNVBAYT
AlJVMQ0wCwYDVQQIEwRUVUxBMQ0wCwYDVQQHEwRUVUxBMREwDwYDVQQKEwg0bWFp
bmVyYTEOMAwGA1UECxMFdnBuY2ExFDASBgNVBAMTCzRtYWluZXJhIENBMQ8wDQYD
VQQpEwZzZXJ2ZXIxITAfBgkqhkiG9w0BCQEWEjRtYWluZXJhQGdtYWlsLmNvbYIJ
AOPJHUNjeVwRMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADYPXNgl
YqtMWGG2CA8W3M1i5xchkd4/IkM+/OX9iQ0UEETGhvfxYinNArxlIy4WEcmvmkp1
GDe/7eXE5Y78LzelSwKVDiOf4IgYrzjM7fHI7zxWPsTrMx89ROBpj9WEmTDtY30h
OwqTyl9Y8ugdXdjNWlo7nAATxPW2/fNDcLTP5svAmnaTaNY0E3qiWY8q6dwvFwVS
q+3P4ge2W844cy0vDjXEmAhDfn/DMEhU3a/AVqKVTkDUmwwVz8aTDh9mI+iLMuhQ
1V7YaN4+/X4Hk5+SEAwf05xTUa8J2ZRJ0m+vxJwDHtD7klX8kviBYaO42Nfd1+4g
aVb9db5uouKzaqk=
-----END CERTIFICATE-----
</ca>
<cert>
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 3 (0x3)
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: C=RU, ST=TULA, L=TULA, O=4mainera, OU=vpnca, CN=4mainera CA/name=server/emailAddress=4mainera@gmail.com
        Validity
            Not Before: Mar 28 12:31:45 2017 GMT
            Not After : Mar 26 12:31:45 2027 GMT
        Subject: C=RU, ST=TULA, L=TULA, O=4mainera, OU=jobpc, CN=jobpc/name=server/emailAddress=4mainera@gmail.com
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    00:97:fd:e4:1d:4a:74:9d:69:6d:15:6f:d1:59:b4:
                    0c:4a:4c:bb:70:e8:9b:f1:00:66:6a:a6:bc:33:26:
                    6e:4c:cf:20:cd:66:c2:70:14:24:51:39:9d:37:a5:
                    61:ed:16:22:12:26:d1:4f:a3:de:bf:45:07:d6:52:
                    76:13:30:dd:60:94:76:17:89:24:cd:7e:58:b3:f6:
                    69:8f:f4:02:0e:53:9b:34:99:0b:7d:17:2b:b3:d0:
                    9f:7f:1c:9c:35:a4:24:58:83:52:42:49:fc:aa:fe:
                    f8:f6:e6:23:97:79:c9:a9:05:85:d0:33:1d:8e:2a:
                    9f:9b:1b:41:78:f6:1a:fb:bf:51:c6:a9:68:bd:ce:
                    9e:9a:b1:e5:0a:65:13:74:52:54:06:ec:ef:33:f6:
                    71:b9:e5:57:23:d7:8b:76:33:56:06:2d:cd:d8:ed:
                    c5:c2:ec:0e:19:ad:42:57:30:90:3d:a1:1e:ab:df:
                    53:6a:90:d1:18:e9:01:70:4b:0e:ea:4c:ff:ff:f2:
                    b5:81:9e:f3:b1:a1:60:ee:90:0f:54:29:14:17:34:
                    28:aa:0a:07:01:56:4d:0c:6e:32:eb:5b:e7:5b:1b:
                    72:9d:e4:92:cb:c6:67:94:65:87:21:08:7c:cc:3b:
                    3d:a5:89:fd:f4:71:21:c8:89:5b:f0:f1:d0:fc:37:
                    bb:6d
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            Netscape Comment:
                Easy-RSA Generated Certificate
            X509v3 Subject Key Identifier:
                48:BB:D5:75:3A:8E:23:9E:B1:BF:D5:65:21:F7:26:E1:CE:A2:FE:2B
            X509v3 Authority Key Identifier:
                keyid:D3:B9:D2:70:DC:71:37:8D:8F:C7:EB:01:57:11:66:CC:A9:6B:22:A5
                DirName:/C=RU/ST=TULA/L=TULA/O=4mainera/OU=vpnca/CN=4mainera CA/name=server/emailAddress=4mainera@gmail.com
                serial:E3:C9:1D:43:63:79:5C:11

            X509v3 Extended Key Usage:
                TLS Web Client Authentication
            X509v3 Key Usage:
                Digital Signature
            X509v3 Subject Alternative Name:
                DNS:jobpc
    Signature Algorithm: sha256WithRSAEncryption
         99:1a:db:bf:c3:55:d1:b9:c3:c2:99:f4:1e:81:4d:d6:bf:98:
         0f:e0:0e:0b:f0:db:59:14:4b:29:f7:89:7d:07:4f:06:5f:76:
         a7:f7:ba:35:f8:93:e9:53:8a:b4:13:25:f0:ff:a6:51:60:2e:
         77:0e:22:dc:7a:5a:23:86:c1:99:24:a5:b1:ce:74:2c:14:00:
         28:e3:2c:e0:11:9d:4a:eb:a5:d4:f3:d2:ef:b2:a8:a5:91:2a:
         0b:6b:15:37:1f:bd:03:41:12:95:f5:12:a4:81:8c:78:f9:7d:
         ea:99:3f:25:07:1d:d1:b2:27:b9:1f:5c:22:50:f5:6d:98:81:
         71:6c:06:8c:88:0d:27:bc:05:02:65:f6:96:41:c6:a6:67:a6:
         42:66:51:bb:2f:40:39:c0:fa:e9:49:3e:e2:93:f6:f8:5d:a8:
         08:9e:b5:b7:87:40:d1:c4:13:78:aa:18:ea:e3:d2:be:0c:1c:
         df:eb:5b:92:1d:c2:92:de:25:6a:49:d1:c9:da:44:50:0d:39:
         ee:50:fe:25:3e:98:e0:fa:09:96:ff:7e:5b:a3:4d:d7:8f:dd:
         c8:9f:d2:ef:1e:13:0a:56:fd:ee:57:33:e8:89:3b:52:68:04:
         66:da:a2:78:a9:22:a8:15:c6:66:98:a5:60:af:a3:91:98:85:
         32:90:c7:5d
-----BEGIN CERTIFICATE-----
MIIFCjCCA/KgAwIBAgIBAzANBgkqhkiG9w0BAQsFADC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taKXiJ++cKVv+dw75NRFjJ0fohyFYM9kCgYEArhnpGxneLFxLXW4lvIOR
q18kGXfjKmKAi1vmiNkHQCpjcOWYKWjKEvb0L4Z7J9rsUrDj7YrfBnLGeMAqF+kF
/qgxowidFtUIaLzo6fGXcDaJBvs2rsFN4X93ydHaYvbZ2mWdRA2paROUvS2p1UAO
NeX9gqYAwgE6zAzi4uMSXDo=
-----END PRIVATE KEY-----
</key>
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
26ec47ccb054c7f5caa3955818954483
9e3445e409da82cead0d676195c2041d
370449236f45af3fd3e2d303580bd121
0fb4aeb714db05405e54b3678686ee9f
6eb40b150cbcccc52ac17ef3e57bf000
0c5572d41f370f21e1be45ef706c2d9a
209a6c0a6e2c36a1fbf92279090c790e
56c53f68fc12c5c719676b2ddc969e95
64d589e2f4333d1c6de5497e8cb09d75
30c4816aa9b1500524f975a1233b76a6
7a81b7a9895dcff66725b7f715e7c79f
bae51779a16630dd166f7762759e98c2
be5b71c292d5cc71adу1a615c1848007
b9a28d020dfca144810387f72cf590b2
8db86130e64f8e15877eb4fc66775acd
a824536f760bf8611fcdf7b8758d22ab
-----END OpenVPN Static key V1-----
</tls-auth>

Лог сервера
Tue Mar 28 23:53:14 2017 OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] $
Tue Mar 28 23:53:14 2017 Diffie-Hellman initialized with 2048 bit key
Tue Mar 28 23:53:14 2017 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Tue Mar 28 23:53:14 2017 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMA$
Tue Mar 28 23:53:14 2017 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMA$
Tue Mar 28 23:53:14 2017 Socket Buffers: R=[212992->131072] S=[212992->131072]
Tue Mar 28 23:53:14 2017 ROUTE_GATEWAY 212.109.218.1/255.255.254.0 IFACE=eth0 HWADDR=52:54:00:09:f3:34
Tue Mar 28 23:53:14 2017 TUN/TAP device tun0 opened
Tue Mar 28 23:53:14 2017 TUN/TAP TX queue length set to 100
Tue Mar 28 23:53:14 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Mar 28 23:53:14 2017 /sbin/ip link set dev tun0 up mtu 1500
Tue Mar 28 23:53:14 2017 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Tue Mar 28 23:53:14 2017 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Tue Mar 28 23:53:14 2017 GID set to nogroup
Tue Mar 28 23:53:14 2017 UID set to nobody
Tue Mar 28 23:53:14 2017 UDPv4 link local (bound): [undef]
Tue Mar 28 23:53:14 2017 UDPv4 link remote: [undef]
Tue Mar 28 23:53:14 2017 MULTI: multi_init called, r=256 v=256
Tue Mar 28 23:53:14 2017 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Tue Mar 28 23:53:14 2017 IFCONFIG POOL LIST
Tue Mar 28 23:53:14 2017 Initialization Sequence Completed
Лог клиента:
Wed Mar 29 00:15:02 2017 NOTE: --user option is not implemented on Windows
Wed Mar 29 00:15:02 2017 NOTE: --group option is not implemented on Windows
Wed Mar 29 00:15:02 2017 OpenVPN 2.3.14 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [IPv6] built on Dec  7 2016
Wed Mar 29 00:15:02 2017 Windows version 6.2 (Windows 8 or greater) 64bit
Wed Mar 29 00:15:02 2017 library versions: OpenSSL 1.0.2i  22 Sep 2016, LZO 2.09
Enter Management Password:
Wed Mar 29 00:15:02 2017 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25341
Wed Mar 29 00:15:02 2017 Need hold release from management interface, waiting...
Wed Mar 29 00:15:03 2017 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25341
Wed Mar 29 00:15:03 2017 MANAGEMENT: CMD 'state on'
Wed Mar 29 00:15:03 2017 MANAGEMENT: CMD 'log all on'
Wed Mar 29 00:15:03 2017 MANAGEMENT: CMD 'hold off'
Wed Mar 29 00:15:03 2017 MANAGEMENT: CMD 'hold release'
Wed Mar 29 00:15:03 2017 Control Channel Authentication: tls-auth using INLINE static key file
Wed Mar 29 00:15:03 2017 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Wed Mar 29 00:15:03 2017 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Wed Mar 29 00:15:03 2017 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed Mar 29 00:15:03 2017 UDPv4 link local: [undef]
Wed Mar 29 00:15:03 2017 UDPv4 link remote: [AF_INET]*.*.*.*:1194
Wed Mar 29 00:15:03 2017 MANAGEMENT: >STATE:1490735703,WAIT,,,
Wed Mar 29 00:16:03 2017 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Wed Mar 29 00:16:03 2017 TLS Error: TLS handshake failed
Wed Mar 29 00:16:03 2017 SIGUSR1[soft,tls-error] received, process restarting
Wed Mar 29 00:16:03 2017 MANAGEMENT: >STATE:1490735763,RECONNECTING,tls-error,,
Wed Mar 29 00:16:03 2017 Restart pause, 2 second(s)
Wed Mar 29 00:16:05 2017 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed Mar 29 00:16:05 2017 UDPv4 link local: [undef]
Wed Mar 29 00:16:05 2017 UDPv4 link remote: [AF_INET]*.*.*.*:1194
Wed Mar 29 00:16:05 2017 MANAGEMENT: >STATE:1490735765,WAIT,,,
Wed Mar 29 00:17:05 2017 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Wed Mar 29 00:17:05 2017 TLS Error: TLS handshake failed
Wed Mar 29 00:17:05 2017 SIGUSR1[soft,tls-error] received, process restarting
Wed Mar 29 00:17:05 2017 MANAGEMENT: >STATE:1490735825,RECONNECTING,tls-error,,
Wed Mar 29 00:17:05 2017 Restart pause, 2 second(s)
Wed Mar 29 00:17:07 2017 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed Mar 29 00:17:07 2017 UDPv4 link local: [undef]
Wed Mar 29 00:17:07 2017 UDPv4 link remote: [AF_INET]*.*.*.*:1194
Wed Mar 29 00:17:07 2017 MANAGEMENT: >STATE:1490735827,WAIT,,,
sudo ufw status
To                         Action      From
--                         ------      ----
1194/udp                   ALLOW       Anywhere
1194/udp (v6)              ALLOW       Anywhere (v6)
sudo netstat -ntulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:2222            0.0.0.0:*               LISTEN      782/sshd
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      854/mysqld
tcp6       0      0 :::2222                 :::*                    LISTEN      782/sshd
tcp6       0      0 :::80                   :::*                    LISTEN      977/apache2
udp        0      0 0.0.0.0:1194            0.0.0.0:*                           2339/openvpn
« Последнее редактирование: 29 Марта 2017, 09:41:12 от aleksandrnovikov »

Оффлайн fisher74

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 13756
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #1 : 29 Марта 2017, 10:15:49 »
nmap -sU 1.1.1.1 -p 1194

Оффлайн aleksandrnovikov

  • Автор темы
  • Любитель
  • *
  • Сообщений: 57
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #2 : 29 Марта 2017, 10:58:46 »
nmap -sU 1.1.1.1 -p 1194
Host is up.
PORT     STATE         SERVICE
1194/udp open|filtered openvpn

Nmap done: 1 IP address (1 host up) scanned in 2.07 seconds

Оффлайн fisher74

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 13756
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #3 : 29 Марта 2017, 11:06:13 »
надеюсь это с клиентской машины проверяли?

Оффлайн aleksandrnovikov

  • Автор темы
  • Любитель
  • *
  • Сообщений: 57
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #4 : 29 Марта 2017, 11:21:17 »
надеюсь это с клиентской машины проверяли?
Прошу прощения, делал на сервере... facepalm
Клиенты на винде.


Оффлайн fisher74

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 13756
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #5 : 29 Марта 2017, 11:55:55 »
Переведите на tcp  и проверьте. Так же nmap-ом? Для надёжности и telnet-ом

Оффлайн aleksandrnovikov

  • Автор темы
  • Любитель
  • *
  • Сообщений: 57
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #6 : 29 Марта 2017, 12:29:13 »
Переведите на tcp  и проверьте. Так же nmap-ом? Для надёжности и telnet-ом
Перевел на tcp сервер
netstat -natp
вывод
tcp        0      0 0.0.0.0:1194            0.0.0.0:*               LISTEN      1809/openvpnsudo ufw status
To                         Action      From
--                         ------      ----
1194/udp                   ALLOW       Anywhere
1194/tcp                   ALLOW       Anywhere
1194/udp (v6)              ALLOW       Anywhere (v6)
1194/tcp (v6)              ALLOW       Anywhere (v6)

на клиенте nmap -sU -p 1194 1.1.1.1
выдает
Host is up (0.011s latency).

PORT     STATE         SERVICE

1194/udp open|filtered openvpn

на сервере делаю sudo ufw disable
на клиенте делаю nmap 1.1.1.1
вывод:
PORT     STATE SERVICE

80/tcp   open  http

2222/tcp open  EtherNetIP-1

на вкладке порты такая картина
https://imgdepo.com/show/10464751
nmap -p 1.1.1.1 выдает
PORT     STATE    SERVICE

1194/tcp filtered openvpn

Через telnet порт не доступен. Ufw не правильно управляет iptables?

Пользователь добавил сообщение 29 Марта 2017, 13:35:06:
Отключил ufw, добавил правила в iptables
iptables -A INPUT -p tcp --dport 1194 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o tun0 -j MASQUERADE

iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
f2b-sshd   tcp  --  anywhere             anywhere             multiport dports ssh
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:2222
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
DROP       all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:openvpn

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain f2b-sshd (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Все-таки хостинг закрыл порт?
« Последнее редактирование: 29 Марта 2017, 13:35:06 от aleksandrnovikov »

Оффлайн fisher74

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 13756
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #7 : 29 Марта 2017, 15:15:38 »
на клиенте nmap -sU -p 1194 1.1.1.1
для tcp
nmap -sT -p 1194 1.1.1.1
Все-таки хостинг закрыл порт?

очень похоже
попробуйте перетащить на "простые" порты: 443, 80, 8080, 22. Желательно предварительно проверив их доступность другими сервисами (тем же http-сервером).

Оффлайн aleksandrnovikov

  • Автор темы
  • Любитель
  • *
  • Сообщений: 57
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #8 : 29 Марта 2017, 15:46:27 »
на клиенте nmap -sU -p 1194 1.1.1.1
для tcp
nmap -sT -p 1194 1.1.1.1
Все-таки хостинг закрыл порт?

очень похоже
попробуйте перетащить на "простые" порты: 443, 80, 8080, 22. Желательно предварительно проверив их доступность другими сервисами (тем же http-сервером).

nmap -sT -p 1194 1.1.1.1
PORT     STATE    SERVICE

1194/tcp filtered openvpn
nmap -sT -p 443 1.1.1.1
Цитировать
PORT    STATE    SERVICE

443/tcp filtered https
iptables -S
sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2222 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -j DROP
-A INPUT -p tcp -m tcp --dport 1194 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A f2b-sshd -j RETURN
ufw выключен

Пользователь добавил сообщение 29 Марта 2017, 16:27:59:
netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      731/mysqld
tcp        0      0 0.0.0.0:2222            0.0.0.0:*               LISTEN      714/sshd
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1396/openvpn
tcp6       0      0 :::2222                 :::*                    LISTEN      714/sshd
tcp6       0      0 :::80                   :::*                    LISTEN      786/apache2
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     21137    1496/systemd        /run/user/1000/systemd/private
unix  2      [ ACC ]     SEQPACKET  LISTENING     9091     1/init              /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     12442    531/cgmanager       /sys/fs/cgroup/cgmanager/sock
unix  2      [ ACC ]     STREAM     LISTENING     11792    1/init              /run/uuidd/request
unix  2      [ ACC ]     STREAM     LISTENING     11798    1/init              /var/run/pcscd/pcscd.comm
unix  2      [ ACC ]     STREAM     LISTENING     11799    1/init              /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     14213    811/python3         /var/run/fail2ban/fail2ban.sock
unix  2      [ ACC ]     STREAM     LISTENING     14251    731/mysqld          /var/run/mysqld/mysqld.sock
unix  2      [ ACC ]     STREAM     LISTENING     9083     1/init              /run/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     9087     1/init              /run/systemd/fsck.progress
unix  2      [ ACC ]     STREAM     LISTENING     9088     1/init              /run/systemd/journal/stdout
порт прослушивается

если подключиться локально telnet localhost 443 то подключение происходит
пробовал онлайн сканеры - тоже пишут, что порт закрыт
« Последнее редактирование: 29 Марта 2017, 16:27:59 от aleksandrnovikov »

Оффлайн fisher74

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 13756
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #9 : 29 Марта 2017, 16:55:48 »
Чёт я даже сразу и не заметил
-A INPUT -j DROP
-A INPUT -p tcp -m tcp --dport 1194 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
sudo iptables -D INPUT -j DROP
sudo iptables -P INPUT DROP

Оффлайн aleksandrnovikov

  • Автор темы
  • Любитель
  • *
  • Сообщений: 57
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #10 : 30 Марта 2017, 17:02:50 »
sudo iptables -D INPUT -j DROP
sudo iptables -P INPUT DROP
Извините, если замучил Вас, но мне очень нужно это настроить, а самому во всем разобраться тяжело за это время.
VPN слушает 443 tcp, применил  правила
sudo iptables -D INPUT -j DROP
sudo iptables -P INPUT DROP
sudo iptables -S
-P INPUT DROP
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N f2b-sshd
-N ufw-after-forward
-N ufw-after-input
-N ufw-after-logging-forward
-N ufw-after-logging-input
-N ufw-after-logging-output
-N ufw-after-output
-N ufw-before-forward
-N ufw-before-input
-N ufw-before-logging-forward
-N ufw-before-logging-input
-N ufw-before-logging-output
-N ufw-before-output
-N ufw-logging-allow
-N ufw-logging-deny
-N ufw-not-local
-N ufw-reject-forward
-N ufw-reject-input
-N ufw-reject-output
-N ufw-skip-to-policy-forward
-N ufw-skip-to-policy-input
-N ufw-skip-to-policy-output
-N ufw-track-forward
-N ufw-track-input
-N ufw-track-output
-N ufw-user-forward
-N ufw-user-input
-N ufw-user-limit
-N ufw-user-limit-accept
-N ufw-user-logging-forward
-N ufw-user-logging-input
-N ufw-user-logging-output
-N ufw-user-output
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2222 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -j ufw-before-logging-input
-A INPUT -j ufw-before-input
-A INPUT -j ufw-after-input
-A INPUT -j ufw-after-logging-input
-A INPUT -j ufw-reject-input
-A INPUT -j ufw-track-input
-A FORWARD -j ufw-before-logging-forward
-A FORWARD -j ufw-before-forward
-A FORWARD -j ufw-after-forward
-A FORWARD -j ufw-after-logging-forward
-A FORWARD -j ufw-reject-forward
-A FORWARD -j ufw-track-forward
-A OUTPUT -j ufw-before-logging-output
-A OUTPUT -j ufw-before-output
-A OUTPUT -j ufw-after-output
-A OUTPUT -j ufw-after-logging-output
-A OUTPUT -j ufw-reject-output
-A OUTPUT -j ufw-track-output
-A f2b-sshd -j RETURN
-A ufw-after-input -p udp -m udp --dport 137 -j ufw-skip-to-policy-input
-A ufw-after-input -p udp -m udp --dport 138 -j ufw-skip-to-policy-input
-A ufw-after-input -p tcp -m tcp --dport 139 -j ufw-skip-to-policy-input
-A ufw-after-input -p tcp -m tcp --dport 445 -j ufw-skip-to-policy-input
-A ufw-after-input -p udp -m udp --dport 67 -j ufw-skip-to-policy-input
-A ufw-after-input -p udp -m udp --dport 68 -j ufw-skip-to-policy-input
-A ufw-after-input -m addrtype --dst-type BROADCAST -j ufw-skip-to-policy-input
-A ufw-after-logging-input -m limit --limit 3/min --limit-burst 10 -j LOG --log-prefix "[UFW BLOCK] "
-A ufw-before-forward -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-forward -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A ufw-before-forward -p icmp -m icmp --icmp-type 4 -j ACCEPT
-A ufw-before-forward -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A ufw-before-forward -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A ufw-before-forward -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A ufw-before-forward -j ufw-user-forward
-A ufw-before-input -i lo -j ACCEPT
-A ufw-before-input -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-input -m conntrack --ctstate INVALID -j ufw-logging-deny
-A ufw-before-input -m conntrack --ctstate INVALID -j DROP
-A ufw-before-input -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A ufw-before-input -p icmp -m icmp --icmp-type 4 -j ACCEPT
-A ufw-before-input -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A ufw-before-input -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A ufw-before-input -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A ufw-before-input -p udp -m udp --sport 67 --dport 68 -j ACCEPT
-A ufw-before-input -j ufw-not-local
-A ufw-before-input -d 224.0.0.251/32 -p udp -m udp --dport 5353 -j ACCEPT
-A ufw-before-input -d 239.255.255.250/32 -p udp -m udp --dport 1900 -j ACCEPT
-A ufw-before-input -j ufw-user-input
-A ufw-before-output -o lo -j ACCEPT
-A ufw-before-output -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-output -j ufw-user-output
-A ufw-logging-allow -m limit --limit 3/min --limit-burst 10 -j LOG --log-prefix "[UFW ALLOW] "
-A ufw-logging-deny -m conntrack --ctstate INVALID -m limit --limit 3/min --limit-burst 10 -j RETURN
-A ufw-logging-deny -m limit --limit 3/min --limit-burst 10 -j LOG --log-prefix "[UFW BLOCK] "
-A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN
-A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN
-A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN
-A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny
-A ufw-not-local -j DROP
-A ufw-skip-to-policy-forward -j ACCEPT
-A ufw-skip-to-policy-input -j DROP
-A ufw-skip-to-policy-output -j ACCEPT
-A ufw-track-forward -p tcp -m conntrack --ctstate NEW -j ACCEPT
-A ufw-track-forward -p udp -m conntrack --ctstate NEW -j ACCEPT
-A ufw-track-output -p tcp -m conntrack --ctstate NEW -j ACCEPT
-A ufw-track-output -p udp -m conntrack --ctstate NEW -j ACCEPT
-A ufw-user-input -p udp -m udp --dport 1194 -j ACCEPT
-A ufw-user-input -p tcp -m tcp --dport 443 -j ACCEPT
-A ufw-user-limit -m limit --limit 3/min -j LOG --log-prefix "[UFW LIMIT BLOCK] "
-A ufw-user-limit -j REJECT --reject-with icmp-port-unreachable
-A ufw-user-limit-accept -j ACCEPT
ufw отключил
nmap -sT -p 443 1.1.1.1 говорит:
443/tcp filtered https
при этом по telnet с клиента подключаюсь, vpn не подключается
Если можно, еще пару вопросов:
Мне нужно в /etc/default/ufw делать DEFAULT_FORWARD_POLICY="ACCEPT" ?
В /etc/sysctl.conf нужно net.ipv4.ip_forward=1 если весь трафик направлять через vpn мне не нужно ?
В /etc/ufw/before.rules # START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to eth0
-A POSTROUTING -s 10.8.0.0/8 -o eth0 -j MASQUERADE
COMMIT
# END OPENVPN RULES
И еще мне не понятно, ufw сам по себе или это интерфейс iptables?


Пользователь добавил сообщение 30 Марта 2017, 17:12:27:
Цитировать
nmap -sT -p 443 1.1.1.1 говорит:
443/tcp filtered https
видимо надо было подождать, сейчас порт открыт
« Последнее редактирование: 30 Марта 2017, 17:12:27 от aleksandrnovikov »

Оффлайн fisher74

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 13756
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #11 : 30 Марта 2017, 20:15:29 »
ufw отключил
Вы уж определитесь, либо ручками правилами рулите, либо ufw-у доверяете этим заняться. Применение симбиоза чаще характеризуется непредсказуемыми глюками.

при этом по telnet с клиента подключаюсь, vpn не подключается
логи при такой ситуации изменились?

Мне нужно в /etc/default/ufw делать ...?
Извините, я ufw вообще ни алё, меня iptables вполне удовлетворяет.


В /etc/sysctl.conf нужно net.ipv4.ip_forward=1 если весь трафик направлять через vpn мне не нужно ?
нет, не нужно

ufw сам по себе или это интерфейс iptables?

Всё не так. iptables, как и ufw это инструменты для управления правилами netfilter.
iptables - вилы, ufw - грабли. Чем загребать правила netfilter - решение админа. Но если грести вместе - может получиться ерунда.

Оффлайн aleksandrnovikov

  • Автор темы
  • Любитель
  • *
  • Сообщений: 57
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #12 : 31 Марта 2017, 16:53:16 »
Цитировать
ufw отключил
Вы уж определитесь, либо ручками правилами рулите, либо ufw-у доверяете этим заняться. Применение симбиоза чаще характеризуется непредсказуемыми глюками.
буду пользоваться iptables

Цитировать
при этом по telnet с клиента подключаюсь, vpn не подключается
логи при такой ситуации изменились?
просто подождал 2 минуты и все заработало, логи не стал смотреть. Решил поставить стандартный порт 1194/udp и интерфейс tap.
Большое спасибо за помощь! И наверно последнее, посмотрите пожалуйста правила, нет ли там дырок? Отблагодарил на WMR

-P INPUT DROP
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2222 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p udp -m udp --dport 1194 -j ACCEPT
-A f2b-sshd -s 46.149.34.230/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 46.149.34.230/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 46.149.34.230/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -s 46.149.34.230/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -j RETURN
-A f2b-sshd -j RETURN
-A f2b-sshd -j RETURN
-A f2b-sshd -j RETURN
« Последнее редактирование: 31 Марта 2017, 17:03:20 от aleksandrnovikov »

Оффлайн fisher74

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 13756
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #13 : 31 Марта 2017, 18:54:26 »
-P FORWARD ACCEPT
здесь дыра

Это (под спойлером) вообще похоже ошмётки от каких-то экспериментов
(Нажмите, чтобы показать/скрыть)

Ну и с бАААльшой веоятностью список правил далеко не полный, так как нет ни таблицы nat, ни таблицы mangle

Оффлайн aleksandrnovikov

  • Автор темы
  • Любитель
  • *
  • Сообщений: 57
    • Просмотр профиля
Re: Клиенты не подключаются к openvpn серверу
« Ответ #14 : 01 Апреля 2017, 16:15:17 »
-P FORWARD ACCEPT
здесь дыра

Это (под спойлером) вообще похоже ошмётки от каких-то экспериментов
(Нажмите, чтобы показать/скрыть)

Ну и с бАААльшой веоятностью список правил далеко не полный, так как нет ни таблицы nat, ни таблицы mangle
Если просто удалю -P FORWARD ACCEPT, это исправит ситуацию?
По поводу остатков - у меня стоит fail2ban, кажется это он. Но разве он не должен потом за собой некоторые правила чистить?

 

Страница сгенерирована за 0.048 секунд. Запросов: 25.