Page 1 of 1

port forwarding on outgoing traffic

Posted: 11. May 2020, 03:17
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

Re: port forwarding on outgoing traffic

Posted: 11. May 2020, 07:08
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.

Re: port forwarding on outgoing traffic

Posted: 11. May 2020, 20:31
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 ?

Re: port forwarding on outgoing traffic

Posted: 11. May 2020, 20:39
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?