初始化序列已完成,但终端不给出提示

初始化序列已完成,但终端不给出提示

我刚刚使用安装openvpn在远程服务器上CentOS 7本教程中的说明

我对教程所做的唯一更改是使用@GarethTheRed 配置防火墙的说明而不是 iptables,如本教程的步骤 4 中所述。

问题是教程以一行客户端代码结束,导致终端无法返回命令提示符(见下文)。 如何从本地 CentOS 7 devbox成功连接OpenVPN到远程服务器?CentOS 7

以下是我迄今为止尝试过的连接步骤:

在教程第 6 步结束时,我yum install openvpn在输入 之前成功在我的 devbox 上使用了sudo openvpn --config /path/to/client.ovpn

问题是sudo openvpn --config /path/to/client.ovpn导致打印后终端锁定Initialization Sequence Completed

完整的输出是:

[root@localhost ~]# openvpn --config /etc/openvpn/client.ovpn
Wed Feb 11 16:46:06 2015 OpenVPN 2.3.6 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Dec  2 2014
Wed Feb 11 16:46:06 2015 library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.06
Wed Feb 11 16:46:06 2015 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Wed Feb 11 16:46:06 2015 Socket Buffers: R=[212992->131072] S=[212992->131072]
Wed Feb 11 16:46:06 2015 UDPv4 link local: [undef]
Wed Feb 11 16:46:06 2015 UDPv4 link remote: [AF_INET]192.96.215.22:1194
Wed Feb 11 16:46:06 2015 TLS: Initial packet from [AF_INET]192.96.215.22:1194, sid=1f320288 ab1f20d3
Wed Feb 11 16:46:07 2015 VERIFY OK: depth=1, C=US, ST=CA, L=SomeTown, O=Fort-Funston, OU=MyOrganizationalUnit, CN=serverdomain.com, name=server, [email protected]
Wed Feb 11 16:46:07 2015 VERIFY OK: depth=0, C=US, ST=CA, L=SomeTown, O=Fort-Funston, OU=MyOrganizationalUnit, CN=server, name=server, [email protected]
Wed Feb 11 16:46:08 2015 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Feb 11 16:46:08 2015 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Feb 11 16:46:08 2015 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Feb 11 16:46:08 2015 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Feb 11 16:46:08 2015 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Wed Feb 11 16:46:08 2015 [server] Peer Connection Initiated with [AF_INET]192.96.215.22:1194
Wed Feb 11 16:46:10 2015 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Wed Feb 11 16:46:10 2015 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5'
Wed Feb 11 16:46:10 2015 OPTIONS IMPORT: timers and/or timeouts modified
Wed Feb 11 16:46:10 2015 OPTIONS IMPORT: --ifconfig/up options modified
Wed Feb 11 16:46:10 2015 OPTIONS IMPORT: route options modified
Wed Feb 11 16:46:10 2015 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed Feb 11 16:46:10 2015 ROUTE_GATEWAY 10.0.0.1/255.255.255.0 IFACE=p4p1 HWADDR=14:fe:b5:aa:57:60
Wed Feb 11 16:46:10 2015 TUN/TAP device tun0 opened
Wed Feb 11 16:46:10 2015 TUN/TAP TX queue length set to 100
Wed Feb 11 16:46:10 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Wed Feb 11 16:46:10 2015 /usr/sbin/ip link set dev tun0 up mtu 1500
Wed Feb 11 16:46:10 2015 /usr/sbin/ip addr add dev tun0 local 10.8.0.6 peer 10.8.0.5
Wed Feb 11 16:46:10 2015 /usr/sbin/ip route add 192.96.215.22/32 via 10.0.0.1
Wed Feb 11 16:46:10 2015 /usr/sbin/ip route add 0.0.0.0/1 via 10.8.0.5
Wed Feb 11 16:46:10 2015 /usr/sbin/ip route add 128.0.0.0/1 via 10.8.0.5
Wed Feb 11 16:46:10 2015 /usr/sbin/ip route add 10.8.0.1/32 via 10.8.0.5
Wed Feb 11 16:46:10 2015 Initialization Sequence Completed  

在此输出的末尾,只有一个光标,但没有命令提示符。除了在终端屏幕上打印您输入的内容之外,输入光标或按回车键没有任何效果。

我读另一篇帖子描述了类似的错误,并指出问题出在 DNS 配置中,但我完全按照教程的 DNS 配置说明进行操作。该服务器还处理由 httpd 提供的 mydomain.com 请求。早在添加 OpenVPN 之前,域名注册商就已经将对 mydomain.com 的请求指向服务器的 IP。这会引起某种冲突吗?我怎样才能完成连接?

答案1

尝试使用以下选项启动客户端--daemon

openvpn --daemon

来自openvpn的手册页:

--daemon [progname]
  Become a daemon after all initialization functions are completed

要与openvpn守护进程进行交互,请将该--management选项添加到命令中。这允许您使用telnet所描述的方式与其进行交互这里

或者,打开另一个终端并使用它。这样就可以在原来的终端中openvpn按退出运行了。Ctl C

如果客户端是使用网络管理器的桌面系统,则使用 OpenVPN 插件从那里控制它 - 无需终端。

答案2

我在这里遇到了同样的问题,这对我有用:

# setenforce 0 

相关内容