How to Configure DHCP on Cisco 851 or 871 Router
DHCP stands for Dynamic Host Configuration Protocol. Basically it’s a mechanism which assigns IP addresses to computers dynamically. Usually DHCP is a service running on a server machine in the network in order to assign dynamic IP addresses to hosts. All Cisco 800 series models have the ability to work as DHCP servers, thus assigning addresses to the internal LAN hosts. Without a DHCP server in the network, you would have to assign IP addresses manually to each host. These manually assigned addresses are also called “static IP addresses”.
In this post I will show you how to configure a Cisco 851 or 871 router to work as DHCP server. The same configuration applies for other 800 series models as well.
Router> enable
Router# config t
! define an IP address pool name and range
Router(config)# ip dhcp pool LANPOOL
Router(config)# ip dhcp pool LANPOOL
! define a network range for the addresses that will be assigned
Router(dhcp-config)# network 192.168.1.0 255.255.255.0
Router(dhcp-config)# network 192.168.1.0 255.255.255.0
! define a dns name to assign to clients
Router(dhcp-config)# domain-name mycompany.com
Router(dhcp-config)# domain-name mycompany.com
! define a default gateway for the clients
Router(dhcp-config)# default-router 192.168.1.1
Router(dhcp-config)# default-router 192.168.1.1
! define the dns server for the clients
Router(dhcp-config)# dns-server 100.100.100.1
Router(dhcp-config)# dns-server 100.100.100.1
! define a WINS server if you have one
Router(dhcp-config)# netbios-name-server 192.168.1.2
Router(dhcp-config)# exit
Router(dhcp-config)# netbios-name-server 192.168.1.2
Router(dhcp-config)# exit
!The following addresses will not be given out to clients
Router(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.10
Router(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.10
Monday 29 June 2009 @ 6:01 am
Cisco manufactures routers for all markets, ranging from SOHO up to large service provider models. The Cisco Router 800 series belongs to the lowest SOHO end. The most popular models in the 800 series are the 850 and 870 broadband access models which come with different types of WAN broadband interfaces (the difference between 850 and 870 is that the 870 models have higher throughput, support 10 VPN tunnels instead of 5 and also support VLANs with the proper IOS version). The 851 and 871 are equipped with a 10/100 Ethernet WAN interface which means that your ISP should provide you with a broadband modem offering an Ethernet connection towards the customer.
I’m getting a lot of questions about the interfaces of 851/871 routers and how they are arranged. I hope this post will clarify some things. The figure below shows the back panel of Cisco Router 851/871.
Ports FE0 up to FE3 under the LAN group can be used to connect internal computers or maybe to an internal switch to expand the number of internal ports (see points 1,2 in the figure above). These ports are actually Layer 2 switch ports, and not regular Layer 3 router ports. They are assigned by default to VLAN 1. You can create more VLANs and assign each port to a different VLAN (870 series), thus creating extra segmentation for your internal LAN. You can not configure IP addresses directly on the interface ports. The IP address must be configured on the Interface VLAN 1 (we will see example below).
Port FE4 is the WAN interface which must be connected to the ISP DSL broadband modem (see point 3 in the figure above). This port is a normal Layer 3 router port, which means you can configure IP address directly on the interface port.
Default Configuration for 851 – 871 Router
The Cisco 851 and 871 routers come with some preconfigured parameters (IP addresses etc) which might be in conflict with your current network topology. What I suggest is to erase the factory’s default startup configuration before you begin configuring your router for the first time. This allows you to start with a clean state and configure the router with all the features you need and leave off any that you don’t want. Connect with a console cable and after you get a command prompt execute the following:
Router> enable
Router# erase start
Router# erase start
After you confirm the command, all the default configuration will be deleted. Power off the router device and then power on again. You will get a prompt as below:
Would you like to enter the initial configuration dialog [yes/no]
Type no and press Enter. This will give you a command prompt (Router>) and you are ready to configure your router from scratch.
Type show run to see the current configuration which looks like the following:
(some output omitted)
interface FastEthernet0
no ip address
shutdown
!
interface FastEthernet1
no ip address
shutdown
!
interface FastEthernet2
no ip address
shutdown
!
interface FastEthernet3
no ip address
shutdown
!
interface FastEthernet4
no ip address
duplex auto
speed auto
no ip address
shutdown
!
interface FastEthernet1
no ip address
shutdown
!
interface FastEthernet2
no ip address
shutdown
!
interface FastEthernet3
no ip address
shutdown
!
interface FastEthernet4
no ip address
duplex auto
speed auto
interface Vlan1
no ip address
no ip address
Initial Interface Configuration
From the above output you can see that FE0 up to FE3 are shutdown and also there are no IP addresses configured to any ports. You need first to enable FE0 to FE4 and then configure IP address under the “interface Vlan 1” and also under the “interface FastEthernet4” port. Notice that you CAN NOT configure IP addresses under the “interface FastEthernet0″ up to “interface FastEthernet3″ ports. Those ports are Layer 2 switch ports and will inherit the IP address you assign under “interface Vlan1″.
Example:
Assume that the internal LAN has IP network range 192.168.10.0/24. Also, our ISP has assigned us a static public IP address of 200.200.200.1 . Let’s see the interface configuration below:
Router(config)# interface fastethernet 0
Router(config-int)# no shutdown
Router(config-int)# exit
Router(config-int)# no shutdown
Router(config-int)# exit
Router(config)# interface fastethernet 1
Router(config-int)# no shutdown
Router(config-int)# exit
Router(config-int)# no shutdown
Router(config-int)# exit
Router(config)# interface fastethernet 2
Router(config-int)# no shutdown
Router(config-int)# exit
Router(config-int)# no shutdown
Router(config-int)# exit
Router(config)# interface fastethernet 3
Router(config-int)# no shutdown
Router(config-int)# exit
Router(config-int)# no shutdown
Router(config-int)# exit
Router(config)# interface fastethernet 4
Router(config-int)# no shutdown
Router(config-int)# ip address 200.200.200.1 255.255.255.252
Router(config-int)# exit
Router(config-int)# no shutdown
Router(config-int)# ip address 200.200.200.1 255.255.255.252
Router(config-int)# exit
Router(config)# interface vlan1
Router(config-int)# no shutdown
Router(config-int)# ip address 192.168.10.1 255.255.255.0
Router(config-int)# exit
Router(config-int)# no shutdown
Router(config-int)# ip address 192.168.10.1 255.255.255.0
Router(config-int)# exit
Notice that we configured IP addresses only to fastethernet 4 and vlan1. By default, interfaces fastethernet 0 to 3 are assigned to VLAN1 so anything you connect to those interfaces (internal LAN hosts) will belong to vlan1 network range 192.168.10.0/24 and they must have as default gateway the address 192.168.10.1.
No comments:
Post a Comment