开发者

How to forward ip/port [Windows]

开发者 https://www.devze.com 2023-03-01 09:10 出处:网络
I have a guest machine (linux), installed in a virtualBox. I can access to the guest mach开发者_如何学Goine from my host machine (a windows machine), but i can\'t access to the guest machine from outs

I have a guest machine (linux), installed in a virtualBox. I can access to the guest mach开发者_如何学Goine from my host machine (a windows machine), but i can't access to the guest machine from outside.

my guest machine contain a web server (port 8080).

I think I must forward ip/port in my host machine like this: ip_host/8080 to ip_guest/8080

I want to use just command line in windows or something like IPTables (no use of a software).

Thanks for any suggestion/Ideas


Virtual machine network settings

The easiest way to do what you want is to configure the network interface on your virtual machine to use the bridged network option. There's probably a checkbox for this where you configure the virtual machine in VirtualBox. This will allow connections to and from your virtual machine and the virtual machine will be on the same network as your host machine.

Using netsh

If for some reason you can't do the first then you can use netsh to forward a port from the external interface on your host machine to the interface of your virtual machine. For example see: http://technet.microsoft.com/en-us/library/cc754535(WS.10).aspx#BKMK_95. You need to enter something like 'netsh routing ip nat ....' on the cmdline to enter that context and fiddle with the portmapping setting to get what you want. I doubt it would work on XP

Using a proxy server

If the top 2 don't work try running FreeProxy and setting up a tunnel from your external interface to the interface on the virtual machine. The virtual machine must not be behind a NAT, so again check the network config settings of the virtual machine and make sure it's bridged or host only.

0

精彩评论

暂无评论...
验证码 换一张
取 消