PPTP VPN和上網
簡要說明:
我機器的位址為192.168.168.168,網路閘道為192.168.168.8。
PPTP撥號成功後所獲得的位址為10.1.0.1,遠端需通過PPTP訪問的位址段為192.168.3.0(255.255.255.0)。
看Windows路由表結果顯示如下:
C:\>route print 0.0*
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 02 3f 6e e4 90 ...... Realtek RTL8139/810x Family Fast Ethernet NIC -
Deterministic Network Enhancer Miniport
0x50004 ...00 53 45 00 00 00 ...... WAN (PPP/SLIP) Interface
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.1.0.1 10.1.0.1 1
0.0.0.0 0.0.0.0 192.168.168.8 192.168.168.168 2
Default Gateway: 10.1.0.1
===========================================================================
Persistent Routes:
None
可以看到原來的預設網路閘道192.168.168.8的metric值已被修改為2,另外還增加了一個預設網路閘道10.1.0.1,metric值為1,若到達同一網段存在兩條路徑,則metric值低的優先,這樣所有的Internet流量(包括PPTP流 量)均送往10.1.0.1,這樣用戶就上不了網。
要解決這個問題需要對Windows機器的路由表項進行修改,首先驗證PPTP連接所獲得的IP位址:
C:\>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.168.168
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.168.8
PPP adapter Unida PPTP:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.1.0.1
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . :
然後做如下處理:
route delete 0.0.0.0
!---刪除所有的預設路由表項
route add 0.0.0.0 mask 0.0.0.0 192.168.168.8 metric 1
!---增加一個預設路由表項,網路閘道為原先的網路閘道192.168.168.8,所有的Internet流量均送往此網路閘道
route add 192.168.3.0 mask 255.255.255.0 10.1.0.1 metric 1
!---增加PPTP VPN路由表項,將所有送往遠端VPN設備後網段的流量均送往10.1.0.1
XP在撥號網路連接中的TCPIP內容中,把選項作為預設網路閘道選項不選,就可以了。
|