我在连接 VPN 时遇到问题,端口转发设置正确,我可以通过 VPN 连接到我的另一台 lubuntu 机器,UFW 也已禁用。有人可以指导我我的配置中缺少什么吗?另外,当我打开 UFW 时,我可以通过 google.com 等名称 ping WAN 或网站,但无法通过名称 ping 工作组计算机,只有当我在计算机名称中添加“.local”后缀时,我才能在 LAN 中 ping。
我希望上述问题与我的 openVPN 配置无关。由于这是网络问题,我觉得也应该添加 UFW 问题。以下是我的详细配置:
你好,这是我的 openvpn.log 文件:
Thu Jun 13 16:54:01 2019 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jan 9 2019
Thu Jun 13 16:54:01 2019 library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.08
Thu Jun 13 16:54:01 2019 Diffie-Hellman initialized with 2048 bit key
Thu Jun 13 16:54:01 2019 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu Jun 13 16:54:01 2019 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu Jun 13 16:54:01 2019 ROUTE_GATEWAY 10.0.0.1/255.255.255.0 IFACE=enp1s0 HWADDR=e0:d5:5e:ed:f5:63
Thu Jun 13 16:54:01 2019 TUN/TAP device tun0 opened
Thu Jun 13 16:54:01 2019 TUN/TAP TX queue length set to 100
Thu Jun 13 16:54:01 2019 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Thu Jun 13 16:54:01 2019 /sbin/ip link set dev tun0 up mtu 1500
Thu Jun 13 16:54:01 2019 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Thu Jun 13 16:54:01 2019 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Thu Jun 13 16:54:01 2019 Could not determine IPv4/IPv6 protocol. Using AF_INET
Thu Jun 13 16:54:01 2019 Socket Buffers: R=[87380->87380] S=[16384->16384]
Thu Jun 13 16:54:01 2019 Listening for incoming TCP connection on [AF_INET][undef]:1194
Thu Jun 13 16:54:01 2019 TCPv4_SERVER link local (bound): [AF_INET][undef]:1194
Thu Jun 13 16:54:01 2019 TCPv4_SERVER link remote: [AF_UNSPEC]
Thu Jun 13 16:54:01 2019 GID set to root
Thu Jun 13 16:54:01 2019 UID set to owner
Thu Jun 13 16:54:01 2019 MULTI: multi_init called, r=256 v=256
Thu Jun 13 16:54:01 2019 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Thu Jun 13 16:54:01 2019 IFCONFIG POOL LIST
Thu Jun 13 16:54:01 2019 MULTI: TCP INIT maxclients=1024 maxevents=1028
Thu Jun 13 16:54:01 2019 Initialization Sequence Completed
我的 server.conf 文件:
port 1194
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
tls-auth ta.key 0 # This file is secret
key-direction 0
cipher AES-128-CBC
auth SHA256
comp-lzo
user owner
group root
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log-append /var/log/openvpn/openvpn.log
verb 3
这是我的 ifconfig:
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.201 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::29bb:768f:77ea:c4fe prefixlen 64 scopeid 0x20<link>
ether e0:d5:5e:ed:f5:63 txqueuelen 1000 (Ethernet)
RX packets 14381 bytes 8571949 (8.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11387 bytes 1826373 (1.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 2333 bytes 233564 (233.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2333 bytes 233564 (233.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.0.1 netmask 255.255.255.255 destination 10.8.0.2
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
这是我的客户日志:
2019-06-13 16:42:06 Building configuration…
2019-06-13 16:42:06 started Socket Thread
2019-06-13 16:42:06 WARNING: Compression enabled, Compression has been used in the past to break encryption. Enabling decompression of received packet only. Sent packets are not compressed.
2019-06-13 16:42:06 Current Parameter Settings:
2019-06-13 16:42:06 config = '/data/user/0/de.blinkt.openvpn/cache/android.conf'
2019-06-13 16:42:06 mode = 0
2019-06-13 16:42:06 show_ciphers = DISABLED
2019-06-13 16:42:06 show_digests = DISABLED
2019-06-13 16:42:06 show_engines = DISABLED
2019-06-13 16:42:06 genkey = DISABLED
2019-06-13 16:42:06 key_pass_file = '[UNDEF]'
2019-06-13 16:42:06 show_tls_ciphers = DISABLED
2019-06-13 16:42:06 connect_retry_max = 0
2019-06-13 16:42:06 Connection profiles [0]:
2019-06-13 16:42:06 proto = tcp-client
2019-06-13 16:42:06 local = '[UNDEF]'
2019-06-13 16:42:06 local_port = '[UNDEF]'
2019-06-13 16:42:06 remote = 'sg10.ddns.net'
2019-06-13 16:42:06 remote_port = '1194'
2019-06-13 16:42:06 remote_float = DISABLED
2019-06-13 16:42:06 bind_defined = DISABLED
2019-06-13 16:42:06 bind_local = DISABLED
2019-06-13 16:42:06 bind_ipv6_only = DISABLED
2019-06-13 16:42:06 connect_retry_seconds = 2
2019-06-13 16:42:06 connect_timeout = 120
2019-06-13 16:42:06 socks_proxy_server = '[UNDEF]'
2019-06-13 16:42:06 socks_proxy_port = '[UNDEF]'
2019-06-13 16:42:06 tun_mtu = 1500
2019-06-13 16:42:06 tun_mtu_defined = ENABLED
2019-06-13 16:42:06 link_mtu = 1500
2019-06-13 16:42:06 link_mtu_defined = DISABLED
2019-06-13 16:42:06 tun_mtu_extra = 0
2019-06-13 16:42:06 tun_mtu_extra_defined = DISABLED
2019-06-13 16:42:06 mtu_discover_type = -1
2019-06-13 16:42:06 fragment = 0
2019-06-13 16:42:06 mssfix = 1450
2019-06-13 16:42:06 explicit_exit_notification = 0
2019-06-13 16:42:06 tls_auth_file = '[[INLINE]]'
2019-06-13 16:42:06 key_direction = 1
2019-06-13 16:42:06 tls_crypt_file = '[UNDEF]'
2019-06-13 16:42:06 tls_crypt_v2_file = '[UNDEF]'
2019-06-13 16:42:06 Connection profiles END
2019-06-13 16:42:06 remote_random = DISABLED
2019-06-13 16:42:06 ipchange = '[UNDEF]'
2019-06-13 16:42:06 dev = 'tun'
2019-06-13 16:42:06 dev_type = '[UNDEF]'
2019-06-13 16:42:06 dev_node = '[UNDEF]'
2019-06-13 16:42:06 lladdr = '[UNDEF]'
2019-06-13 16:42:06 topology = 1
2019-06-13 16:42:06 ifconfig_local = '[UNDEF]'
2019-06-13 16:42:06 ifconfig_remote_netmask = '[UNDEF]'
2019-06-13 16:42:06 ifconfig_noexec = DISABLED
2019-06-13 16:42:06 ifconfig_nowarn = ENABLED
2019-06-13 16:42:06 ifconfig_ipv6_local = '[UNDEF]'
2019-06-13 16:42:06 ifconfig_ipv6_netbits = 0
2019-06-13 16:42:06 ifconfig_ipv6_remote = '[UNDEF]'
2019-06-13 16:42:06 shaper = 0
2019-06-13 16:42:06 mtu_test = 0
2019-06-13 16:42:06 mlock = DISABLED
2019-06-13 16:42:06 keepalive_ping = 0
2019-06-13 16:42:06 keepalive_timeout = 0
2019-06-13 16:42:06 inactivity_timeout = 0
2019-06-13 16:42:06 ping_send_timeout = 0
2019-06-13 16:42:06 ping_rec_timeout = 0
2019-06-13 16:42:06 ping_rec_timeout_action = 0
2019-06-13 16:42:06 ping_timer_remote = DISABLED
2019-06-13 16:42:06 remap_sigusr1 = 0
2019-06-13 16:42:06 persist_tun = ENABLED
2019-06-13 16:42:06 persist_local_ip = DISABLED
2019-06-13 16:42:06 persist_remote_ip = DISABLED
2019-06-13 16:42:06 persist_key = DISABLED
2019-06-13 16:42:06 passtos = DISABLED
2019-06-13 16:42:06 resolve_retry_seconds = 1000000000
2019-06-13 16:42:06 resolve_in_advance = ENABLED
2019-06-13 16:42:06 username = '[UNDEF]'
2019-06-13 16:42:06 groupname = '[UNDEF]'
2019-06-13 16:42:06 chroot_dir = '[UNDEF]'
2019-06-13 16:42:06 cd_dir = '[UNDEF]'
2019-06-13 16:42:06 writepid = '[UNDEF]'
2019-06-13 16:42:06 up_script = '[UNDEF]'
2019-06-13 16:42:06 down_script = '[UNDEF]'
2019-06-13 16:42:06 down_pre = DISABLED
2019-06-13 16:42:06 up_restart = DISABLED
2019-06-13 16:42:06 up_delay = DISABLED
2019-06-13 16:42:06 daemon = DISABLED
2019-06-13 16:42:06 inetd = 0
2019-06-13 16:42:06 log = DISABLED
2019-06-13 16:42:06 suppress_timestamps = DISABLED
2019-06-13 16:42:06 machine_readable_output = ENABLED
2019-06-13 16:42:06 nice = 0
2019-06-13 16:42:06 verbosity = 4
2019-06-13 16:42:06 mute = 0
2019-06-13 16:42:06 gremlin = 0
2019-06-13 16:42:06 status_file = '[UNDEF]'
2019-06-13 16:42:06 status_file_version = 1
2019-06-13 16:42:06 status_file_update_freq = 60
2019-06-13 16:42:06 occ = ENABLED
2019-06-13 16:42:06 rcvbuf = 0
2019-06-13 16:42:06 sndbuf = 0
2019-06-13 16:42:06 sockflags = 0
2019-06-13 16:42:06 fast_io = DISABLED
2019-06-13 16:42:06 comp.alg = 2
2019-06-13 16:42:06 comp.flags = 1
2019-06-13 16:42:06 route_script = '[UNDEF]'
2019-06-13 16:42:06 route_default_gateway = '[UNDEF]'
2019-06-13 16:42:06 route_default_metric = 0
2019-06-13 16:42:06 route_noexec = DISABLED
2019-06-13 16:42:06 route_delay = 0
2019-06-13 16:42:06 route_delay_window = 30
2019-06-13 16:42:06 route_delay_defined = DISABLED
2019-06-13 16:42:06 route_nopull = DISABLED
2019-06-13 16:42:06 route_gateway_via_dhcp = DISABLED
2019-06-13 16:42:06 allow_pull_fqdn = DISABLED
2019-06-13 16:42:06 management_addr = '/data/user/0/de.blinkt.openvpn/cache/mgmtsocket'
2019-06-13 16:42:06 management_port = 'unix'
2019-06-13 16:42:06 management_user_pass = '[UNDEF]'
2019-06-13 16:42:06 management_log_history_cache = 250
2019-06-13 16:42:06 management_echo_buffer_size = 100
2019-06-13 16:42:06 management_write_peer_info_file = '[UNDEF]'
2019-06-13 16:42:06 management_client_user = '[UNDEF]'
2019-06-13 16:42:06 management_client_group = '[UNDEF]'
2019-06-13 16:42:06 management_flags = 16678
2019-06-13 16:42:06 shared_secret_file = '[UNDEF]'
2019-06-13 16:42:06 key_direction = 1
2019-06-13 16:42:06 ciphername = 'AES-128-CBC'
2019-06-13 16:42:06 ncp_enabled = ENABLED
2019-06-13 16:42:06 ncp_ciphers = 'AES-256-GCM:AES-128-GCM'
2019-06-13 16:42:06 authname = 'SHA256'
2019-06-13 16:42:06 prng_hash = 'SHA1'
2019-06-13 16:42:06 prng_nonce_secret_len = 16
2019-06-13 16:42:06 keysize = 0
2019-06-13 16:42:06 engine = DISABLED
2019-06-13 16:42:06 replay = ENABLED
2019-06-13 16:42:06 mute_replay_warnings = DISABLED
2019-06-13 16:42:06 replay_window = 64
2019-06-13 16:42:06 replay_time = 15
2019-06-13 16:42:06 packet_id_file = '[UNDEF]'
2019-06-13 16:42:06 test_crypto = DISABLED
2019-06-13 16:42:06 tls_server = DISABLED
2019-06-13 16:42:06 tls_client = ENABLED
2019-06-13 16:42:06 key_method = 2
2019-06-13 16:42:06 ca_file = '[[INLINE]]'
2019-06-13 16:42:06 ca_path = '[UNDEF]'
2019-06-13 16:42:06 dh_file = '[UNDEF]'
2019-06-13 16:42:06 cert_file = '[[INLINE]]'
2019-06-13 16:42:06 extra_certs_file = '[UNDEF]'
2019-06-13 16:42:06 priv_key_file = '[[INLINE]]'
2019-06-13 16:42:06 pkcs12_file = '[UNDEF]'
2019-06-13 16:42:06 cipher_list = '[UNDEF]'
2019-06-13 16:42:06 cipher_list_tls13 = '[UNDEF]'
2019-06-13 16:42:06 tls_cert_profile = '[UNDEF]'
2019-06-13 16:42:06 tls_verify = '[UNDEF]'
2019-06-13 16:42:06 tls_export_cert = '[UNDEF]'
2019-06-13 16:42:06 verify_x509_type = 0
2019-06-13 16:42:06 verify_x509_name = '[UNDEF]'
2019-06-13 16:42:06 crl_file = '[UNDEF]'
2019-06-13 16:42:06 ns_cert_type = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 65535
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_ku[i] = 0
2019-06-13 16:42:06 remote_cert_eku = 'TLS Web Server Authentication'
2019-06-13 16:42:06 ssl_flags = 0
2019-06-13 16:42:06 tls_timeout = 2
2019-06-13 16:42:06 renegotiate_bytes = -1
2019-06-13 16:42:06 renegotiate_packets = 0
2019-06-13 16:42:06 renegotiate_seconds = 3600
2019-06-13 16:42:06 handshake_window = 60
2019-06-13 16:42:06 transition_window = 3600
2019-06-13 16:42:06 single_session = DISABLED
2019-06-13 16:42:06 push_peer_info = DISABLED
2019-06-13 16:42:06 tls_exit = DISABLED
2019-06-13 16:42:06 tls_crypt_v2_genkey_type = '[UNDEF]'
2019-06-13 16:42:06 tls_crypt_v2_genkey_file = '[UNDEF]'
2019-06-13 16:42:06 tls_crypt_v2_metadata = '[UNDEF]'
2019-06-13 16:42:06 client = ENABLED
2019-06-13 16:42:06 pull = ENABLED
2019-06-13 16:42:06 auth_user_pass_file = '[UNDEF]'
2019-06-13 16:42:06 OpenVPN 2.5-icsopenvpn [git:icsopenvpn/v0.7.8-0-g168367a5] arm64-v8a [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Feb 22 2019
2019-06-13 16:42:06 library versions: OpenSSL 1.1.1a 20 Nov 2018, LZO 2.10
2019-06-13 16:42:06 MANAGEMENT: Connected to management server at /data/user/0/de.blinkt.openvpn/cache/mgmtsocket
2019-06-13 16:42:06 MANAGEMENT: CMD 'version 3'
2019-06-13 16:42:06 MANAGEMENT: CMD 'hold release'
2019-06-13 16:42:07 MANAGEMENT: CMD 'bytecount 2'
2019-06-13 16:42:07 MANAGEMENT: CMD 'proxy NONE'
2019-06-13 16:42:07 MANAGEMENT: CMD 'state on'
2019-06-13 16:42:07 Network Status: CONNECTED LTE to MOBILE www
2019-06-13 16:42:07 Debug state info: CONNECTED LTE to MOBILE www, pause: userPause, shouldbeconnected: true, network: SHOULDBECONNECTED
2019-06-13 16:42:07 Debug state info: CONNECTED LTE to MOBILE www, pause: userPause, shouldbeconnected: true, network: SHOULDBECONNECTED
2019-06-13 16:42:08 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
2019-06-13 16:42:08 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
2019-06-13 16:42:08 LZO compression initializing
2019-06-13 16:42:08 Control Channel MTU parms [ L:1624 D:1170 EF:80 EB:0 ET:0 EL:3 ]
2019-06-13 16:42:08 Data Channel MTU parms [ L:1624 D:1450 EF:124 EB:406 ET:0 EL:3 ]
2019-06-13 16:42:08 Local Options String (VER=V4): 'V4,dev-type tun,link-mtu 1572,tun-mtu 1500,proto TCPv4_CLIENT,comp-lzo,keydir 1,cipher AES-128-CBC,auth SHA256,keysize 128,tls-auth,key-method 2,tls-client'
2019-06-13 16:42:08 Expected Remote Options String (VER=V4): 'V4,dev-type tun,link-mtu 1572,tun-mtu 1500,proto TCPv4_SERVER,comp-lzo,keydir 0,cipher AES-128-CBC,auth SHA256,keysize 128,tls-auth,key-method 2,tls-server'
2019-06-13 16:42:08 TCP/UDP: Preserving recently used remote address: [AF_INET6]64:ff9b::b639:694a:1194
2019-06-13 16:42:08 Socket Buffers: R=[4194304->4194304] S=[524288->524288]
2019-06-13 16:42:08 Attempting to establish TCP connection with [AF_INET6]64:ff9b::b639:694a:1194 [nonblock]
2019-06-13 16:42:08 MANAGEMENT: >STATE:1560424328,TCP_CONNECT,,,,,,
2019-06-13 16:42:08 MANAGEMENT: CMD 'needok 'PROTECTFD' ok'
2019-06-13 16:42:09 TCP connection established with [AF_INET6]64:ff9b::b639:694a:1194
2019-06-13 16:42:09 MANAGEMENT: CMD 'needok 'PROTECTFD' ok'
2019-06-13 16:42:09 TCP_CLIENT link local: (not bound)
2019-06-13 16:42:09 TCP_CLIENT link remote: [AF_INET6]64:ff9b::b639:694a:1194
2019-06-13 16:42:09 MANAGEMENT: >STATE:1560424329,WAIT,,,,,,
2019-06-13 16:42:09 Connection reset, restarting [0]
2019-06-13 16:42:09 TCP/UDP: Closing socket
2019-06-13 16:42:09 SIGUSR1[soft,connection-reset] received, process restarting
2019-06-13 16:42:09 Waiting 2s seconds between connection attempt
2019-06-13 16:42:09 MANAGEMENT: >STATE:1560424329,RECONNECTING,connection-reset,,,,,
2019-06-13 16:42:14 MANAGEMENT: CMD 'hold release'
2019-06-13 16:42:14 MANAGEMENT: CMD 'proxy NONE'
2019-06-13 16:42:14 MANAGEMENT: CMD 'bytecount 2'
2019-06-13 16:42:14 MANAGEMENT: CMD 'state on'
2019-06-13 16:42:15 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
2019-06-13 16:42:15 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
2019-06-13 16:42:15 LZO compression initializing
2019-06-13 16:42:15 Control Channel MTU parms [ L:1624 D:1170 EF:80 EB:0 ET:0 EL:3 ]
2019-06-13 16:42:15 Data Channel MTU parms [ L:1624 D:1450 EF:124 EB:406 ET:0 EL:3 ]
2019-06-13 16:42:15 Local Options String (VER=V4): 'V4,dev-type tun,link-mtu 1572,tun-mtu 1500,proto TCPv4_CLIENT,comp-lzo,keydir 1,cipher AES-128-CBC,auth SHA256,keysize 128,tls-auth,key-method 2,tls-client'
2019-06-13 16:42:15 Expected Remote Options String (VER=V4): 'V4,dev-type tun,link-mtu 1572,tun-mtu 1500,proto TCPv4_SERVER,comp-lzo,keydir 0,cipher AES-128-CBC,auth SHA256,keysize 128,tls-auth,key-method 2,tls-server'
2019-06-13 16:42:15 TCP/UDP: Preserving recently used remote address: [AF_INET]182.57.105.74:1194
2019-06-13 16:42:15 Socket Buffers: R=[4194304->4194304] S=[524288->524288]
2019-06-13 16:42:15 Attempting to establish TCP connection with [AF_INET]182.57.105.74:1194 [nonblock]
2019-06-13 16:42:15 MANAGEMENT: >STATE:1560424335,TCP_CONNECT,,,,,,
2019-06-13 16:42:15 MANAGEMENT: CMD 'needok 'PROTECTFD' ok'
2019-06-13 16:42:16 TCP connection established with [AF_INET]182.57.105.74:1194
2019-06-13 16:42:16 MANAGEMENT: CMD 'needok 'PROTECTFD' ok'
2019-06-13 16:42:16 TCP_CLIENT link local: (not bound)
2019-06-13 16:42:16 TCP_CLIENT link remote: [AF_INET]182.57.105.74:1194
2019-06-13 16:42:16 MANAGEMENT: >STATE:1560424336,WAIT,,,,,,
2019-06-13 16:42:16 Connection reset, restarting [0]
2019-06-13 16:42:16 TCP/UDP: Closing socket
2019-06-13 16:42:16 SIGUSR1[soft,connection-reset] received, process restarting
2019-06-13 16:42:16 Waiting 2s seconds between connection attempt
答案1
当发生以下情况时会打印此消息配置中未指定 IPv4/v6 首选项(即使用 proto udp/tcp)并且 OpenVPN 作为服务器运行。只需在 server.conf 中更改您需要的 udp4/upd6:
;proto udp
proto udp4
更新:对于 tcp 协议(不是 udp),只需在 server.conf 中更改您需要的 tcp4/tcp6:
;proto tcp
proto tcp4
答案2
您的部分问题可能是有人试图对您的服务器进行 D-DoS 攻击,至少我的服务器发生了什么情况,一切运行正常,当我设置 OpenVpn 时,它运行正常,没有问题,当我遇到问题并碰巧重新安装操作系统并重新安装 OpenVpn 时,发生了错误。这可能是也可能不是您的问题,我希望这种方法会有所帮助。
首先-解决问题。
ifconfig 意味着您没有安装所需的软件包,因此当您输入 ifconfig 时,它不会显示接口配置,要解决这个问题,您需要安装 net-tools
yum 安装网络工具
现在无法确定 IPv4/IPv6,您可能不必禁用 IPv6,如果您愿意的话,您可以这样做,但我不相信它能解决您的问题,但是如果它能解决您的问题,那么恭喜您。
您接下来要做的就是编辑您的 iptables 以允许 openvpn,您的防火墙可能会阻止运行 openvpn 所需的配置。
你可以使用它来帮助你配置 iptables 以允许你的 openvpn 运行https://arashmilani.com/post?id=53
你可能还想安装 fail2banhttps://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-centos-7 您可能认为这与解决问题无关,但最好阻止 Scrub 试图闯入您的 VPS。如果您更喜欢使用其他东西,请继续使用。
接下来你可能需要启用 httpd https://www.liquidweb.com/kb/how-to-install-apache-on-centos-7/ 这也可能有助于解决您的问题。
接下来您可能想做的是使用 iptables 来帮助抵御 D dos 攻击。 https://javapipe.com/blog/iptables-ddos-protection/< 这应该对您有帮助,或者您可以使用其他来源来帮助您设置 vps 以帮助对抗 ddos 或安装您自己的防火墙。以下是您可以安装的一些防火墙,请注意,如果您的 vps 已经内置了防火墙,您可能需要禁用内置防火墙。
iptables 防火墙d csf IPCop 防火墙 Shorewall - Iptables 变得简单 pfSense Untangle NG 防火墙 UFW - 简单的防火墙 IPFire Smoothwall Express VyOS Vuurmuur
使用 iptables 或某种防火墙来帮助对抗 D dos 的原因是,如果大量流量被发送到您的网络,它可能会阻止您使用 openvpn。
- 如果您不信任我提供的链接,您可以研究其他链接来帮助设置您的 vps,以抵御可能发送到您的 vps 的 D dos 攻击。
我确实希望这会有所帮助,如果您没有其他软件包,您可能需要安装并确保您拥有可能需要安装的其他软件包。
您还可以检查是否安装了最新的 open ssl,最新版本是 v1.0.2,如果您正在运行 v1.0.1,那么您应该可以继续使用,或者您可能需要考虑升级您的 open ssl。