Virtual router DD-WRT x86 on VirtualBox
Introduction:
By work, I often have to work with reflash routers on DD-WRT or OpenWRT. All the time, it somehow managed to do without a router at home, but the possibilities that these firmware give are really cool. So I thought about purchasing a router, so that I could draw all the services that I might need. I stopped at the choice of Asus RT-N16 , but, really, this toy turned out to be a little expensive for me. This is despite the fact that there was no real need for a router, since Excellent saved network Wi-Fi card TP-LINK WN851ND .
So I came up with the idea of a virtual router , an experience that I’m sharing with you now.
A little about the pros and cons:
1. + Low cost
extra costs I have made 150r for the purchase of the 2nd network card, the
purchase of two cards at once will cost around 1000r
2. + High performance.
Maximum than we are limited - this is the characteristics of the computer itself.
3. + No binding to a clear gland.
Gives the freedom to configure our router
4. - Dependence on the computer.
An external factor for this router is the OS, which does not always work stably.
5. - Permanent computer operation.
After installing a quiet cooler, this is not a problem at all.
6. - There are difficulties in setting up.
Not everyone will understand and master, much less see the meaning in it.
DD-WRT or OpenWRT?
OpenWRT is a cool firmware, but on x86 there are problems with the bootloader.
(A soft reset did not work, i.e. only completely shutting down the virtual machine and restarting it.
After upgrading VirtualBox to 4.3.4, it stopped running altogether.)
Problems with DD-WRT also could not be avoided, but she was only one and I will not dwell on it.
Getting started:
Initial picture of my network connections
To begin with, we will download and install VirtualBox , if there is
no such one , and the archive , in which there are all the necessary programs and files.
Customize (create) a virtual machine. I will not repeat how to do this, you can read in the article , it’s only natural for the media to indicate our image of the firmware downloaded earlier in the archive.
First setting:
The first adjustment is most easily done through another virtual machine guest operating system ,
connected to a router on the internal network.
You can see the network setup in the screenshot.
Start both cars. Open the browser in the guest system and
go to http://192.168.1.1/ .
If you saw the next picture, rejoice!
You did it!
It's enough just to enter a new username and password.
Feel free to click Change Password and then turn off both machines (router and OS).
Configure the network:
1) Create new interfaces.
In the main VirtualBox window, press the Ctrl + G combination.
Go to Network-> Virtual Host Networks. We create two
virtual adapters and immediately in the ip settings we put everything into the machine:
2) Configure the network of the router.
We include all four network adapters.
We check that the adapter type is PCnet- FAST III everywhere .
Everywhere I allowed an illegible mode.
In the first adapter, I make a network bridge with an adapter to which I have Internet access,
since I have a binding on the MAC address, I registered exactly the same as the adapter.
The second adapter makes the connection type Virtual Host Adapter and
select the first adapter in the name.
I wrote the poppy address for beauty 000000000002
and in the network connections I named the connection as 2) Router_02
We make the third adapter by analogy with the second one, only
changing the two to triples.
The fourth is still unconnected
And now agree:
We will redirect the entire Internet channel to the router and distribute via virtual adapters.
We need the second adapter to access the Internet of this particular (host) machine,
and the third one to distribute the network over the LAN. Otherwise, if you distribute the Internet through which you are sitting, then there
will be problems with routing, as practice has shown.
We get completely the Internet on a router:
Disable all services, clients, and protocols in the properties of the Internet network interface,
except for VirtualBox Bridged Networking Driver
We distribute the Internet on Lan:
Because all four adapters of the router will be occupied by us, we make a network bridge using OS facilities.
Let's turn everything off in the properties of the second network card and only then merge it into a network bridge with 3) Router_03
We distribute the Internet via Wi-Fi:
I like the program MyPublicWiFi, which is also in the archive.
Basically, you can choose any other. I will say that I like many other analogues, but for this task it fits perfectly.
You configure it once and after that it will turn on the access point on its own.
After launching the access point in network connections
, you will have another virtual adapter Microsoft Virtual WiFi Miniport Adapter .
All the IP settings are set automatically and add to the network bridge with the fourth router adapter
Silent mod:
Hidden launch of the router.
Using procexp.exe, open the properties of the router process and copy the launch parameters.
We edit the StartRouterVirtualBox.VBS file and replace the parameters with our own.
You can just throw the script into autoload.
I preferred another option - Task Scheduler I
created a task with the name “1) StartRouterVirtualBox”, indicated to perform with the highest rights.
In the triggers, I created a condition at login and indicated the path to the script in the actions.
Hidden launch of the program MyPublicWiFi.
Create the task "2) MyPublicWiFi.
Change the account to " system " (if you have Windows 8, then " System ") (write with pens)
Make the highest rights and make the task hidden.
In the actions we specify the launch of the program,
and in the trigger we create a “launch at the entrance of any user” with a delay of 30 seconds.
Configure the router:
I will not repeat how to set up DD-WRT.
You can read the settings of the Internet and all the firmware here and of course Google to help , as well as the video that I recorded.
I wish you all success in the experiments! See you again!