如何使用 win 7 VM 将我的 ubuntu 连接到我的工作场所 GlobalProtect VPN

ozm*_*zma 22 vpn

我想连接到我的工作场所 PaloAlto GlobalProtect VPN。问题:没有linux客户端(或者我可以使用linux但是需要IT组的合作......)

Dan*_*Dan 28

我最近扩展了出色的开源 VPN 客户端OpenConnect,以支持 PAN GlobalProtect VPN,包括 SSL-VPN 和 IPsec/ESP 模式。

这是一项正在进行工作,但我已经将它用于实际工作,并且对我来说效果很好。让其他人测试它会很棒,我欢迎您的反馈!

globalprotect从此存储库构建分支:https : //github.com/dlenski/openconnect

...然后像这样运行它来测试它(--certificate如果你的 VPN 不使用客户端证书,你可以省略这部分):

$ ./openconnect --protocol=gp [--certificate=my_cert_with_pk.pem] \
              server.company.com --dump -vvv
Please enter your username and password.
Username: 
Password: 
Run Code Online (Sandbox Code Playgroud)

目前它仅支持用户名、密码和可选的客户端证书身份验证……因为这是我拥有的唯一示例。但如果有其他身份验证方法在使用,我欢迎反馈。

PS-对于我的VPN,VPN隧道服务器是相同的VPN“门户网站”的服务器,但你的VPN可能会有所不同。尝试使用带有 OpenConnect 的 Windows 客户端中显示的“门户地址”和“GlobalProtect 网关 IP”:

[GlobalProtect Windows 客户端]


ozm*_*zma 0

(假设VPN子网为“10.0.0.0/255.0.0.0”,您可以根据需要进行调整)

  1. 安装win 7 虚拟机。
  2. 在win VM中安装并配置VPN访问并共享VPN虚拟适配器的互联网连接
  3. 在 virtualbox 中,转到:文件 -> 首选项 -> 网络 -> 仅主机网络 -> 添加网络并将其修改为具有以下 IP 192.168.137.100 *请参阅故障排除 1
  4. 备份 /etc/resolve.conf
  5. (我现在使用 ubuntu 15.10)在连接配置中手动将 DNS 设置为 192.168.137.1 以及一些不在虚拟机和 VPN 中的其他 dns(例如您的路由器 IP、ISP dns ip 等)。(老把戏并不完美:将“nameserver another”替换为“nameserver 192.168.137.1”)您可以“nslookup google.com”并在回复中查看dns IP
  6. 添加路由-“路由添加-net 10.0.0.0网络掩码255.0.0.0 gw 1​​92.168.137.1”

故障排除: 1. 在 win 虚拟机中检查仅主机的 IP,然后确保 vboxnet0 位于同一子网中,尝试 ping win 计算机中的 vbox-net-adapter ip


ozm*_*zma 0

我的工作配置 Linux 主机ifconfig

vboxnet0  Link encap:Ethernet  HWaddr 0a:ee:27:00:09:00  
        inet addr:192.168.137.100  Bcast:192.168.137.255  Mask:255.255.255.0
        inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
        RX packets:0 errors:0 dropped:0 overruns:0 frame:0
        TX packets:1340 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:429784 (429.7 KB)

wlan0     Link encap:Ethernet  HWaddr 82:49:34:1a:a6:e9  
          inet addr:10.157.48.55  Bcast:10.157.48.255  Mask:255.255.255.0
          inet6 addr: fe80::8219:34ff:fe15:a6e9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10935 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9571 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6235519 (6.2 MB)  TX bytes:2625822 (2.6 MB)
Run Code Online (Sandbox Code Playgroud)

Linux主机路由:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.157.48.1     0.0.0.0         UG    400    0        0 wlan0
10.0.0.0        192.168.137.1   255.0.0.0       UG    0      0        0 vboxnet0
link-local      *               255.255.0.0     U     1000   0        0 wlan0
192.168.137.0   *               255.255.255.0   U     100    0        0 vboxnet0
Run Code Online (Sandbox Code Playgroud)

〜$ netstat -nr

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.157.48.1     0.0.0.0         UG        0 0          0 wlan0
10.0.0.0        192.168.137.1   255.0.0.0       UG        0 0          0 vboxnet0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlan0
192.168.137.0   0.0.0.0         255.255.255.0   U         0 0          0 vboxnet0
Run Code Online (Sandbox Code Playgroud)

Windows igconfig:

Ethernet adapter VPN:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::a0fd:e08a:6a52:87db%12
   IPv4 Address. . . . . . . . . . . : 10.7.8.23
   Subnet Mask . . . . . . . . . . . : 255.255.255.255
   Default Gateway . . . . . . . . . :

Ethernet adapter vboxnet0:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::a4bb:6e53:572:5682%13
   IPv4 Address. . . . . . . . . . . : 192.168.137.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::90de:f93f:b73d:871f%11
   IPv4 Address. . . . . . . . . . . : 10.0.2.15
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.0.2.2
Run Code Online (Sandbox Code Playgroud)