使用 Openvpn 服务器连接到 Openstack VPS 时,网络数据包无法到达本地主机

使用 Openvpn 服务器连接到 Openstack VPS 时,网络数据包无法到达本地主机

所以这是一个问题。

我在 Openstack VPS(hostigger,如果这很重要)上安装了 OpenVPN 服务器。我使用了指南https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04

到目前为止,一切都很好,我可以建立 VPN 连接。但是当我尝试访问几乎任何网站时,我都遇到了连接超时的情况。

为了调试,我已禁用 ufw。

Iptables:

$ iptables -t nat -v -x -n -L

Chain PREROUTING (policy ACCEPT 43527 packets, 3644888 bytes)
    pkts      bytes target     prot opt in     out     source               destination

Chain INPUT (policy ACCEPT 4095 packets, 441234 bytes)
    pkts      bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 33 packets, 2279 bytes)
    pkts      bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 33 packets, 2279 bytes)
    pkts      bytes target     prot opt in     out     source               destination
    1453   104793 MASQUERADE  all  --  *      ens3    10.0.0.0/8           0.0.0.0/0

ens3是我在服务器上的默认界面。

当我尝试tracert从本地机器

$ tracert google.com

Tracing route to google.com [172.217.16.46]
over a maximum of 30 hops:

  1    73 ms    73 ms    72 ms  10.8.0.1
  2    76 ms    86 ms    75 ms  185.181.208.1
  3    74 ms    81 ms    73 ms  static-217-195-202-1.fibersunucu.com.tr [217.195.202.1]
  4    79 ms    75 ms    74 ms  static-177-159-92-77.sadecehosting.net [77.92.159.177]
  5    75 ms    75 ms    75 ms  212.156.128.169.static.turktelekom.com.tr [212.156.128.169]
  6    74 ms    75 ms    77 ms  00-atakoy-xrs-t2-1---00-atakoy-t3-7.statik.turktelekom.com.tr [212.156.120.130]
  7   106 ms    75 ms    74 ms  00-gayrettepe-xrs-t2-1---00-atakoy-xrs-t2-1.statik.turktelekom.com.tr [81.212.203.102]
  8     *        *       75 ms  00-ebgp-gayrettepe-k---00-gayrettepe-xrs-t2-1.statik.turktelekom.com.tr [81.212.201.195]
  9    81 ms    76 ms    75 ms  212.156.120.178.26-eskisehir-t3-1.06-ulus-t3-7.statik.turktelekom.com.tr [212.156.120.178]
 10    83 ms    86 ms    83 ms  307-sof-col-1---00-ebgp-gayrettepe-k.statik.turktelekom.com.tr [212.156.104.22]
 11   112 ms   103 ms   124 ms  74.125.51.94
 12   106 ms   106 ms   111 ms  108.170.250.168
 13   145 ms   147 ms   142 ms  108.170.226.42
 14   132 ms   132 ms   134 ms  72.14.239.245
 15   132 ms   132 ms   132 ms  216.239.58.5
 16   136 ms   132 ms   141 ms  108.170.250.193
 17   132 ms   132 ms   132 ms  74.125.251.103
 18   135 ms   131 ms   132 ms  waw02s14-in-f14.1e100.net [172.217.16.46]

Trace complete.

Ping 也有效。

我已经跑了tcpdump

tcpdump -A -s 0 'src president.gov.by and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'

对于来自本地机器的请求,例如curl -sSL -D - http://president.gov.by/robots.txt- 它有效 - 我看到了 robots.txt

tcpdump 输出:

listening on tun0, link-type RAW (Raw IP), capture size 262144 bytes
23:30:02.115218 IP 178.124.139.203.http > 10.8.0.6.51344: Flags [P.], seq 272799366:272799764, ack 63565427, win 96, length 398: HTTP: HTTP/1.1 200 OK
E.....@./.(..|..
....P...B.....sP..`....HTTP/1.1 200 OK
Server: nginx
Date: Fri, 26 Jul 2019 20:30:02 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 173
Connection: keep-alive
Last-Modified: Fri, 26 Jul 2019 04:28:06 GMT
Accept-Ranges: bytes

User-agent: *
Disallow: /ru/search_ru
Disallow: /en/search_en
Disallow: /by/search_by
Disallow: /*printv
Host: president.gov.by
Sitemap: http://president.gov.by/sitemap.xml

但当我尝试curl -sSL -D - http://president.gov.by/

我在服务器的 tcpdump 输出中看到此情况,但从未在我的本地机器上看到过:

23:30:39.493302 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 2193652739:2193654079, ack 1503148830, win 96, length 1340: HTTP: HTTP/1.1 200 OK
E..d..@......|..
....P....|.Y.;.P..`)"..HTTP/1.1 200 OK
Server: nginx
Date: Fri, 26 Jul 2019 20:30:39 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 112378
Connection: keep-alive
Last-Modified: Fri, 26 Jul 2019 16:38:45 GMT
Accept-Ranges: bytes

    <!DOCTYPE HTML>
<html lang="ru-RU">
<head>
blah-blah-blah some html here

23:30:39.493315 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 1340:2680, ack 1, win 96, length 1340: HTTP
E..d..@......|..
....P.....?Y.;.P..`........................ .................... ................, .. .......... ...................... .................., .........., .............."/>
</head>
<body>
  blah-blah-blah some html here

23:30:39.493317 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 2680:4020, ack 1, win 96, length 1340: HTTP
E..d..@......|..
....P.....{Y.;.P..`I".. class="search" id="search_form">
        <div class="search_left"></div>
        blah-blah-blah some html here

23:30:39.493320 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 4020:5360, ack 1, win 96, length 1340: HTTP
E..d..@......|..
....P......Y.;.P..`...............">..............</a>blah-blah-blah some html here                                </div>
                <div class="top_m

23:30:39.493323 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 5360:6700, ack 1, win 96, length 1340: HTTP
E..d..@......|..
....P......Y.;.P..`/...enu_right"></div>
                blah-blah-blah some html here

23:30:39.493325 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 6700:8040, ack 1, win 96, length 1340: HTTP
E..d..@......|..
....P...../Y.;.P..`u>.blah-blah-blah some html here
                                                                                                <div class="bm_da
23:30:39.494547 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [P.], seq 8040:8173, ack 1, win 96, length 133: HTTP
[email protected].|..
....P.....kY.;.P..`....te">25 ........ 2019 ........</div>
                                                <a href="http://president.gov.by/ru/news_ru/view/rabochaja-poezdka-v-vetkovskij-rajon-gomel
23:30:39.633147 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 12193:13533, ack 1, win 96, length 1340: HTTP
[email protected]..|..
....P......Y.;.P..`blah-blah-blah some html here

23:30:40.186755 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 0:1340, ack 1, win 96, length 1340: HTTP: HTTP/1.1 200 OK
[email protected]..|..
....P....|.Y.;.P..`)"..HTTP/1.1 200 OK
Server: nginx
Date: Fri, 26 Jul 2019 20:30:39 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 112378
Connection: keep-alive
Last-Modified: Fri, 26 Jul 2019 16:38:45 GMT
Accept-Ranges: bytes

    <!DOCTYPE HTML>
<html lang="ru-RU">
<head>
       blah-blah-blah some html here

23:30:41.575025 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 0:1340, ack 1, win 96, length 1340: HTTP: HTTP/1.1 200 OK
[email protected]..|..
....P....|.Y.;.P..`)"..HTTP/1.1 200 OK
Server: nginx
Date: Fri, 26 Jul 2019 20:30:39 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 112378
Connection: keep-alive
Last-Modified: Fri, 26 Jul 2019 16:38:45 GMT
Accept-Ranges: bytes

    <!DOCTYPE HTML>
<html lang="ru-RU">
<head>
       blah-blah-blah some html here

23:30:44.350585 IP 178.124.139.203.http > 10.8.0.6.51366: Flags [.], seq 0:1340, ack 1, win 96, length 1340: HTTP: HTTP/1.1 200 OK
[email protected]..|..
....P....|.Y.;.P..`)"..HTTP/1.1 200 OK
Server: nginx
Date: Fri, 26 Jul 2019 20:30:39 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 112378
Connection: keep-alive
Last-Modified: Fri, 26 Jul 2019 16:38:45 GMT
Accept-Ranges: bytes

    <!DOCTYPE HTML>
<html lang="ru-RU">
<head>
       blah-blah-blah some html here
^C
11 packets captured
15 packets received by filter
3 packets dropped by kernel

我被困在这里。为什么我能访问 robots.txt,却不能访问更大的文件(index.html 等)

相关内容