Multiple Ports Forwarding
-
oanaradu32
- Posts: 2
- Joined: 12. Oct 2007, 20:15
Multiple Ports Forwarding
Hi,
does anyone know how to forward more than one port?
The network connection between Host and Guest works fine, Port Forwarding for only one port also works fine.
For example:
For port 22(ssh) i have this:
"c:\Program Files\innotek VirtualBox\VBoxManage" setextradata "fedora7" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
"c:\Program Files\innotek VirtualBox\VBoxManage" setextradata "fedora7" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
"c:\Program Files\innotek VirtualBox\VBoxManage" setextradata "fedora7" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 22
But if i want tot forward another port (80 HTTP) only the last port that i forwarded will be working.
Thanks.
does anyone know how to forward more than one port?
The network connection between Host and Guest works fine, Port Forwarding for only one port also works fine.
For example:
For port 22(ssh) i have this:
"c:\Program Files\innotek VirtualBox\VBoxManage" setextradata "fedora7" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
"c:\Program Files\innotek VirtualBox\VBoxManage" setextradata "fedora7" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
"c:\Program Files\innotek VirtualBox\VBoxManage" setextradata "fedora7" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 22
But if i want tot forward another port (80 HTTP) only the last port that i forwarded will be working.
Thanks.
Homepage: www.queeq.com
-
oanaradu32
- Posts: 2
- Joined: 12. Oct 2007, 20:15
I suppose it is not yet possible, only with a host interface.
Ok then I will wait for the next version.
Thanks.
Ok then I will wait for the next version.
Thanks.
Homepage: www.queeq.com
Same with me...
I'm dealing with the same issue, I need to port forward more than one port to an Ubuntu 7.04 running on a Windows XP SP2 host and, due to company firewall restrictions, it's very desirable access this Linux resources via NAT.
Anybody knows a way to port forward 2 or more ports without bridging the virtual Linux host interface? Or, if this configuration is officially unavailable?
Thanks,
Anybody knows a way to port forward 2 or more ports without bridging the virtual Linux host interface? Or, if this configuration is officially unavailable?
Thanks,
Regards,
Jon
Jon
Yeah it seems you can only forward port one port from your host to your guest (as of VirtualBox 2.0.4). It would be great if VirtualBox fixed this.
But, in the meantime you can get around this limitation by port forwarding 22 and then tunneling all the other ports thru that. You can read more by doing a web search for "tunnel ports thru ssh".
But, in the meantime you can get around this limitation by port forwarding 22 and then tunneling all the other ports thru that. You can read more by doing a web search for "tunnel ports thru ssh".
I was wrong. You just have to use a different name in that path, instead of "guestssh" you could have "guesthttp", etc. Here's an example:
To forward port SSH:
To forward port HTTP:
To forward port SSH:
Code: Select all
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
Code: Select all
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol" TCP
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort" 80
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort" 8080
-
TerryE
- Volunteer
- Posts: 3572
- Joined: 28. May 2008, 08:40
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
- Contact:
Guys, have a look at my answer on http://forums.virtualbox.org/viewtopic.php?t=11053
You can have as many redirects as you want as long as the descriptor (eg "guestssh" is your example) is unique for each (Protocol, GuestPort, HostPort) triple.
You can have as many redirects as you want as long as the descriptor (eg "guestssh" is your example) is unique for each (Protocol, GuestPort, HostPort) triple.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Google your Q site:VirtualBox.org or search for the answer before posting.
For now I'm just doing it in a loop...
Code: Select all
#!/bin/bash
for a in {12401..12500}
do
VBoxManage setextradata "myServer" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/rmi_$a/Protocol" TCP
VBoxManage setextradata "myServer" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/rmi_$a/GuestPort" $a
VBoxManage setextradata "myServer" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/rmi_$a/HostPort" $a
done -
TerryE
- Volunteer
- Posts: 3572
- Joined: 28. May 2008, 08:40
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
- Contact:
That would work 
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Google your Q site:VirtualBox.org or search for the answer before posting.