Wednesday, July 23, 2014

Create DHCP Scopes From Command Line

Sorry everyone, I know it has been a while again. I recently started a new job again and it is back in the education field except it is now at the post-secondary level. Huge difference between the K-12 enviroment I was in before.

Anyway, I have been helping out on a subnetting project implementing a lot of VLANs (almost 50). I was given the task of creating the DHCP scopes for all of these new VLANs on the Windows 2012 R2 server. Sounds fun right? Not really when you think about going through the scope wizard 40+ times but I found a way to do it from the command line.

To get started you have to open up a command prompt and use the netsh command. 

Once you get to the netsh> prompt, type in the following:
dhcp server IP Address/ServerName add scope NetworkAddress SubnetMask  ScopeName ScopeDescription
 The NetworkAddress, SubnetMask, and ScopeName are required. *Side note: You need the quote marks " " if the ScopeName and ScopeDescription have spaces.

Here is an example of a complete command looks like:
dhcp server add scope "Wireless 200" "Wireless VLAN for 200 Building"
Now that the scope is created, we need to add a range of addresses for the server to hand out. That command looks like:
dhcp server IP Address/ServerName scope NetworkAddress add iprange RangeStart RangeEnd
Here is my example:
dhcp server scope add iprange 
Another command that I used was to add the gateway address. To set different options, you will need to know the option number; for my case, the Router option is number 003.

dhcp server scope set optionvalue 003 IPADDRESS

There are a lot of other things that you do like add/delete scopes, super-scopes, etc., just click on the resource link below.


Tuesday, January 28, 2014

Taking A Look At XenServer

Sorry ladies and gents, this post is not a how to, it is about my impressions of XenServer. With that said, on to the post.

For the last couple of weeks, I have gotten a chance to play around with a spare server at work and a copy of XenServer 6. From my experience with it so far, I really like it.

As with anything new, there is a little bit of a learning curve, but if you are familiar with virtual machines and hosts, like me, you shouldn't have a problem.

Now, unlike Hyper-V and vmWare, XenServer is open source and free, you only pay for a support contrat, if you want. I know this seems right because XenServer is owned by Citrix, but I assure you it is free. XenServer was created way back in 2003 and along the way somewhere, Citrix bought up the company.

XenServer is based on Linux, that is free.

Thursday, December 19, 2013

Reset A Forgotten Root Password (CentOS)

I have done something that I thought that I would never have done. I forgot the root password on a CentOS server/workstation.

I don't know if I just had my hands on the wrong keys where I was typing the password or what but I forgot it.

Luckily, there is a way to reset this lost password.

First, you will need console access to the server, meaning, you will need to be physically sitting or standing in front of the server and have physical access to it. SSH remote access will not work.

Next, reboot the server/workstation.

Now, once it is starting to boot backup, you need to interrupt the boot at the GRUB stage (The first count down after you push the power button) by pressing a key like the space bar.

Next, press the "a" key, this will bring you to a command line with a command pre-typed for you. On the line that is there, remove (backspace) the "rhgb quiet" and add a "1" and then press enter.

This will boot into the root shell and NOT a login prompt. This is a single user mode.

From here you can enter the passwd command and reset the password. You can also reset other users passwords and do other administrative tasks.

Once you are done, reboot the server and let it boot normally.

*Note: If you are using CentOS 6 and have SELinux enabled, you will need to do either 1 of 2 things; add "selinux=0" in addition to the "1" from above or issue a "setenforce 0" command after you login and before resetting the password.

Original Source:

How To Setup DRBL (Diskless Remote Boot in Linux) On CentOS 6

I know it has been a while since my last post. Since my last post I have changed jobs from a public K-12 education environment to a private manufacturing environment and this has caused me to refocus my time and efforts on to other things. The job change has also given the time to research and implement some of those back burner projects that I just never had the time for.

One of those back burner projects that I have been wanting to get to for a long time is thin client computing. I have been messing around with the idea of thin clients for almost the last 10 years.

During this time, I understood the big picture of how thin client computing works. A client boots from a CD/DVD/Network/USB/whatever and gets a GUI terminal from the server. The client terminal sends commands to the server, the server processes those commands and sends back an updated GUI screen.

This is a great idea when you have a large number of computers that all need the same software and/or requires little change. Thin clients can save a lot of time. An example I can give is a computer lab of 30+ computers in an elementary or middle school.

Can you imagine the amount of time it would take to install a program like Microsoft Office on 30+ computers? Of course there are faster way to do this but stay with me here for a minute. Lets say that Microsoft Office, from a disc, on 30 computers in a lab. Each install in 20 minutes. Since you only have one disc, you have to do the install one computer at a time. At 20 minutes each, it would take you over 10 hours to complete this. Not my idea of fun.

Now in a thin computing environment, all you would have to do is one 20 minute install and possibly a reboot of the thin client computers.

Alright, enough with me jabbering and on to what you are wanting. The How-To

I chose to go with DRBL because it has been the easiest to setup out of all the other ones that I have seen by far.

My Equipment:
Server (Virtual)
     - Dual processors
     - 1GB memory
     - 10GB hard drive
     - 2 network adapters that function at gigabit speed.
          - NIC #1: IP Address Subnet/netmask: Gateway:
          - NIC #2: IP Address Subnet/netmask: No Gateway

Thin Client (Dell Dimension 4700)
     - I removed the hard drive
     - 512MB memory

  1. Install the server operating system. During the install, make sure you set the IP addresses for your NIC cards. I used CentOS 6 with the GUI. I have explained this before so I am not going to bore you with that.
    *Note: The developer's install instructions suggest that you have at least to network cards installed in the server. You can do this setup with one and create subinterfaces but you might sacrifice performance in the long run when you start to add more clients. 
  2.  Update all the system software with a "yum update -y" and disable SELinux (edit /etc/selinux/config) and reboot.
  3. Turn off and disable NetworkManager. To do this, open a terminal window and type "service NetworkManager stop" to turn off and "chkconfig NetworkManager off" to keep it from starting up when the server is booted. 
  4. Now we need to install some keys for DRBL. In the terminal window, type "rm -f GPG-KEY-DRBL; wget; rpm --import GPG-KEY-DRBL" then type"gpg --keyserver --recv-key D7E8DF3A" and then finally type "gpg -a --export D7E8DF3A > GPG-KEY-DRBL; rpm --import GPG-KEY-DRBL".
  5. Download the DRBL RPM file. You can find the most current stable version here. I downloaded version 2.6.15 (filename: drbl-2.6.15-drbl1.noarch.rpm)
  6. Install the DRBL RPM file. Since the DRBL RPM requires a Perl module, it is easier to use yum instead of rpm because it will automatically download and install the needed modules. Type: "yum install drbl-2.6.15-drbl1.noarch.rpm".
  7. For this next step, there are two scenarios. Since there is a broadband connection, I went with the first one. Type "drblsrv -i" and follow the on screen prompts. *Note: There is a space before the "-i".
  8. Now we are ready to do the setup for the thin clients. Before you run the "drblpush -i" command, I suggest you read this. It provides a lot of information that is useful but is outside of the scope of this post.
  9. If you have not done so already, run the "drblpush -i" command and answer the questions in the guide. I pretty much stuck with the default choices with the exception of Clonezilla. I chose not to use it.
  10. Once "drblpush -i" command has completed, you are ready to prepare the client computers.
         - I disconnected and removed the hard drive from the client machine, you don't have to
         - In BIOS, set the network card to enable PXE and set it as the first boot option.
         - Save and exit.
  11. Boot the client. Log in and enjoy the fruits of your labor.

Original Source:

Wednesday, October 9, 2013

Group Policy - Password Settings Location

I thought that I was pass this along. 

Below is the location in Group Policies that controls password settings.
Computer Configuration > Policies > Windows Setting > Security Settings > Account Policies >Password Policy
The policies you can set here are 
Password Age (both minimum and maximum)
Minimum Length
Require Complexity (Min of six characters, can't contain user's account name or full name, and any 3 of the following:  one capital letter, one lower case letter, a number, and a non-alphabetical character (for example, !, $, #, %))

If you want to change the default change password notification from 14 days, you can find it here:
Computer Configuration > Policies > Windows Setting > Security Settings > Local Policies > Security Options > Interactive logon: Prompt user to change password before expiration
I have changed it from 14 day to 7 days.

Tuesday, October 8, 2013

Compacting Linux Hyper-V VHDs

To compact linux VHDs, run the command below before you shutdown the virtual machine.
cat /dev/zero > zero.dat ; sync ; sleep 1 ; sync ; rm zero.dat
This creates a large empty file full of zeros and then deletes it.

Original Source

Friday, October 4, 2013

Linux Command Line Cheat Sheet

I know that all of these commands are out there on Google, but this is a cheat sheet for me.

Copy files
cp -R Source Destination
Mount NFS volume
mount -t ip_address:/nfs_share /mount_location