Syed Jahanzaib Personnel Blog to Share Knowledge !

December 10, 2012

Vritualization: 3 in 1 > Using Mikrotik + Squid Proxy + Radius on single machine to save resources :)

Filed under: General IT Related, Mikrotik Related, VMware Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 1:12 PM

"Virtualizing

.

Its a good idea to virtualize various servers so underutilized hardware can be used more efficiently, as now a days, getting good hardware is not a big deal. It can save considerable amount of power consumption , reduced heat factor , easy to mange multiple VM using various tools like Vcenter / VEEAM (my favorite), VM Explorer , live migrations from one Virtual Server to Another, Backup & Restore becomes very easy and the list goes on . . .

Recently I did an installation of a network where they were low in hardware resources but still they wanted to utilize the benefits of Mikrotik Router OS with external Squid proxy server and also the Radius Billing Server . So in total they required at least 3 physical machines, but I managed to install all of them on single server using Virtualization technology of VMWARE ESXi 5.x (64bit) and it worked so great :)
Here is how I did it.

Note: Because of some time shortage, I am just giving you an idea how it can be done, I am not writing in pin point details on how to connect every machine with Virtual/Physical switches. I will write about it soon.

Hardware Used for the Example:

IBM Xseries 3650 XEON Dual Processors with Quad Cores p/p

3.5″ 15krpm SCSI in RAID 10 mode (300GB x 6) (the more Faster drives (like 10-15krpm) you have, the better result you will be able to achieve. Preferably in RAID mode, either 10 or 0, depend on your management and goals, in this example I used 15krpm SCSI HDD’s with dedicated RAID controller. I tested it on IBM xseries with RAID0 and found RAID 0 much more faster with 15krpm but its not redundant, one drive fail and your whole RAID will go down, so if you want redundancy, go with at least RAID 5 or RAID 10 (Recommended) , Raid 1 is also good as it mirrors each drive, but requires additional drives and also for proxy, its useless to use mirroring as it would be requiring more read/write burden on controller, oh GOD, in which argument I got into :p)

16GB RAM (Mikrotik doesn’t requires much RAM in fact it officially supports maximum of 2G, but Radius and Squid do requires some good amount of RAM, I dedicated 8 GB to SQUID, 4GB to Radius, 1 GB to Mikrotik)

4 Network Adapters ( In this article, due-to time shortage, I have only mentioned howto add two network adapters for LAN and WAN link using virtual Switch tech, but you can add more as per your requirements)


Software Used:

1) Vmware ESXi 5.x  64bit as a Virtual Hyper-visor Server

Guest OS installed in this virtual server’s are as following

2) Mikrotik Router-OS 5.22 [1GB Ram +100GB virtual HDD assigned to this VM]
3) Ubuntu 10.4 for SQUID Proxy (2.7) [8GB Ram +500GB virtual HDD assigned to this VM]
4) Ubuntu 10.4 for Radius Manager Billing System [4GB Ram +200GB virtual HDDassigned to this VM]

TIP: You can use the following RAID calculator to evaluate how much space you will be getting various RAID modes.

First install Vmware ESXi. You can get its free edition from http://www.vmware.com  , just register and download the latest version , it would be in .iso format, Simply burn it to CD, and install it on your server , its very simple to install the ESXi, nothing more then just clicking NEXT NEXT :)

After ESXi installed, configure IP address on it, so you can manage it using its client called Vsphere client.

To shorten the story I am using only two interfaces for the mikrotik, LAN and WAN. in this example (shorten version) ESXi have two interfaces connected , one with the LAN user switch and other interface connected with the WAN (physically)

Creating Virtual Switch and bind Network Adapters with this switch.

Goto Configuration tab
From the list appear in Hardware section, click on Networking and click on ADD Networking
As showed in the image below , , ,

add-virtual-switch

2- add network wizard

3- add network wizard

4- add network wizard

5- add network wizard

Ok, our virtual switch is created.
Now its time to bind our WAN adapter in this switch. (So it can later be used for WAN for all hosts we will requiring for)

Click on the Properties
6- add network wizard

7- add network wizard

Done.

Creating Mikrotik in VM and assigning network adapters.

Now create new Virtual Machine for your Mikrotik.

Select necessary hardware that you required as required per user load. for example
Mikrotik = 1 CPU / 1 GB RAM / 10 GB HDD /

In Network Adapter Section, by default only one adapter is added, You have to add another adapter by selecting the number of adapters in drop down listing.
As showed in the image below . . .

8- adding lan wan in host

Once the configuration is completed. Simply install the Mikrotik in newly created hosts you just created in above steps.
After configuration is complete, review once again the host settings,
As showed in the image below . . .

9- Mikrotik Network Adapters
After the installation is done, Connect to mikrotik with WINBOX  and look for interfaces
As showed in the image below . . .

mikrotik-interface

.

I will write more on it later.

Regard’s
Syed Jahanzaib

About these ads

32 Comments »

  1. AoAwbr, My beloved Sir, I am coming to get all of these three VMs. or Can u share as Torrent:p:p:p

    Comment by Shery — December 10, 2012 @ 1:48 PM

    • Its better to build your own :) After all they are not hard to build. Till when you will always want to get the ready made dish :p

      Comment by Syed Jahanzaib / Pinochio~:) — December 10, 2012 @ 1:56 PM

      • And specially your dishes:p

        Comment by Shery — December 10, 2012 @ 2:12 PM

  2. Please we need to cache apple updates and all .ipa

    Sent from my iPhone

    Comment by Dr Antoine Melhem — December 10, 2012 @ 4:04 PM

  3. How to cache apple updates and apps

    Sent from my iPhone

    Comment by Dr Antoine Melhem — December 11, 2012 @ 7:34 PM

  4. Dear sir,
    Can I implemented that config to another ve server, like proxmox ?
    I want your suggest which one is easy to configure (as newbe like me) between veesxi and proxmox ?

    Thx.

    Comment by pesona2d — December 17, 2012 @ 6:27 PM

  5. why not new ubuntu and squid 3?

    Comment by Wiehan — December 22, 2012 @ 3:54 AM

    • yes its always good to use newer stable releases as they provide mroe stability and features.
      Its just this I feel comfortable with Ubuntu 10 more.
      (Ubuntu 12 have some bugs with mysql package)

      Comment by Syed Jahanzaib / Pinochio~:) — January 11, 2013 @ 10:33 AM

  6. dear sir
    i have 1 pc install virtual machine 8 , i already done install mikrotiik , can u help me for installing web proxy n configuration network for proxy , mikrotik , n virtual machine

    Comment by mohamad — December 23, 2012 @ 9:17 PM

  7. Dear Sir, nice work :), very useful, do you found Mikrotik stable on esxi ? I am going to virtualize it on Esxi, i will do some heavy works like pppoe access, shaping and so.. I have don’t understand when creating VM on Esxi if is it better add numbers of Virtual Socket or numbers of core per socket.. What do you think about ? (Esxi host has 1 procerssor with multiples cores).

    Comment by Giulio Primo — January 30, 2013 @ 3:56 PM

  8. sir when r u going 2 complete this article plz

    Comment by Taher Ahmed Ghouri — March 5, 2013 @ 2:40 AM

  9. Sir,

    When installing the mikrotik v6.0rc11 in vmware 5.1, FATAL ERROE: no harddrives found.

    Any advice?

    Thanks,
    Leon

    Comment by Leon — March 11, 2013 @ 12:53 PM

  10. Hi,
    I like your blog alot, I am doing virtualized implementation right now and I was wondering how stable is mikrotik in virtualized environment (if you tested any version).
    I need this for internal VM’s routing because they have multiple vlans. I tried vyatta and it works very good.
    The only reason I want to go with mikrotik is because my customer is familiar working with winbox :P

    Comment by ed — April 8, 2013 @ 7:24 PM

    • I have tried Mikrotik 5.22 on ESXi 5.x 64bit and its working good at various points.
      At some low end server, it was having issue with high cpu usage, but possibly it was due to that that pc was desktop base pc with desktop mother board.

      Comment by Syed Jahanzaib / Pinochio~:) — April 9, 2013 @ 12:53 PM

      • Thanks for your reply
        I’m debating of putting vyatta or mikrotik and I can’t seem to find documentation about mikrotik being able to work in virtual environment.
        I’m willing to pay for a couple of licenses but I dont see who to ask at mikrotik.

        Comment by ed — April 9, 2013 @ 6:30 PM

      • If you describe all of your requirements, maybe I will be able to recommend you about mikrotik. I have no idea for vyatta however.

        The better place to put these sort of questions is forum.mikrotik.com where you can surely get many expert’s opinion worldwide. and the response time is good.

        Comment by Syed Jahanzaib / Pinochio~:) — April 10, 2013 @ 9:30 AM

  11. I need to configure proxy server connected like your schema, only one lan interface, can yoiu tell me how configure main router mikrotik
    (maybe like you explain up) and what config i need for squid server. Thanks in advance. Best regards. Ivan

    Comment by Ivan — May 22, 2013 @ 8:20 PM

  12. Dear sir what will be recommended specs(hardware and software) for virtualized mikrotik for round about 500 to 800 users.Can we do the same above configurations on vmware workstation.I have configured mikrotik on vmware workstation with server 2008 on dell power edge 1950, bu the problems is the mikrotik drops packets or slow down network speed.

    Comment by Nadir — June 11, 2013 @ 9:32 AM

    • You should have two physical CPU’s with multi cores per processors. Try with newer processor series as they provide more FSB and cache.
      Don’t use workstation. Its designed for LAB testing only, not for production environment.

      Go with Vmwares ESXi Server Edition 5.x

      Comment by Syed Jahanzaib / Pinochio~:) — June 11, 2013 @ 9:43 AM

  13. Thanks for reply sir, now every thing working fine except one tiny error when i monitor mikrotik bandwidth usage RX , TX on interfaces it show me 2 to 4 mbps usage but on my wan mrtg graph the bandwidth is totally different even on my squid interface graph it higher than mikrotik.Long story short mikrotik show incorrect bandwidth usage in real time and in graphs.

    Comment by Nadir — June 12, 2013 @ 12:05 PM

  14. And i am using mikrotik 5.18

    Comment by Nadir — June 12, 2013 @ 12:07 PM

  15. One thing i notice the ethernet interface status autonegotiations = incomplete and rate = unknown.

    Comment by Nadir — June 12, 2013 @ 3:30 PM

  16. Hi Syed,

    YOu always amaze me with great tutorials Now I have 15 clients. :) . I want to give them invoice for their service, and provide them good quality of service. ALso Cache, because most of them use youtube . ALso i want to provide them with TV. I read that I can use a PC Card TV tunner to stream channels. I want to stream them 16-20 channels. Please can you provide me support. I can make your time be worth. I want to do it right. and you are excellet on this knowledge.Thank you

    Comment by Alex — July 8, 2013 @ 7:35 AM

    • For 15 users, you cannot install any decent radius billing system, However using mikrotik user manager you can create invoices for prepaid user ids. You have to modify them a bit.
      http://aacable.wordpress.com/2011/09/06/mikrotik-voucher-template/
      to broadcast 16-20 channels , I will recommend you to either go with IPTV project, or just stream few channels, because if you will stream tv channels via tv tunner card, you will be needing one PC per channel, so in order to broadcast 5 tv channel , you will be needing 5 pcs with tv tunner cards in each pc.

      Comment by Syed Jahanzaib / Pinochio~:) — July 9, 2013 @ 8:12 AM

  17. Bhai mere pass 50 total users hian, aur max 150 se 200 user chalana chahta hoon,
    Main Virtualization isi tarah kerna chahta hon, MIKROTIK , squid and Dms Softlab billing aik pc par chalana chahta hoon, tu muje minimum kon sa system chahye??
    aur kia main system main just aik HDD use ker sakta hoon ?? 1TB aur divide ker loun for these 3 OS
    kia WD 1TB 3.5″ SATA HDD 64MB CACHE CAVIAR GREEN theek rahe gi? because its cheap
    One more thing is DMS Softlab free?

    Comment by hammad hassan — September 1, 2013 @ 6:47 PM

    • For virtualization, you should have at least following
      Multi CORE cpu,
      Good amount of Memory,
      its better to use hardware base RAID , like RAID 10 or Raid5, If budget is issue,then use one hdd for one os
      for example if you want to install 2 OS like Raidus and Proxy, then use 2 hdd, one for each OS

      Proxy required high amount of memory to perform good, use at least 8-16 gb for squid.

      DMASOFTLAB Radius Manager is not a free applicaiton. Its costs starts from 100$ to 400$ depend on the license type.

      Comment by Syed Jahanzaib / Pinochio~:) — September 2, 2013 @ 9:27 AM

  18. […] mikrotik with ESXi | Syed Jahanzaib Personnel Blog to Share Knowledge !: Vritualization: 3 in 1 > Using Mikrotik + Squid Proxy + Radius on single machine to save resource…. […]

    Pingback by Some Mikrotik and RouterOS Links to get it running on ESXi for experimental purposes. « The Wiert Corner – irregular stream of stuff — March 28, 2014 @ 1:08 AM

  19. Can you please write on Squid Cache Server ? Which configuration should be select before building on cache server.

    Comment by Detective — April 10, 2014 @ 11:22 AM


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 2,269 other followers

%d bloggers like this: