Assign or Configure IP Addresses on Cisco Routers

Every active interface on a Cisco router to be used with IP requires an IP address be assigned to it. This short tech-recipe describes how to set an interface’s IP address.


Given an interface fastethernet1, the IP address 192.168.1.5 with the subnet mask 255.255.255.0 can be assigned to it using the following command from privileged mode:

Router(config)#interface fastethernet1
Router(config-if)#ip address 192.168.1.5 255.255.255.0
Router(config-if)#no shut

The last command is important. It is an abbreviated form of “no shutdown.” The default state of an interface is “shutdown” which makes the interface administratively down. If you plumb up an interface and it does not work, check to make sure it is not administratively down first.

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.

7 Responses to “Assign or Configure IP Addresses on Cisco Routers”

  1. August 27, 2009 at 7:22 pm, sajan said:

    Thank you very much

    Reply

  2. April 20, 2011 at 3:33 am, Iliyya said:

    i add ip for interface 878 and recive the error IP addresses may not be configured on L2 links.

    Reply

  3. November 12, 2011 at 8:33 am, Prem said:

    How to configure ip address for an interface in a switch ?
    I keep getting the same error(I tried to configure the ip address to an interface of a switch with the commands you had mentioned earlier), i have attached the error that configured to me

    Switch(config-if)#ip address 192.168.1.5 255.255.255.0
    ^
    % Invalid input detected at ‘^’ marker.

    Reply

    • October 07, 2012 at 4:24 am, sudeep maity said:

      > u r trying to set ip on switch which is layer 2 device, works on mac address only

      Reply

  4. December 08, 2011 at 3:00 am, Veronica Hearst said:

    Thanks It rally helped me As I m new to using the cisco your post is very helpful for Thanks again.:)

    Reply

  5. April 03, 2012 at 2:54 am, edwin wanyakala said:

    assigning the router with the ip addresses is becoming a big problem.

    Reply

  6. November 14, 2012 at 5:40 pm, Yayo said:

    Thanks a lot

    Reply

Leave a Reply