自宅から企業のVPNに接続すると、インターネットトラフィックを含むすべてのネットワークトラフィックがVPNを通過します(図1)。VPNは私の自宅のインターネットよりもはるかに遅いので、VPNを介してイントラネットデータの要求のみをルーティングしたいと思います(図2)。
私のルートテーブルは次のように始まります:
IPv4 Route Table
================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 4000
0.0.0.0 0.0.0.0 On-link 10.0.0.142 26 <-appears when VPN connects
10.0.0.0 255.255.255.0 On-Link 10.0.0.142 26 <-appears when VPN connects
ルーティングテーブルについての私の理解は、0.0.0.0エントリがトラフィックがインターネットに到達する方法を説明しているということです。最初のエントリは、VPNが切断されたときにゲートウェイとして機能するホームルーターを表しています。2番目のエントリは、VPN経由でルーティングされたトラフィックを表します。
私が試してみました:
VPNは、Windows10の組み込みSSTPを介して接続されます。
私がやろうとしていることはできますか、そして次に何をすべきですか?
I found enough information in https://security.stackexchange.com/questions/13900/if-i-use-a-vpn-who-will-resolve-my-dns-requests to develop a solution.
I went to Control Panel > All Control Panel Items > Network Connections and edited the Properties of the VPN connection.
In the Networking tab I edited the TCP IPv4 settings. I changed the setting to use the default gateway on the remote network, and for good measure changed the metric to be a large number.
As these settings are saved in the VPN connection definition, they should be persistent but easily changeable.
After making these changes, I can still access the corporate network, but tracert
to www.google.com goes via my ISP.
異なるIP範囲を使用する企業ネットワークの地域スポークへのアクセスにいくつかの初期の問題がありました。VPNゲートウェイIPを指すrouteコマンドを使用してこれらにアクセスしてみました。がroute print
「オンリンク」としてVPNゲートウェイを列挙し、Nirsoft NetRouteViewは、次のようなコマンドをもたらす、実際のIPを与え
route -p ADD 192.168.50.0 MASK 255.255.255.0 10.0.0.50
ただし、VPNゲートウェイはときどき変更されるため、Add-VpnConnectionRoute
PowerShellで使用するより堅牢なソリューションが見つかりました。
Add-VpnConnectionRoute -ConnectionName "VPN" -DestinationPrefix 192.168.50.0/24
ルートが追加されたことを確認するには、次のPowershellコマンドを使用できます。
$conn = Get-VpnConnection -Name "VPN"
$conn.routes
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加