Juniper VPN を使用してすべての Ubuntu トラフィックを Windows 7 Virtualbox にルーティングする

Juniper VPN を使用してすべての Ubuntu トラフィックを Windows 7 Virtualbox にルーティングする

会社の VPN に接続するには、Juniper VPN を使用する必要があります。残念ながら、私の会社では Ubuntu からの直接接続は許可されていません。そのため、VirtualBox に最小限の Windows 7 VM をインストールし、そこから Juniper を実行して、会社の企業ネットワークに正常に接続できるようにしています。

アイデアとしては、Linux を仕事に使用し、VirtualBox のみを使用してすべてのトラフィックを VPN 経由でルーティングすることです。(Linux で VPN を使用することはできません)

問題は、ゲスト上の VPN を介してすべてのトラフィックをルーティングする方法がわからないことです。(HTTP、SSH、...) ポート転送を試しましたが、それが答えかどうかはわかりません。おそらく、管理者として VirtualBox を使用して 1024 未満のポートをリッスンする必要があると思いますが、VirtualBox はそれをリッスンしていないようです。

答え1

今日はうまくいきました!

セットアップは実際にはそれほど難しくありません。私は Ubuntu 17.04 を実行しており、Windows 7 VM を持っています。

Windows VM ネットワーク設定:

adapter 1: host only (give a static ip: 192.168.56.11)
adapter 2: bridged   (got a DHCP ip from my router: 192.168.0.106)

Ubuntuのセットアップ:

wlp5s0: DHCP ip from router 192.168.0.105
vboxnet0: 192.168.56.1

Windows VM に CheckPoint VPN 接続があります。

ここに画像の説明を入力してください

Ethernet 2 = Host only
Ethernet 3 = Bridged
Ethernet 4 = VPN. This is the one you will need to share with Ethernet 2 (hostony)
  • 「プロパティ」を右クリック
  • 共有タブ
  • 「ホストのみ」ネットワークと共有

次に私のUbuntuボックスで: (192.168.222.50は企業ネット上のホストです)

sudo route add 192.168.222.50 via 192.168.56.11

または範囲全体をルーティングする

sudo route add 192.168.222.0/24 via 192.168.56.11

また、企業の DNS サーバーを /etc/resolv.conf に追加することを忘れないでください。

答え2

Windows 7 VM では、ICS (インターネット接続の共有) がおそらく機能します。

   ICS and VPN connections

   If you create a virtual private network (VPN) connection on your host 
   computer to a corporate network and then enable ICS on that 
   connection, all Internet traffic is routed to the corporate network 
   and all of the computers on your home network can access the 
   corporate network. If you don't enable ICS on the VPN connection, 
   other computers won't have access to the Internet or corporate 
   network while the VPN connection is active on the host computer.

あなたのセットアップでは (そして上記の段落のコンテキストでは)、Windows 7 VM がホストになります。Ubuntu システム (VM コンテキストでは「ホスト」と見なされます) では、次のようなものが機能します。

ネットワークを無効にする

sudo /etc/init.d/networking stop

クライアントに静的IPアドレスを与える

sudo ip addr add 192.168.0.100/24 dev eth0

この IP アドレスは、ゲートウェイのプライベート IP 範囲内であれば何でもかまいません。

ルーティングを構成する

sudo ip route add default via 192.168.0.1

見るhttps://help.ubuntu.com/community/Internet/ConnectionSharing詳細については。

上記のシナリオでは、Ubuntu が ICS クライアント、Windows 7 が ICS サーバー (または「ゲートウェイ」) になります。

また、Linux で VPN に接続できないのは確かですか?http://kb.juniper.net/InfoCenter/index?page=content&id=KB25230どうやら、Juniper には Linux VPN クライアントがあるようです。また、会社が VPN に接続するために何らかの独自のソフトウェアを使用している場合でも、そのソフトウェアが Wine で実行される可能性があります。https://serverfault.com/questions/363061/linux から Juniper VPN に接続する方法これに関係があるかもしれません。

関連情報