cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7389
Views
9
Helpful
9
Replies

Catalyst 2960S + DHCP

rwankyoto
Level 1
Level 1

Hi all,

I'm actually not very knowledgeable about switches, but I've tried to find a solution to my problem in the various manuals and have been unsucessful.

I am administering a Catalyst 2960S switch and I would like to connect several computers to it.  Some of those each have a static IP address.  For a few of them, I would like the switch to dynamically assign an IP address to them via DHCP.  Is the switch capable of doing this?  If so, how can I do it?

I tried looking through Cisco Network Assistant and I couldn't find it.  Some web pages have suggested I telnet into the switch and issue commands like "ip dhcp ?" to see what commands are possible.  I can telnet in and if I type  but I get an "Unrecognized command" for both "ip ?" and "ip dhcp ?".  This makes me think I'm reading the wrong web pages.

I'm completely lost.  Any pointers would be appreciated!  I did come across the term "DHCP snooping".  It seems relevant, but very difficult for me to grasp.  Is that what I should be reading?

Thank you!

Ray

1 Accepted Solution

Accepted Solutions

Hi Ray,

Once you get this prompt:

Switch>

than you need to type

enable

it there is password it will ask for it if not you will see  this prompt

Switch#

now you can type config t

Let me know

HTH

View solution in original post

9 Replies 9

Reza Sharifi
Hall of Fame
Hall of Fame

Hi Ray,

Have a look at this post:

https://supportforums.cisco.com/thread/140131

HTH

Hi Reza,

Thank you for the prompt reply!

I've seen replies such as that before during my Google search.  However, I'm not sure how to get to the part where I can enter commands such as "id dhcp ...".

When I telnet into the switch, commands such as that do not work (as I mentioned in my original post).  Do I need to do something before issuing the commands mentioned in the link you posted?

Ray

Hi Ray,

Once you are at the switch via telnet try this:

config t

ip dhcp pool

HTH

Hi Reza,

That doesn't work for me...I still must be doing something wrong.  This is what I get:

-----

Connected to XXX.XXX.XXX.XXX.

Escape character is '^]'.

User Access Verification

Password:

Switch>config t

          ^

% Invalid input detected at '^' marker.

Switch>ip dhcp pool

       ^

% Invalid input detected at '^' marker.

Switch>?

Exec commands:

  <1-99>           Session number to resume

  access-enable    Create a temporary Access-List entry

  clear            Reset functions

  connect          Open a terminal connection

  crypto           Encryption related commands.

  disable          Turn off privileged commands

  disconnect       Disconnect an existing network connection

  enable           Turn on privileged commands

  exit             Exit from the EXEC

  help             Description of the interactive help system

  lock             Lock the terminal

  login            Log in as a particular user

  logout           Exit from the EXEC

  name-connection  Name an existing network connection

  ping             Send echo messages

  rcommand         Run command on remote switch

  release          Release a resource

  renew            Renew a resource

  resume           Resume an active network connection

  set              Set system parameter (not config)

  show             Show running system information

...

-----

Am I in the right menu?  Is the ability to change configurations via telnet turned off and I have to turn it on somehow?  I'm telneting in remotely to its IP address.  Should I be connecting a cable directly to it and trying that instead?

Thank you for your help!

Ray

Hi Ray,

Once you get this prompt:

Switch>

than you need to type

enable

it there is password it will ask for it if not you will see  this prompt

Switch#

now you can type config t

Let me know

HTH

Hi Reza,

Ah!  That worked!  Thank you for literally hand-holding me...  I kept thinking I need to telnet in differently (i.e., via a cable while sitting next to it).

I'm going to configure the DHCP later when I am physically next to the switch so that I can reset it if I make a mistake.  I will let you know if I am stuck.

But I have one quick question.  In the menus, I can use "?" to find out what a command does.  i.e, "configure ?"  Is there a PDF document on Cisco's web site that explains each command.  For example, the discussion you first showed me said I should type these commands:

ip dhcp pool test

network 192.168.50.0 255.255.255.0

domain-name cisco.com

default-router 192.168.50.1

dns-server 192.168.50.2

lease 4

Is there somewhere that explains to me what the above means.  (I *guess* it means to set up a DHCP pool for 192.168.50.0/24 with the cisco.com domain, etc.)  But is there something I can look at that explains the commands better?  Or a term to Google for that is the name for this configuration method/"program"?

Thank you for your help (and prompt replies!)!  I've been stuck on this for days...

Ray

Hi Ray,

Glad to help

The best place for this type info is the configuration guide.  It will go step-by-step and explain each command.

Also, as you have already found out, ? in Cisco IOS is your friend.  If you are not sure just type ? and the IOS will give all the keyword that could added next for example after you type config t type ip dhsp and than a ? you will see the rest of the options

here is an example

Switch# config t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#ip dhc

Switch(config)#ip dhcp ?

  aaa                        Configure aaa attributes

  binding                    DHCP address bindings

  bootp                      BOOTP specific configuration

  class                      Configure DHCP classes

  conflict                   DHCP address conflict parameters

  database                   Configure DHCP database agents

  excluded-address           Prevent DHCP from assigning certain addresses

  limit                      Limit DHCP Lease

  limited-broadcast-address  Use all 1's broadcast address

  ping                       Specify ping parameters used by DHCP

  pool                       Configure DHCP address pools

  relay                      DHCP relay agent parameters

  route                      Specify the type of routes for clients on

                             unnumbered interfaces

  smart-relay                Enable Smart Relay feature

  snooping                   DHCP Snooping

  subscriber-id              Global subscriber-id configuration

  use                        Configure use of certain parameters during

                             allocation

Switch(config)#ip dhcp

http://www.cisco.com/en/US/docs/switches/lan/catalyst2960/software/release/12.2_55_se/configuration/guide/swdhcp82.html#wp1320930

Also, for what you are trying to do you don't need to be sitting close to the router or switch you can easily configure it using telnet. You also don't need to reboot the switch after configuring the DHCP pool.  Just follow the example in the link I provided and you should be fine.

HTH

Reza

Hi Reza,

Thank you for your help and sorry for not getting back to you.  I was pre-occupied with something else the last few days.

However, I got back to it and was unsuccessful.  I noticed the original link that you sent to me was from a 2006 posting.  Could the instructions be out-of-date?

These are the commands I issued:

(config)# service dhcp

(dhcp-config)# ip dhcp pool test

(dhcp-config)# network ...

(dhcp-config)# lease ...

(dhcp-config)# address 192.168.50.1 hardware-address ...

(dhcp-config)# ^Z

Doing "show ip dhcp binding" tells me that the pool seems to have been set up correctly.  (The "type" is set to "Manual"; I'm not sure if that's the problem.)

Neither "ip dhcp snooping" nor "interface vlan 1" seem to work, so I've done nothing with that.  And I don't know what the "default router" should be.

On this switch, a few ports are static addresses; on another set, I would like DHCP to assign addresses to them.  I made them into separate VLANs.  But I tried them all on one VLAN or on two separate VLANs and neither worked.

I also found the "IOS IP Addressing Services Command Reference" which explains the commands, but doesn't tell me what I could be missing.  I feel like I'm one command away from getting it working; I just can't tell which command is it.  :-)

Thank you for your help!

Ray

Also, navigate the command reference guide for the 2960 series switches.  It has all the commands you need with definitions

http://www.cisco.com/en/US/docs/switches/lan/catalyst2960/software/release/12.2_55_se/command/reference/2960_cr.html

HTH

Reza

Review Cisco Networking for a $25 gift card