port forwarding on outgoing traffic

Discussions related to using VirtualBox on Windows hosts.
Post Reply
lws
Posts: 2
Joined: 11. May 2020, 03:11

port forwarding on outgoing traffic

Post by lws »

Hi,
I have a windows10 host and a ubuntu vm.
I want redirect all the traffic from the ubuntu vm to the host machine for all outgoing traffic.
I mean:
vm ubuntu --> internet ports 80,443 --> redirect to host machine port 8080
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: port forwarding on outgoing traffic

Post by BillG »

How have you configured the networking in the vm? Where would the outgoing traffic go by default?

With the default setting (NAT) all outgoing traffic goes via the host automatically.
Bill
lws
Posts: 2
Joined: 11. May 2020, 03:11

Re: port forwarding on outgoing traffic

Post by lws »

it's default settings, then NAT through the host.
Then yes,
all outgoing traffic goes via the host automatically.
well can I redirect everything to the host machine ?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: port forwarding on outgoing traffic

Post by scottgus1 »

lws wrote:can I redirect everything to the host machine
If you want absolutely no communication from the guests to leave the host, then use Host-Only. See Virtualbox Networks: In Pictures: Host-Only Adapter

NAT, also shown in the Pictures post, allows all guest output out onto the host, LAN, etc. (or rather, the guest can request anything from the host, LAN, and internet)

If you want partial filtering, allowing access to LAN services and internet access on other ports, but forcing all 80 & 443 traffic to the host, Virtualbox has no special method to do that. You will need a special guest between your guest and the host network to do that kind of filtering. Maybe pfSense?
Post Reply