How To Configure DHCP Server On A Cisco Router

How To Configure DHCP Server On A Cisco Router

tk-cisco-routers-dhcp-1
First step is to enable the DHCP service on our router, which by default is enabled:

R1# configure terminal

R1(config)# service dhcp

Next step is to create the DHCP pool that defines the network of IP addresses that will be given out to the clients. Note that 'NET-POOL' is the name of the DHCP IP Pool we are creating:

R1(config)# ip dhcp pool NET-POOL

R1(dhcp-config)# network 192.168.1.0 255.255.255.0


This tells the router to issue IP addresses for the network 192.168.1.0, which translates to the range 192.168.1.1 - 192.168.1.254. We will have to exclude the IP addresses we want later on.


We now define the DHCP parameters that will be given to each client. These include the default gateway (default-router), dns servers, domain and lease period (days):

R1(dhcp-config)# default-router 192.168.1.1

R1(dhcp-config)# dns-server 192.168.1.5 195.170.0.1
R1(dhcp-config)# domain-name Firewall.cx
R1(dhcp-config)# lease 9


The 'domain-name' and 'lease' parameters are not essential and can be left out. By default, the lease time for an IP address is one day.


All we need now is to exclude the IP addresses we don't want our DHCP server giving out. Drop back to 'global configuration mode' and enter the following:

R1(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.5

R1(config)# ip dhcp excluded-address 192.168.1.10


This excludes IP addresses 192.168.1.1 - 192.168.1.5 & 192.168.1.10. As you can see, there's an option to exclude a range of IP addresses or a specific address.


The above configuration is all you need to get the DHCP server running for your network. We'll provide a few more commands you can use to troubleshoot and ensure it's working correctly.

The following command will allow you to check which clients have been served by the DHCP:

R1# show ip dhcp binding 

Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
192.168.1.6 0100.1e7a.c409 Jan 19 2009 03:06 PM Automatic
192.168.1.7 0100.1e7a.c3c1 Jan 19 2009 09:00 PM Automatic
192.168.1.8 0100.1ebe.923b Jan 19 2009 02:25 PM Automatic
192.168.1.9 0100.1b53.5ccc Jan 19 2009 02:03 PM Automatic
192.168.1.11 0100.1e7a.261d Jan 19 2009 07:52 PM Automatic
R1#
Notice that IP addresses 192.168.1.5 & 192.168.1.10 have not been assigned to the clients.

Upgrade IOS Image on Cisco

7 Steps to Upgrade IOS Image on Cisco Catalyst Switch or Router

Anytime Cisco releases a new IOS image for its network switch (or router), it is recommended that you upgrade it.
This article explains 7 easy steps to upgrade IOS image on a cisco switch or router.
Since you’ll be upgrading the IOS image, make sure you have physical access to the switch and you are in front of it. Use a console cable to connect to the switch.

Please note that the steps given below will be similar to both switches and routers. However this examples shows how to upgrade ios image on a cisco catalyst switch.

1. Verify Current IOS Version

After you login, go to enable mode, by entering the enable password. This example uses two cisco catalyst 3750 switches configured in stack mode as shown below. So, while upgrading you should upgrade the image on both the flash cards.
# show switch
Switch/Stack Mac Address : 0012.abcd.1234
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
*1       Master 0012.abcd.1234     10     0       Ready
 2       Member 0012.abcd.2345     1      0       Ready
If you have only one cisco catalyst switch (non stack mode), follow all the steps mentioned in this document, but you’ll be doing it only on one flash card.
First, verify the content of the flash cards, using “dir flash1:” command.
# dir flash1:
c3750-ipbasek9-mz.122-35.SE5.bin

# dir flash2:
c3750-ipbasek9-mz.122-35.SE5.bin
As you see above, both the flash cards contains the current IOS image file, which is version “122.35.SE5″
Verify what version of IOS image your switch is currently running. Most likely this will be same as the current IOS image file that you see in your flash card. As you see below, it is using “12.3(35)SE5″
# show ver
Switch Ports Model              SW Version            SW Image
------ ----- -----              ----------            ----------
*    1 24    WS-C3750G-24T      12.2(35)SE5           C3750-IPBASEK9-M
     2 24    WS-C3750G-24T      12.2(35)SE5           C3750-IPBASEK9-M

2. Download Latest IOS Image from Cisco Website

Download the latest IOS image for your cisco website
Go to cisco.com -> IOS Software -> Select your Siwtch (for example: Cisco Catalyst Switch 3750G-24T) -> Click on “Download IP BASE” -> Select the latest version that you want to download (for example: 12-2.55.SE1).
While you are on this download page, copy/paste the MD5 given to your system. After we download the IOS image and move it to the switch, we’ll verify the MD5 checksum before installing the image.

3. Delete Old IOS Software Image from Flash

Since we’ll be downloading the new ISO image and moving it to the flash card, we need some space. So, delete the current old image from the flash card.
# delete /f /r flash1:c3750-ipbase-mz.122.35-35.SE5

# delete /f /r flash2:c3750-ipbase-mz.122-35.SE5

# dir flash1:

# dir flash2:
In the above delete command, /f stands for force, and /r stands for recurssive.
On a side note, you should be using some software to monitor your switch status. If you are not doing it install Nagios, and monitor your switches.

4. Copy the IOS image to Cisco Switch

To transfer the IOS image from your laptop to Cisco Switch, you should run a TFTPserver on your laptop (or on the system where you’ve downloaded the IOS image).
If you are running a TFTPserver on your laptop, and connected to the switch using a console cable, assign a ip-address to your laptop, and put your laptop on the same network as the switch.
Copy the ISO image to the flash as shown below using the “copy command”. This will ask you to enter the address of the remote host (which is your laptop in this case), and the source filename that needs to be transferred (which is the ISO image you downloaded from cisco website).
# copy tftp flash1
>Address or name of remote host? 192.168.1.10
>source filename? c3750-ipbasek9-mz-122-55.SE1.bin
>Destination filename? c3750-ipbasek9-mz-122-55.SE1.bin
Once you’ve copied it, make sure the file is there on the flash card.
# dir flash1:
c3750-ipbasek9-mz-122-55.SE1.bin
Just to make sure nothing went wrong during the copy, do a MD5 check-sum on this, and compare with the MD5 that you noted down from cisco website while downloading the IOS image. To create MD5 checksum of a file in Cisco catalyst switch, use the “verify” command as shown below.
# verify /md5 flash1:c3750-ipbasek9-mz-122-55.SE1.bin
If you are running two switches in stack configuration, do the same on the second flash card.
# copy tftp flash2:
# dir flash2:
# verify /md5 flash2:c3750-ipbasek9-mz-122-55.SE1.bin

5. Modify Switch Boot path-list

Now it is time to tell switch cisco to use the new ISO image to boot from. Before changing the boot information, verify the current configuration, and change it using the “boot system” command as shown below.
# show boot

# config t
# boot system switch all flash:c3750-ipbasek9-mz-122-55.SE1.bin

6. Save Config and Restart the Switch

Verify the current boot information, save the current configuration, and reboot the cisco switch as shown below.
# show boot

# write mem

# reload

7. Final Verification after IOS Upgrade

Finally verify the current IOS version of the switch, after the upgrade, it should display the new version as shown below.
# show ver
Switch Ports Model              SW Version            SW Image
------ ----- -----              ----------            ----------
*    1 24    WS-C3750G-24T      12.2(55)SE1           C3750-IPBASEK9-M
     2 24    WS-C3750G-24T      12.2(55)SE1           C3750-IPBASEK9-M
Make sure to verify your interface and vlan status, to make sure everything is running properly without any issues.

How to Create and Delete VLAN on Cisco Catalyst Switch

How to Create and Delete VLAN on Cisco Catalyst Switch


One of the typical configuration activities you’ll perform on a Cisco Switch is to manipulate VLANs.
VLAN stands for Virtual Local Area Network.
In one physical cisco switch, you can create multiple VLANs that connects to different network.
For example, a VLAN for 10.10.191.0 network, a VLAN for 10.10.192.0 network, and a VLAN for 10.10.193.0 network. All three of these can be configured in the same physical switch.
While these commands were tested on a cisco catalyst switch 3750 series, similar commands (may be with slight variation to the port number format) should work on all cisco switches.

Create VLAN on Cisco Switch

If you are planning to have only one network in your whole switch (for example, 10.10.192.0). i.e All the ports in the switch will be connected to the 10.10.192.0 network, then you don’t need to create a VLAN, just use the default VLAN 1.
Every switch comes with the default VLAN 1 as shown below. In this example, all the ports in this switch ( from 1 through 8 ) are part of the default VLAN 1.
#show vlan

VLAN Name       Status    Ports
---- -------------------------------- --------- ------------
1    default    active    Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4
                          Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8
In the following example, we are creating 192 VLAN network (for 10.10.192.0 network). While creating a VLAN you also need to specify the range of ports from the switch that needs to be part of this VLAN network.
In this example, ports 3 through 6 are configured as part of 192 VLAN network.
config t
vlan 192
interface range gigabitEthernet 1/0/3-6
switchport access vlan 192
exit
In the above commands:
  • config t – Goes into the configuration mode
  • vlan 192 – Creates VLAN 192
  • interface range gigabitEthernet 1/0/3-6 – Indicates that the port numbers 3 through 6 are assigned to this VLAN
  • swithport access vlan 192 – Indicates that the access to the vlan 192 is enabled
Apart from providing the access to the vlan 192 for the port numbers 3 through 6, you can also specify the following additional switchport configuration parameters (for example, nonegotiate and mode access)
config t
interface range gigabitEthernet 1/0/3-6
switchport mode access
switchport nonegotiate
exit
Once you’ve created a VLAN verify it as shown below,
#show vlan

VLAN Name       Status    Ports
---- -------------------------------- --------- ------------
1    default    active    Gi1/0/1, Gi1/0/2, Gi1/0/7, Gi1/0/8
192  VLAN0192   active    Gi1/0/3, Gi1/0/4, Gi1/0/5, Gi1/0/6
On a side note, it is always recommended that you upgrade ISO image on your cisco switch to the latest version.

Delete VLAN on Cisco Switch

You might want to delete a VLAN, if you are planning to switch the ports assigned to VLAN 192 to a different VLAN. Or, you might want to delete a VLAN, just because you’ve created it by mistake.
Let us assume that you want to delete the VLAN 192 (ports 3 though 6) that you just created.
Deleting a VLAN is as simple as assigning the default VLAN 1 to the ports that are part of the VLAN you want to delete, and delete the VLAN.
i.e If you want to delete VLAN 192, assign VLAN 1 to the ports 3 through 6, and just delete the VLAN 192.
First, assign the default VLAN 1 to ports 3 though 6 as shown below.
interface range gigabitEThernet 1/0/3-6
switchport access vlan 1
exit
Next, delete the vlan itself as shown below.
no vlan 192
Finally, verify that the VLAN 192 got deleted as shown below.
#show vlan

VLAN Name       Status    Ports
---- -------------------------------- --------- ------------
1    default    active    Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4
                          Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8

How to Setup User Authentication in FTP 7 on IIS 7.0


How to Setup User Authentication in FTP 7 on IIS 7.0

Configure a DNS Server on Windows Server 2008 R2 to Use OpenDNS


Configure a DNS Server on Windows Server 2008 R2 to Use OpenDNS


If you’re running Active Directory (AD) and want to use OpenDNS, you would think that you just need to update your DHCP server to give out their DNS servers, right?  Wrong!  Clients in an Active Directory need to point to AD DNS servers.  Pointing the clients to third-party DNS can cause problems connecting to AD, Group Policy problems, and a number of other issues.First, make sure that your clients are using AD DNS.  If you only have one Domain Controller (DC), that’s the IP address you want to use.  Next, you’ll need to make a configuration change to your DNS server.
In the Windows Server 2008 R2, click on the Start Menu, Administrative Tools, DNS.
This will open the DNS Manager.  In the DNS Manager, double-click on Forwarders.
You should be taken to the Forwarders tab in the server’s Properties.  Click the Edit… button.
This will open the Edit Forwarders dialog.  Type in the IP addresses for OpenDNS:  208.67.222.222 and 208.67.220.220.
It should look something like this when you’re done.  Click OK to close the dialog box.
After clicking OK, you’ll be taken back to the DNS server’s Properties.  It should look something like the screenshot below.
By default, the Use root hints if no forwarders are available will be checked.  This option is a double-edged sword:  If you leave it checked, your DNS server may consult with the root hints servers to resolve a DNS entry and could bypass OpenDNS.  If you don’t check it, you could have DNS timeouts that could result in DNS timeouts.
So, what option do you choose?  Well, it really depends on how you’re using OpenDNS.  If you’re using OpenDNS as a filter in a situation where the filter always has to work like a school, uncheck the box.  If it is more important that clients always get timely DNS responses, check the box.
When you’re done, click OK.
Now that you’ve updated your Forwarders.  You’ll need to clear the DNS cache.  To do this, right-click on Cached Lookups in the DNS Manager and choose Clear Cache.
You’re done!  If you have more than one Windows Server 2008 R2 DNS server, you’ll need to perform this change on each one.  You’ll also need to run an ipconfig.exe /flushdns on your clients if you want this to start using OpenDNS immediately.  Otherwise, you can wait and they’ll move over on their own as items in the DNS cache expire.