Adr*_*aux 5 networking vpn virtualbox ubuntu juniper
我必须使用瞻博网络 VPN 才能连接到我公司的 VPN。不幸的是,我的公司不允许直接从 Ubuntu 连接。所以我在 VirtualBox 中有一个最小的 Windows 7 VM 并从那里运行 Juniper,我可以在那里成功连接到我公司的公司网络。
这个想法是使用我的 linux 工作并使用 virtualbox 仅通过 vpn 路由所有流量。(在 linux 上使用 VPN 不是一种选择)
问题是我不知道如何通过来宾上的 vpn 路由所有流量。(HTTP,SSH,...)。我尝试了端口转发,但我不知道这是否是答案,也许我应该使用 virtualbox 作为管理员来侦听 < 1024 个端口,但似乎 virtualbox 没有侦听那个。
我今天让它工作了!
设置其实并不难。我运行 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)
Run Code Online (Sandbox Code Playgroud)
Ubuntu设置:
wlp5s0: DHCP ip from router 192.168.0.105
vboxnet0: 192.168.56.1
Run Code Online (Sandbox Code Playgroud)
我在 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)
Run Code Online (Sandbox Code Playgroud)
然后在我的 Ubuntu 机器上:(192.168.222.50 只是公司网络上的一个主机)
sudo route add 192.168.222.50 via 192.168.56.11
Run Code Online (Sandbox Code Playgroud)
或路由整个范围
sudo route add 192.168.222.0/24 via 192.168.56.11
Run Code Online (Sandbox Code Playgroud)
另外,不要忘记将您的公司 DNS 服务器添加到 /etc/resolv.conf!
小智 2
在 Windows 7 VM 上,ICS(Internet 连接共享)可能会起作用:
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.
Run Code Online (Sandbox Code Playgroud)
根据您的设置(以及在上一段的上下文中),Windows 7 VM 将成为主机。在 Ubuntu 系统(在虚拟机上下文中被视为“主机”)上,类似这样的事情可以工作:
禁用网络
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/how-to-connect-to-a-juniper-vpn-from-linux可能与此相关。
归档时间: |
|
查看次数: |
2873 次 |
最近记录: |