開啟VPN LAN路由。心潮澎湃

開啟VPN LAN路由。心潮澎湃

我在從 VPN 網路路由到 LAN(也返回)時遇到問題。伺服器作業系統 Windows Server 2012(關閉所有防火牆進行測試),用戶端作業系統 Windows 7。從我的 LAN 我可以 ping VPN 伺服器(192.168.0.246,以及他的 VPN 位址 10.5.0.1)。從 VPN 網路用戶端(任何)我可以 ping VPN 伺服器(10.5.0.1,以及他的 LAN 位址 192.168.0.246)VPN 用戶端可以 ping 並存取 10.5.0.0\24 中的任何網路資源。但不能再進一步了。因此,如果有人能給我提示,那就太好了。

port 1194

proto udp

dev tun

ca C:\\OpenVPN\\easy-rsa\\keys\\ca.crt
cert C:\\OpenVPN\\easy-rsa\\keys\\OVPN.crt
key C:\\OpenVPN\\easy-rsa\\keys\\OVPN.key  # This file should be kept secret

dh C:\\OpenVPN\\easy-rsa\\keys\\dh1024.pem

topology subnet

server 10.5.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

push "route 192.168.0.0 255.255.255.0"
push "route 10.5.0.0 255.255.255.0"


push "dhcp-option DNS 192.168.0.249"
push "dhcp-option DNS 192.168.0.251"

push "dhcp-option DOMAIN *.local"
push "dhcp-option SEARCH *.local"

client-to-client

keepalive 10 120

tls-auth C:\\OpenVPN\\easy-rsa\\ta.key 0 # This file is secret

cipher AES-256-CBC

persist-key
persist-tun

status openvpn-status.log

verb 3

伺服器日誌太大,無法貼到這裡,所以這裡是http://pastebin.com/5zBBw2ad

客戶端配置

client

dev tun

proto udp

remote here was address 1194

resolv-retry infinite

nobind

persist-key
persist-tun

ca C:\\Openvpn\\ssl\\ca.crt
cert C:\\Openvpn\\ssl\\SharanMTS.crt
key C:\\Openvpn\\ssl\\SharanMTS.key

remote-cert-tls server

tls-auth C:\\Openvpn\\ssl\\ta.key 1

cipher AES-256-CBC

verb 3

客戶端登入這裡http://pastebin.com/VUbZN84Y

我的路線列印

0.0.0.0 0.0.0.0 192.168.0.10 192.168.0.77 20
10.5.0.0 255.255.255.0 192.168.0.246 192.168.0.77 21
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.0.0 255.255.255.0 On-link 192.168.0.77 276
192.168.0.77 255.255.255.255 On-link 192.168.0.77 276
192.168.0.255 255.255.255.255 On-link 192.168.0.77 276
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.0.77 276
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.0.77 276

客戶端路由列印

0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.3 276
10.5.0.0 255.255.255.0 10.5.0.1 10.5.0.49 20
10.5.0.49 255.255.255.255 On-link 10.5.0.49 276
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.0.0 255.255.255.0 10.5.0.1 10.5.0.49 20
192.168.1.0 255.255.255.0 On-link 192.168.1.3 276
192.168.1.3 255.255.255.255 On-link 192.168.1.3 276
192.168.1.255 255.255.255.255 On-link 192.168.1.3 276
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.1.3 276
224.0.0.0 240.0.0.0 On-link 10.5.0.49 276
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.1.3 276
255.255.255.255 255.255.255.255 On-link 10.5.0.49 276

伺服器路由列印

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.0.10    192.168.0.246     10
         10.5.0.0    255.255.255.0    192.168.0.246    192.168.0.246     11
         10.5.0.0    255.255.255.0         On-link          10.5.0.1    276
         10.5.0.1  255.255.255.255         On-link          10.5.0.1    276
       10.5.0.255  255.255.255.255         On-link          10.5.0.1    276
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      192.168.0.0    255.255.255.0         On-link     192.168.0.246    266
    192.168.0.246  255.255.255.255         On-link     192.168.0.246    266
    192.168.0.255  255.255.255.255         On-link     192.168.0.246    266
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link          10.5.0.1    276
        224.0.0.0        240.0.0.0         On-link     192.168.0.246    266
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link          10.5.0.1    276
  255.255.255.255  255.255.255.255         On-link     192.168.0.246    266
===========================================================================

答案1

在一些聰明人的幫助下,我發現我沒有提供 VPN 子網路和 LAN 網路之間的路由。因此,在我的伺服器上,我新增了從一個子網路到另一個子網路的靜態路由-p add 10.5.0.0/24 192.168.0.246 和route -p add 192.168.0.0/24 10.5.0.1 所以現在a可以存取這兩個網路。謝謝https://superuser.com/users/619267/seth

相關內容