1

I need to send HTTP traffic from the VirtualBox Host through a router. To do this, I think I have to do the following steps:

  1. Create a SOCKS proxy using ssh -D
  2. Configure firefox to use the created proxy.

To further clarify, the Host will run two VMs. The first VM will use the second VM as a router to route traffic for the first VM.

The question is that I need to use two virtual machines (server and router) + my main computer (Host). Then I need to be able to send http traffic from the Host through the Router, for this I need to perform these steps: 1.1) Organize socks-proxies using ssh, option -D; 1.2) Configure the firefox browser to use the received socks proxy; I chose the firefox browser (I have it in ubuntu). Please help me realize it !!!

  • "Send http traffic from the through a router". Are you talking about normal NAT, or something like a bastion host? – earthmeLon Mar 25 '19 at 18:22
  • Yes, I am talking about normal NAT with the help of program VirtualBox (Linux). – Roman Mar 25 '19 at 18:27
2

When creating a Guest/VM in VirtualBox, that VM is added to a new network, which uses the Host as a gateway. This means that, by default, all VM traffic will be NAT'd by the Host, and as long as the Host can reach the Internet, the VM can also reach the Internet.

Again, these are the default settings. Can you describe any changes you've made to the defaults, or why this doesn't work for you in particular? If you have these details, please update your question.

Last time I spun up a VM, the Guest was given an IP address in 10.1.2.0/24 CIDR block. This could cause complications with your network, depending on IP addresses.

My guess is you went into the Guest's settings and didn't see any "Network Devices", so maybe you added one? This could cause complications, as the functionality that you want is the VirtualBox default. If you don't have sensitive data, maybe try creating a new Guest, and do not adjust any settings related to the network until you see it working initially.


Start with two, new Virtual Machines, with default Virtual Box network settings, and watch the behavior. The two machines are on the same subnet, for which your Host is the gateway. The Host performs NAT for all VMs, so start with these default settings, and then work towards your goal once you see the two machines can communicate over TCP/IP.

| improve this answer | |
  • Hi! I first of all created the server (client) and a router in virtualbox. For the router, I create the following attributes: 1) Get root privileges, 2) Get settings for NAT interface via dhcp from VirtualBox, 3) Manually configure the network interface of the internal network, 4) We start ssh service, 5) Set new user password. 6) Change the system hostname, the login is required to update, 7) We configure the apt package manager to use the proxy of the computer department and systems, with direct access to the Internet, this step is not needed and so on – Roman Mar 27 '19 at 18:31
  • Yeah, all those steps you're doing... it's the default behavior. I believe you're complicating the process by trying to set up a new network in VirtualBox, when the default does exactly what you want. I highly recommend that you create a new VM, without adjusting the network settings to see that the VM behaves as you want. Once you see this and have a working starting point, if your scenario requires it, make small adjustments and test each iteration to be working before you move on. – earthmeLon Mar 27 '19 at 18:35
  • It turns out that I have a host (the physical computer itself) + router + server. The router has two networks (internal and external). And I need some way to send HTTP traffic from the VirtualBox Host through a router. To do this, I think I have to do the following steps: 1)Create a SOCKS proxy using ssh -D 2)Configure firefox to use the created proxy. – Roman Mar 27 '19 at 18:55
  • the question is that I need to use two virtual machines (server and router) + my main computer (Host). Then I need to be able to send http traffic from the Host through the Router, for this I need to perform these steps: 1.1) Organize socks-proxies using ssh, option -D; 1.2) Configure the firefox browser to use the received socks proxy; I chose the firefox browser (I have it in ubuntu). Please help me realize it !!! – Roman Mar 30 '19 at 13:19
  • Yeah, so keep the default settings. Create the two VMs. Ping each VM IP from the other VM. Your 'Router Guest' will need to be properly set up, but start with default settings, ping the machines, and you should see they are routeable. – earthmeLon Mar 30 '19 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.