Active Directory Home Lab
In this lab, I'll be utilizing Oracle VirtualBox to
run an active directory. I'm undertaking this lab to learn more about Windows
networking and how Active Directory functions.
Installing VirtualBox will be the first step in getting the virtual machines up and running. I'll next install Windows 10 and Windows Server 2019 isos, which I'll use to set up two different virtual machines with two different operating systems. The domain controller, which will host the active directory, will be the first virtual machine. I'm going to give this virtual machine two network adapters, one for connecting to the public internet and the other for connecting to VirtualBox, which will act as a sort of virtual private network for the clients
After creating the virtual machine, I'll install Server 2019 on it and then assign it an IP address for the internal network. The external network will automatically obtain IP addresses from the home network.
I can tell if the adapter is internal or external since
the former will have the correct IP address, whilst the latter will try to find
a DHCP server but, failing to do so, will have an address automatically issued
to it. The internal adapter will resemble the image below in appearance.
In the following image, I configured the IP address,
which I obtained from an internet source. There is no default gateway because
the Domain Controller will function as the default gateway. Since this server
will use itself as the DNS server after Active Directory is implemented, I just
used the same IP address I originally gave it.
Next, I use the server manager to install Active Directory.
After installing Active Directory, it must be configured. This is done by clicking on the notification in the upper right corner, then adding a new forest with the root domain name "myDomain.com" and then setting up the passwords and pressing next till the install page, then it automatically restarted.
Now that I needed to create a user, I went to Active Directory Users and Computers and created an organizational unit to which I would add a user.
I then created a user with my name and a basic password within the organizational unit. But because I needed it to be an admin user, I had to go to the user's properties and add it as a Domain admin before I could log in as the newly formed account.
Now I will install RAS/NAT, The purpose of this is
that it will allow the windows 10 client that I will later create to be on a
kind of virtual private network but there will still be access to the internet
through the domain controller. To do this I had to go to the server manager,
the add roles and features section, and then just follow the steps to install
the remote access role and the routing feature. Once everything is installed go
to tools in the top right corner of the screen and go to the routing and remote
access section to allow internal clients to connect to the internet using one
address. It is important to choose the external one which is connected to the
internet.
The next thing I need to do is set up the DHCP server, which will enable the Windows 10 client to obtain an IP address that will enable it to browse the internet even when it is connected to a private network like an office or a school. I went to the server management, returned to the add roles and features section, and installed the DHCP server feature to set up DHCP.
Once the installation process is finished then I went
to tools and to the DHCP section to set up the scope. This is to let the DCHP
server know the scope of the addresses it can distribute, in this case, it is
172.16.0.100-200 with a mask of /24 and a subnet mask of 255.255.255.0 which
would make it a class C network with a CIDR notation of /24 with no exclusions
as we want all IP addresses in that range.
The lease duration specifies how long a specific computer will be able to use an IP address. Depending on the business using the DHCP server, the lease duration should be set to a longer amount of time if users tend to stay put for a long time, whereas a shorter lease period should be used if clients tend to leave quickly. In this case, it wouldn't really matter because this is a home lab, so I set it for 8 days.
As previously mentioned the domain controller will
forward traffic from the client to the internet so because of this I’m going to
use the internal NIC of the domain controller as the default gateway.
Now I need to create the users, for this, I will use a
PowerShell script which will assist with this task, it will create 1000 users.
The following image is a picture of some of the users created.
I ping-tested it with Google to make sure it was functioning properly, and it was. It is clear that everything was operating properly because google.com resolved and I was able to ping the internet.
I then changed the computer's name to CLIENT1, joined the domain, and checked the DHCP server to make sure the computer had joined the right domain. I then went to the lease area and verified that the CLIENT1 computer was connected properly.
In order to finalize the lab, I went into the CLIENT1
pc and logged in with another user account which was previously added to the
active directory with the PowerShell script. I was able to sign in with an
account under my name. This wasn’t the first account I created as that one was
an admin account, this one was newly created by the script emulating a new
person joining a company and being added into the active directory.
Comments
Post a Comment