
Introduction:
By work, I often have to work with refreshed 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
I paid 150 rubles for the purchase of the 2nd network card,
buying 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 x86 has problems with the bootloader.
(Software reboot did not work, i.e. only complete shutdown of the virtual machine and re-enable 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
First, download and install VirtualBox , as such
is missing, 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 setting is the easiest to do through another virtual machine with a guest OS ,
connected to the router via the internal network.
You can see the network setup in the screenshot.

Start both cars. Open a 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. Create two
virtual adapters and immediately in the ip settings we put everything in 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 and
because I have a binding on the MAC address, I registered exactly the same as the adapter.

The second adapter makes the connection type the virtual host adapter and
Select the first adapter in the name.
Mac address for beauty I wrote 000000000002
and in network connections I named the connection as 2) Router_02

The third adapter is done by analogy with the second, only two
we change to threes.

The fourth is for the time being left unconnected

And now agree:
We will redirect the entire Internet channel to the router and distribute via virtual adapters.
We need a second adapter to access this particular (host) machine’s Internet access,
and the third 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:
Turning off in the properties of the network interface of the Internet all services, clients and protocols,
except VirtualBox Bridged Networking Driver

We distribute the Internet on Lan:
Since 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 it fits perfectly for this task.
You configure it once and after that it will turn on the access point on its own.

After starting 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
Created a task with the name “1) StartRouterVirtualBox”, indicated to perform with the highest rights.
In the triggers, I created a condition on entering the system and indicated the path to the script in the actions.
Hidden launch of the program MyPublicWiFi.
We create the task "2) MyPublicWiFi".
Change the account to " system " (if you have Windows 8, then " System ") (write pens)
We make the highest rights and make the task hidden.
In the actions we indicate the launch of the program,
and in the trigger we create a “launch when any user logs in” with a delay of 30 seconds.
Setting up 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.
All files and videos.
I wish you all success in the experiments! See you again!