- Trending Now
- Data Structures
- Foundational Courses
- Data Science
- Practice Problem
- Machine Learning
- Web Development
- Web Browser

- Explore Our Geeks Community
- How to Find Your Default Gateway IP Address?
- How to Configure IPv6 on CISCO Router?
- IPv6 EUI-64 (Extended Unique Identifier)
- Link Local Address
- What is IPv6 Stateless Address Autoconfiguration ?
- Global Unicast Address in CCNA
- Setting IP Address Using ipconfig Command
- Configuring RIP Versions 1 and 2 in Cisco
- Configuring a Loopback Interface in Cisco
- Setting IP Address Using GUI
- Difference Between Source Port and Destination Port
- Configure IP Address for Interface in Cisco Switches
- What is Broadcast Domain ?
- Email Protocols
- What is Hyperconvergence?
- What is a Bubble Memory ?
- Access Point vs Range Extender
- What is an Endpoint in Security?
- OSPF Implementation

Configure IP Address For an Interface in Cisco
The interface is the port at which the router connects to a given network. It acts as an entry or exit point for data that is to be transmitted through the router. Every interface must be labeled or assigned an IP address, which should be unique among all the IP addresses in the network.
In Cisco Packet Tracer, to understand the process of assigning IP addresses , we will be using routers. This is because a router has many interfaces to connect to different networks and also after configuring a router by any routing protocol( RIP , static routing , etc.), we can observe how an interface and an IP address work in a router.
Steps to configure an IP address for an interface of a router in Cisco Packet Tracer:
Step 1: Open Cisco Packet Tracer and select the following devices:
IPv4 Addressing Table:
- Create the following topology and label the configuration as shown in the figure:

- Also, assign the respective IP addresses and default gateways to all 4 PCs.
Step 2: In Cisco Packet Tracer, assigning IP addresses to an interface of a router can either be done through the command line or the GUI mode. Both of them are discussed as follows:
Through command line mode:
- Firstly, enter the command line by clicking on any router and then selecting the CLI tab.
- Enter config mode by typing the following commands in the command line:
- Now we can assign IP addresses to their respective interfaces. To do this, firstly we need to enter into the interface we want to assign the IP address. This is done by typing the keyword interface followed by the label of the interface.
Interface [label of the interface]:
For example:
- After entering the interface, type the command IP address followed by the IP address you want to assign and also followed by the subnet mask of the IP address assigned.
IP address [IP address to be assigned] [subnet mask of the IP address]
- After assigning the IP address type, the command no shutdown to activate the port. Initially, all the ports of the router are switched off, so we need to manually activate them. You would also note that the color of the triangles representing the ports of the router changes to green and also start pointing upward.
- At last, exit the interface by typing the following command:
- Repeat the above steps for all the interfaces of the router, and then for all interfaces of other routers as well.
Following is the image of the command line of the router after configuring all interfaces:

For a better understanding of the process, you may refer to the following simulation:
Through GUI mode:
- Click on any router and select the Config tab from the above tabs.
- Now find the interface to which you want to assign the IP address, from the tabs available on the left side of the window.

- After selecting the interface, fill in the IP address and the subnet mask in the fields named IPv4 Address and Subnet Mask .

- Activate the port by checking the checkbox labeled as On for the Port Status option.

The interface of the router has been assigned an IP address.
Simulation Result:
Please Login to comment...

- CCNA IP Addressing
Please write us at contrib[email protected] to report any issue with the above content
Improve your Coding Skills with Practice
Cisco Video Portal

Cisco Tech Talk: Configure IP Address Settings on a Switch via CLI
- Share on Facebook
- Tweet this video
- Share on LinkedIn
- Share via Email
In this edition of Cisco Tech Talk, I’ll demonstrate how to add and change the IP address per VLAN and switch port interface on CBS250 and CBS350 series switches using the Command Line Interface (CLI).
Share this video
- CCNA online course
- Linux online course
- VMware ESXi online course
- Nmap online course
- MySQL online course
- Raspberry Pi online course
- Apache HTTP Server course
- VMware Player online course
- Splunk online course
- SQL online course
- Oracle VirtualBox online course
- Python online course
- Asterisk course
- VMware Workstation Player course
- Process Explorer course
- Pillow online course
- Create a web crawler in Python
- A short introduction to…

- Assign the switch IP address
By default, Cisco switches perform Ethernet frames forwarding without any configuration. This means that you can buy a Cisco switch, plug in the right cables to connect various devices to the switch, power it on, and the switch should work. However, to perform switch managent over the network or use protocols such as SNMP, your switch will need to have an IP address.
The IP address is configured under a logical interface, known as the management domain or VLAN . Usually, the default VLAN 1 acts like the switch’s own NIC for connecting into a LAN to send IP packets. Here are the steps to configure an IP address under VLAN 1:
- enter the VLAN 1 configuration mode with the interface vlan 1 global configuration command.
- assign an IP address with the ip address IP_ADDRESS SUBNET_MASK interface subcommand.
- enable the VLAN 1 interface with the no shutdown interface subcommand.
- (Optional) use the ip default-gateway IP_ADDRESS global configuration command to configure the default gateway.
- (Optional) Add the ip name-server IP_ADDRESS global configuration command to configure the DNS server.
Here is a simple example:

We have a simple network of a single host and a switch. We can assign the switch with an IP address to enable IP communication between the two devices:

To verify the IP address set on a switch, we can use the show int vlan 1 command:

We can now ping SW1 from Host A:

- Port security feature
- Assign static MAC address

CCNA course
- Introduction
- Computer network explained
- OSI reference model
- TCP/IP reference model
- Data encapsulation
- Data encapsulation in the OSI model
- Local Area Network (LAN)
- What is Ethernet?
- Ethernet frame
- MAC address
- Unicast, multicast, broadcast addresses
- Half and full duplex
- Basic networking
- What is a network hub?
- What is a network bridge?
- What is a network switch?
- Differences between a switch and a bridge
- What is a router?
- Collision domain explained
- Broadcast domain explained
- CSMA/CD explained
- IEEE Ethernet standards
- Cisco three-layered hierarchical model
- TCP/IP suite of protocols
- What is an IP address?
- Private IP addresses
- IP address classes
- IP address types
- Transmission Control Protocol (TCP) explained
- User Datagram Protocol (UDP) explained
- TCP and UDP ports
- Network protocols
- Telnet protocol
- Secure Shell (SSH) protocol
- File Transfer Protocol (FTP)
- Trivial File Transfer Protocol (TFTP)
- Simple Network Management Protocol (SNMP)
- Hypertext Transfer Protocol (HTTP)
- Hypertext Transfer Protocol Secure (HTTPS)
- Network Time Protocol (NTP)
- Domain Name Service (DNS)
- Dynamic Host Configuration Protocol (DHCP)
- Automatic Private IP Addressing (APIPA)
- Internet Control Message Protocol (ICMP)
- Address Resolution Protocol (ARP)
- IPv4 header
- What is subnetting?
- Subnet mask explained
- How to create subnets
- Cisco Internetwork Operating System (IOS)
- Power on IOS device
- Command modes in IOS
- Get help in IOS
- Display IOS command history
- IOS commands
- Configure the hostname in IOS
- Configure banners in IOS
- Configure passwords in IOS
- service password-encryption command
- Configure descriptions in IOS
- Run privileged commands in global config mode
- Interfaces on an IOS device
- Configure an IP address for an interface
- Pipe function in IOS
- Memory on a Cisco device
- Configuration files on an IOS device
- IOS show command
- Boot sequence of a Cisco device
- Back up IOS configuration
- Configure DHCP server on a Cisco router
- Configure NTP on a Cisco device
- Use Cisco Discovery Protocol (CDP)
- Mapping hostnames to IP addresses
- Configure DNS on a Cisco device
- Use extended ping
- traceroute command in IOS
- debug command in IOS
- Show running processes
- IP routing explained
- Routing table explained
- Directly connected routes
- Static routes
- Dynamic routes
- Types of routing protocols
- Administrative distance (AD) explained
- Routing metric explained
- RIP (Routing Information Protocol) overview
- RIP configuration
- Split horizon explained
- Route poisoning explained
- Holddown timer explained
- EIGRP overview
- EIGRP neighbors
- EIGRP tables
- Reported and feasible distance explained
- Successor and feasible successor explained
- EIGRP configuration
- Wildcard mask explained
- EIGRP and wildcard masks
- Reliable Transport Protocol (RTP)
- Diffusing Update Algorithm (DUAL)
- EIGRP auto-summary
- EIGRP manual summarization
- OSPF overview
- OSPF neighbor discovery
- OSPF neighbor states
- OSPF areas explained
- Link-state advertisement (LSA)
- Types of LSAs (Link-state advertisements)
- Configure OSPF
- Configure multiarea OSPF
- Designated router and backup designated router
- OSPF clear text authentication
- OSPF MD5 authentication
- OSPF route summarization
- Layer 2 switching
- How switches learn MAC addresses
- How switches forward frames
- VLANs explained
- Access and trunk ports explained
- Frame tagging explained
- Inter-Switch Link (ISL) overview
- 802.1q overview
- Configure VLANs
- Configure trunk ports
- Configure allowed VLANs on trunk
- Routing between VLANs
- Configure router on a stick
- VLAN Trunking Protocol (VTP)
- VLAN Trunking Protocol (VTP) overview
- VTP modes explained
- Configure VTP
- Access Control Lists (ACLs)
- What is ACL (Access Control List)?
- Standard ACLs
- Extended ACLs
- Network Address Translation (NAT)
- NAT definition
- Static NAT configuration
- Dynamic NAT
- PAT configuration
- IPv6 overview
- IPv6 address format
- IPv6 address types
- IPv6 global unicast address
- IPv6 unique local address
- IPv6 link-local addresses
- IPv6 EUI-64 calculation
- Configure IPv6 on a Cisco router
The Cisco Learning Network

hkshirsagar asked a question.
can nebdy tell d the commands to assign static IP on a switch
guess we do use Mac address here
a request plzz create a video on this
or if its already created
share the link
- Enterprise Certifications Community

As you may know there are layer 2 and layer 3 switches. A layer 2 switch only does layer 2 fowarding, as such it doesn't have any additional ip interfaces. On a layer 2 switch the ip address is instead assigned to the vlan interface:
interface vlan 1
ip address 192.168.1.1 255.255.255.0
* Note on a L2 switch you can assign an ip to any vlan you want (vlan 1, vlan 2, vlan 4000). You can only assign an ip address to one vlan at a time on a l2 switch. If you configured an ip on a vlan and then try to assign an ip to another vlan...the switch will shut down the first vlan and bring up the second vlan interface)*
On a L3 switch you can have multiple ip interfances. Unlike a L2 switch, an L3 switch can have static ip addresses on multiple vlan interfaces (configuration is the same as the above example). In addtion unlike L2 swithes a L3 switch can have a static ip address assigned to any one of its fastethernet (fa0/1) or gig ethernet ports (gi0/1).
description *** Assigning an ip address to a physical fast ethernet port on the switch***
ip address 192.168.2.1 255.255.255.0
description *** Assigning an ip address to the virtual (vlan) interface on the switch ***
ip address 192.168.3.1 255.255.255.0
description *** Assigning an ip address to another virtual (vlan) interface on the switch ***
Note that although you can assign multiple ip addresses on a L3 switche's physical (e.g. fa0/1 fa0/2 gi0/1) or virtual (vlan 1, vlan 3, vlan 3000, or a loopback lo1, lo2,lo3), all of the ip address must be in different networks. If subnetting is used, the interfaces belonging to the same switch must have a different subnet mask.
ip address 192.168.1.1 255.255.255.252
description *** This interface is on the 192.168.1.0/30 network ***
ip address 192.168.1.5 255.255.255.252
description *** This interface is on the 192.168.1.4/30 network***
ip address 192.168.9 255.255.255.252
description *** This interface is on the 192.168.1.8/30 network ***
Basically, to assign a static IP address, use 'ip address', you can do this for a VLAN in a L2 or L3 switches. In MLS, you can convert a port to L3 port using 'no switchport' then configure an IP address on that physical port.
On the other hand, if you are talking about static route, you can only configure it on L3 switches as L2 switches can't route.
Ahhhh Angela,
Thanks for pointing that out....before you can assign an ip to a port, you must disable switching on the port with the "no switchport" sub interface command.
Thanks again, it was an oversight on my part.
You are very welcome, I also have many times when others pointed out something I did think of. It's great to study with everybody, happy learner

jawad.hussain
Hello Josph
Will you please right syntax how to run command " no switch port" as i tried but not success..

Yeah you may want to say SVI or VLAN interface for the newer people even though we know what you are talking about, Angela
Angela wrote:
See this link
http://www.technicafe.net/2012/08/how-to-configure-static-ip-on-layer-3.html

if you want to create an IP address for management then just simply use a SVI:
yeah well if he wanna create a management VLAN then its the way,,
His question was doubtfull so i gave him the way to create routed port on Layer 3
yes indeed the question was ambiguous .
For assigning Static ip to a Switch,
Assign IP to VLAN 1 by command
Switch>enable
Switch#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config) #interfac
Switch(config) #interface vlan 1
Switch(config-if) #ip address 192.168.1.1 255.255.255.0
Switch(config-if) #no shut
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
Switch(config-if)#^Z
%SYS-5-CONFIG_I: Configured from console by console

isaacalves27
Hello Rishi
I just would like to add my to cents..
Using vlan 1 is never a good idea. Just create a vlan for managemnt of your network devices - specially if you are talking about a production network.
Best regards

mariusstanase
There are two ways to configuring a switch with an IP address, and this is done only under the interface configuration:
Assign a static IP with: ip address ip_address network_mask
Dynamically obtain IP from DHCP service: ip address dhcp
Let's clarify on which interface type can we apply the IP configuration.
As you read the previously replies, there are two types of switches: ones that have only Layer 2 capabilities - forwarding frames, or others that have both, the L2 and L3 - switching frames and packets.
Note: That the process of "routing" on a multilayer switch is called packet switching as it is performed on hardware - different from what a software router does.
Differences between a switch port and an interface:
- a switch port has no intelligence and only perform L2 capability by forwarding frames based on physical MAC addresses. A switch port is like a bridge - forwarding from one layer to the same layer, so as a result you cannot assign an virtual IP to a switch port - it has only a physical MAC address;
- in exchange, an interface, has its own intelligence where encapsulate frames from L2 to upper layer into packets. So because an interface is a multilayer capable it must have a physical MAC address and could also have a virtual L3 address as an IP.
So, because a L2 switch cannot have an virtual IP address on none of its switch ports, Cisco introduce the concept of SVI (Switch Virtual Interface), where you can create them and have an IPs assigned to them. The SVI represent the switch ports on the belonging VLAN and where it acts as a default gateway for the VLAN, performing in this way a L3 capabilities.
Configuring a static IP on a L2 switch capability:
SW(config) #interface vlan1
SW(config-if) #ip address ip_address network_mask
Note: To have the SVI become in up state, you must have at least one switch ports that belongs to the same VLAN group where the SVI point, to be up also.
Now, on a L3 switch you can configure the IP address in both cases:
- you can also create a SVI and assign an address to it, same as the L2 switch;
- or you can directly assign the IP address to the interface:
But, there is a small "trick" here. Remember that a L3 switch can have a switch port or an interface.
How to turn a switch port into an interface and vice-versa on a L3 switch?
By using the commands "switchport" or "no switchport"
SW(config) #interface f0/1
SW(config-if) #no switchport
Switch models restrictions:
- on some L2 switch models you cannot create more then one SVI;
- on some L3 switch models not all interfaces has L2 capabilities. Is were the "switchport" command is not allowed.
Also you cannot turn a router interface into a switchport unless you have a L2\L3 module.
Sorry, have to correct:
- on L2 switch models you cannot create more then one SVI and usually this is configured for the management VLAN;
Related Questions
Trending articles.
- Cisco Packet Tracer: Software de Simulación para Redes
- 200-301 CCNA Study Materials
- CCIE/CCDE: Book your Lab/Practical Exam
- Basic cisco commands book.pdf
- Packet Tracer Labs
If you encounter a technical issue on the site, please open a support case .
Communities: Chinese | Japanese | Korean
Cisco.com © Copyright 2023 Cisco, Inc. All Rights Reserved. Privacy Statement Terms & Conditions Cookie Policy Trademarks

- Create Post
- Create Chapter Note
- Create Note for Selection
- View All Notes
- Show All Notes on Page
- Hide All Notes on Page
- Print with Notes
- Share on Facebook
- Share on Twitter
- Email a Link
- Copy Link to Clipboard
- Cisco Catalyst 3560-E Series Switches
Published On: August 6ᵗʰ, 2019 02:02
Catalyst 3750-E and 3560-E Switch Software Configuration Guide, 12.2(35)SE2
Assigning the switch ip address and default gateway.
This chapter describes how to create the initial switch configuration (for example, assigning the IP address and default gateway information) by using a variety of automatic and manual methods. It also describes how to modify the switch startup configuration. Unless otherwise noted, the term switch refers to a Catalyst 3750-E or 3560-E standalone switch and to a Catalyst 3750-E switch stack.
This chapter consists of these sections:
Understanding the Boot Process
To start your switch, you need to follow the procedures in the hardware installation guide for installing and powering on the switch and setting up the initial switch configuration (IP address, subnet mask, default gateway, secret and Telnet passwords, and so forth).
The normal boot process involves the operation of the boot loader software, which performs these activities:
The boot loader provides access to the flash file system before the operating system is loaded. Normally, the boot loader is used only to load, uncompress, and start the operating system. After the boot loader gives the operating system control of the CPU, the boot loader is not active until the next system reset or power-on.
The boot loader also provides trap-door access into the system if the operating system has problems serious enough that it cannot be used. The trap-door mechanism provides enough access to the system so that if it is necessary, you can format the flash file system, reinstall the operating system software image by using the Xmodem Protocol, recover from a lost or forgotten password, and finally restart the operating system. For more information, see the "Recovering from a Software Failure" section on page 43-2 and the "Recovering from a Lost or Forgotten Password" section on page 43-3 .
Before you can assign switch information, make sure you have connected a PC or terminal to the console port or a PC to the Ethernet management port, and make sure you have configured the PC or terminal-emulation software baud rate and character format to match these of the switch console port:
Assigning Switch Information
You can assign IP information through the switch setup program, through a DHCP server, or manually.
Use the switch setup program if you want to be prompted for specific IP information. With this program, you can also configure a hostname and an enable secret password. It gives you the option of assigning a Telnet password (to provide security during remote management) and configuring your switch as a command or member switch of a cluster or as a standalone switch. For more information about the setup program, see the hardware installation guide.
The switch stack is managed through a single IP address. The IP address is a system-level setting and is not specific to the stack master or to any other stack member. You can still manage the stack through the same IP address even if you remove the stack master or any other stack member from the stack, provided there is IP connectivity.
Use a DHCP server for centralized control and automatic assignment of IP information after the server is configured.
If you are an experienced user familiar with the switch configuration steps, manually configure the switch. Otherwise, use the setup program described previously.
These sections contain this configuration information:
Default Switch Information
Table 3-1 shows the default switch information.
Table 3-1 Default Switch Information
Understanding DHCP-Based Autoconfiguration
DHCP provides configuration information to Internet hosts and internetworking devices. This protocol consists of two components: one for delivering configuration parameters from a DHCP server to a device and a mechanism for allocating network addresses to devices. DHCP is built on a client-server model, in which designated DHCP servers allocate network addresses and deliver configuration parameters to dynamically configured devices. The switch can act as both a DHCP client and a DHCP server.
During DHCP-based autoconfiguration, your switch (DHCP client) is automatically configured at startup with IP address information and a configuration file.
With DHCP-based autoconfiguration, no DHCP client-side configuration is needed on your switch. However, you need to configure the DHCP server for various lease options associated with IP addresses. If you are using DHCP to relay the configuration file location on the network, you might also need to configure a Trivial File Transfer Protocol (TFTP) server and a Domain Name System (DNS) server.
The DHCP server for your switch can be on the same LAN or on a different LAN than the switch. If the DHCP server is running on a different LAN, you should configure a DHCP relay device between your switch and the DHCP server. A relay device forwards broadcast traffic between two directly connected LANs. A router does not forward broadcast packets, but it forwards packets based on the destination IP address in the received packet.
DHCP-based autoconfiguration replaces the BOOTP client functionality on your switch.
DHCP Client Request Process
When you boot your switch, the DHCP client is invoked and requests configuration information from a DHCP server when the configuration file is not present on the switch. If the configuration file is present and the configuration includes the ip address dhcp interface configuration command on specific routed interfaces, the DHCP client is invoked and requests the IP address information for those interfaces.
Figure 3-1 shows the sequence of messages that are exchanged between the DHCP client and the DHCP server.
Figure 3-1 DHCP Client and Server Message Exchange

The client, Switch A, broadcasts a DHCPDISCOVER message to locate a DHCP server. The DHCP server offers configuration parameters (such as an IP address, subnet mask, gateway IP address, DNS IP address, a lease for the IP address, and so forth) to the client in a DHCPOFFER unicast message.
In a DHCPREQUEST broadcast message, the client returns a formal request for the offered configuration information to the DHCP server. The formal request is broadcast so that all other DHCP servers that received the DHCPDISCOVER broadcast message from the client can reclaim the IP addresses that they offered to the client.
The DHCP server confirms that the IP address has been allocated to the client by returning a DHCPACK unicast message to the client. With this message, the client and server are bound, and the client uses configuration information received from the server. The amount of information the switch receives depends on how you configure the DHCP server. For more information, see the "Configuring the TFTP Server" section .
If the configuration parameters sent to the client in the DHCPOFFER unicast message are invalid (a configuration error exists), the client returns a DHCPDECLINE broadcast message to the DHCP server.
The DHCP server sends the client a DHCPNAK denial broadcast message, which means that the offered configuration parameters have not been assigned, that an error has occurred during the negotiation of the parameters, or that the client has been slow in responding to the DHCPOFFER message (the DHCP server assigned the parameters to another client).
A DHCP client might receive offers from multiple DHCP or BOOTP servers and can accept any of the offers; however, the client usually accepts the first offer it receives. The offer from the DHCP server is not a guarantee that the IP address is allocated to the client; however, the server usually reserves the address until the client has had a chance to formally request the address. If the switch accepts replies from a BOOTP server and configures itself, the switch broadcasts, instead of unicasts, TFTP requests to obtain the switch configuration file.
Configuring DHCP-Based Autoconfiguration
If your DHCP server is a Cisco device, see the "Configuring DHCP" section of the "IP Addressing and Services" section of the Cisco IOS IP Configuration Guide, Release 12.2 for additional information about configuring DHCP.

DHCP Server Configuration Guidelines
Follow these guidelines if you are configuring a device as a DHCP server:
You should configure the DHCP server with reserved leases that are bound to each switch by the switch hardware address.
If you want the switch to receive IP address information, you must configure the DHCP server with these lease options:
If you want the switch to receive the configuration file from a TFTP server, you must configure the DHCP server with these lease options:
Depending on the settings of the DHCP server, the switch can receive IP address information, the configuration file, or both.
If you do not configure the DHCP server with the lease options described previously, it replies to client requests with only those parameters that are configured. If the IP address and the subnet mask are not in the reply, the switch is not configured. If the router IP address or the TFTP server name are not found, the switch might send broadcast, instead of unicast, TFTP requests. Unavailability of other lease options does not affect autoconfiguration.
Configuring the TFTP Server
Based on the DHCP server configuration, the switch attempts to download one or more configuration files from the TFTP server. If you configured the DHCP server to respond to the switch with all the options required for IP connectivity to the TFTP server, and if you configured the DHCP server with a TFTP server name, address, and configuration filename, the switch attempts to download the specified configuration file from the specified TFTP server.
If you did not specify the configuration filename, the TFTP server, or if the configuration file could not be downloaded, the switch attempts to download a configuration file by using various combinations of filenames and TFTP server addresses. The files include the specified configuration filename (if any) and these files: network-config, cisconet.cfg, hostname .config, or hostname .cfg, where hostname is the switch's current hostname. The TFTP server addresses used include the specified TFTP server address (if any) and the broadcast address (255.255.255.255).
For the switch to successfully download a configuration file, the TFTP server must contain one or more configuration files in its base directory. The files can include these files:
If you specify the TFTP server name in the DHCP server-lease database, you must also configure the TFTP server name-to-IP-address mapping in the DNS-server database.
If the TFTP server to be used is on a different LAN from the switch, or if it is to be accessed by the switch through the broadcast address (which occurs if the DHCP server response does not contain all the required information described previously), a relay must be configured to forward the TFTP packets to the TFTP server. For more information, see the "Configuring the Relay Device" section . The preferred solution is to configure the DHCP server with all the required information.
Configuring the DNS
The DHCP server uses the DNS server to resolve the TFTP server name to an IP address. You must configure the TFTP server name-to-IP address map on the DNS server. The TFTP server contains the configuration files for the switch.
You can configure the IP addresses of the DNS servers in the lease database of the DHCP server from where the DHCP replies will retrieve them. You can enter up to two DNS server IP addresses in the lease database.
The DNS server can be on the same or on a different LAN as the switch. If it is on a different LAN, the switch must be able to access it through a router.
Configuring the Relay Device
You must configure a relay device, also referred to as a relay agent , when a switch sends broadcast packets that require a response from a host on a different LAN. Examples of broadcast packets that the switch might send are DHCP, DNS, and in some cases, TFTP packets. You must configure this relay device to forward received broadcast packets on an interface to the destination host.
If the relay device is a Cisco router, enable IP routing ( ip routing global configuration command), and configure helper addresses by using the ip helper-address interface configuration command.
For example, in Figure 3-2 , configure the router interfaces as follows:
On interface 10.0.0.2:
On interface 20.0.0.1
Figure 3-2 Relay Device Used in Autoconfiguration

Obtaining Configuration Files
Depending on the availability of the IP address and the configuration filename in the DHCP reserved lease, the switch obtains its configuration information in these ways:
The switch receives its IP address, subnet mask, TFTP server address, and the configuration filename from the DHCP server. The switch sends a unicast message to the TFTP server to retrieve the named configuration file from the base directory of the server and upon receipt, it completes its boot-up process.
The switch receives its IP address, subnet mask, and the configuration filename from the DHCP server. The switch sends a broadcast message to a TFTP server to retrieve the named configuration file from the base directory of the server, and upon receipt, it completes its boot-up process.
The switch receives its IP address, subnet mask, and the TFTP server address from the DHCP server. The switch sends a unicast message to the TFTP server to retrieve the network-confg or cisconet.cfg default configuration file. (If the network-confg file cannot be read, the switch reads the cisconet.cfg file.)
The default configuration file contains the hostnames-to-IP-address mapping for the switch. The switch fills its host table with the information in the file and obtains its hostname. If the hostname is not found in the file, the switch uses the hostname in the DHCP reply. If the hostname is not specified in the DHCP reply, the switch uses the default Switch as its hostname.
After obtaining its hostname from the default configuration file or the DHCP reply, the switch reads the configuration file that has the same name as its hostname ( hostname -confg or hostname .cfg, depending on whether network-confg or cisconet.cfg was read earlier) from the TFTP server. If the cisconet.cfg file is read, the filename of the host is truncated to eight characters.
If the switch cannot read the network-confg, cisconet.cfg, or the hostname file, it reads the router-confg file. If the switch cannot read the router-confg file, it reads the ciscortr.cfg file.
Example Configuration
Figure 3-3 shows a sample network for retrieving IP information by using DHCP-based autoconfiguration.
Figure 3-3 DHCP-Based Autoconfiguration Network Example

Table 3-2 shows the configuration of the reserved leases on the DHCP server.
Table 3-2 DHCP Server Configuration
DNS Server Configuration
The DNS server maps the TFTP server name tftpserver to IP address 10.0.0.3.
TFTP Server Configuration (on UNIX)
The TFTP server base directory is set to /tftpserver/work/. This directory contains the network-confg file used in the two-file read method. This file contains the hostname to be assigned to the switch based on its IP address. The base directory also contains a configuration file for each switch ( switcha-confg , switchb-confg , and so forth) as shown in this display:
DHCP Client Configuration
No configuration file is present on Switch A through Switch D.
Configuration Explanation
In Figure 3-3 , Switch A reads its configuration file as follows:
Switches B through D retrieve their configuration files and IP addresses in the same way.
Manually Assigning IP Information
Beginning in privileged EXEC mode, follow these steps to manually assign IP information to multiple switched virtual interfaces (SVIs):
To remove the switch IP address, use the no ip address interface configuration command. If you are removing the address through a Telnet session, your connection to the switch will be lost. To remove the default gateway address, use the no ip default-gateway global configuration command.
For information on setting the switch system name, protecting access to privileged EXEC commands, and setting time and calendar services, see "Administering the Switch."
Checking and Saving the Running Configuration
You can check the configuration settings you entered or changes you made by entering this privileged EXEC command:
To store the configuration or changes you have made to your startup configuration in flash memory, enter this privileged EXEC command:
This command saves the configuration settings that you made. If you fail to do this, your configuration will be lost the next time you reload the system. To display information stored in the NVRAM section of flash memory, use the show startup-config or more startup-config privileged EXEC command.
For more information about alternative locations from which to copy the configuration file, see "Working with the Cisco IOS File System, Configuration Files, and Software Images."
Modifying the Startup Configuration
These sections describe how to modify the switch startup configuration:
See also "Working with the Cisco IOS File System, Configuration Files, and Software Images," for information about switch configuration files. See the "Switch Stack Configuration Files" section on page 5-15 for information about switch stack configuration files.
Default Boot Configuration
Table 3-3 shows the default boot configuration.
Table 3-3 Default Boot Configuration
Automatically Downloading a Configuration File
You can automatically download a configuration file to your switch by using the DHCP-based autoconfiguration feature. For more information, see the "Understanding DHCP-Based Autoconfiguration" section .
Specifying the Filename to Read and Write the System Configuration
By default, the Cisco IOS software uses the file config.text to read and write a nonvolatile copy of the system configuration. However, you can specify a different filename, which will be loaded during the next boot cycle.
Beginning in privileged EXEC mode, follow these steps to specify a different configuration filename:
To return to the default setting, use the no boot config-file global configuration command.
Booting Manually
By default, the switch automatically boots; however, you can configure it to manually boot.
Beginning in privileged EXEC mode, follow these steps to configure the switch to manually boot during the next boot cycle:
To disable manual booting, use the no boot manual global configuration command.
Booting a Specific Software Image
By default, the switch attempts to automatically boot the system using information in the BOOT environment variable. If this variable is not set, the switch attempts to load and execute the first executable image it can by performing a recursive, depth-first search throughout the flash file system. In a depth-first search of a directory, each encountered subdirectory is completely searched before continuing the search in the original directory. However, you can specify a specific image to boot.
Beginning in privileged EXEC mode, follow these steps to configure the switch to boot a specific image during the next boot cycle:
To return to the default setting, use the no boot system global configuration command.
Controlling Environment Variables
With a normally operating switch, you enter the boot loader mode only through a switch console connection configured for 9600 bps. Unplug the switch power cord, and press the switch Mode button while reconnecting the power cord. You can release the Mode button a second or two after the LED above port 1 turns off. Then the boot loader switch: prompt appears.
The switch boot loader software provides support for nonvolatile environment variables, which can be used to control how the boot loader, or any other software running on the system, behaves. Boot loader environment variables are similar to environment variables that can be set on UNIX or DOS systems.
Environment variables that have values are stored in flash memory outside of the flash file system.
Each line in these files contains an environment variable name and an equal sign followed by the value of the variable. A variable has no value if it is not listed in this file; it has a value if it is listed in the file even if the value is a null string. A variable that is set to a null string (for example, " ") is a variable with a value. Many environment variables are predefined and have default values.
Environment variables store two kinds of data:
You can change the settings of the environment variables by accessing the boot loader or by using Cisco IOS commands. Under normal circumstances, it is not necessary to alter the setting of the environment variables.
Table 3-4 describes the function of the most common environment variables.
Table 3-4 Environment Variables
When the switch is connected to a PC through the Ethernet management port, you can download or upload a configuration file to the boot loader by using TFTP. Make sure the environment variables in Table 3-5 are configured.
Table 3-5 Environment Variables for TFTP
Scheduling a Reload of the Software Image
You can schedule a reload of the software image to occur on the switch at a later time (for example, late at night or during the weekend when the switch is used less), or you can synchronize a reload network-wide (for example, to perform a software upgrade on all switches in the network).
Configuring a Scheduled Reload
To configure your switch to reload the software image at a later time, use one of these commands in privileged EXEC mode:
This command schedules a reload of the software to take affect in the specified minutes or hours and minutes. The reload must take place within approximately 24 days. You can specify the reason for the reload in a string up to 255 characters in length.
To reload a specific switch in a switch stack, use the reload slot stack-member-number privileged EXEC command.
This command schedules a reload of the software to take place at the specified time (using a 24-hour clock). If you specify the month and day, the reload is scheduled to take place at the specified time and date. If you do not specify the month and day, the reload takes place at the specified time on the current day (if the specified time is later than the current time) or on the next day (if the specified time is earlier than the current time). Specifying 00:00 schedules the reload for midnight.
The reload command halts the system. If the system is not set to manually boot, it reboots itself. Use the reload command after you save the switch configuration information to the startup configuration ( copy running-config startup-config ).
If your switch is configured for manual booting, do not reload it from a virtual terminal. This restriction prevents the switch from entering the boot loader mode and thereby taking it from the remote user's control.
If you modify your configuration file, the switch prompts you to save the configuration before reloading. During the save operation, the system requests whether you want to proceed with the save if the CONFIG_FILE environment variable points to a startup configuration file that no longer exists. If you proceed in this situation, the system enters setup mode upon reload.
This example shows how to reload the software on the switch on the current day at 7:30 p.m:
This example shows how to reload the software on the switch at a future time:
To cancel a previously scheduled reload, use the reload cancel privileged EXEC command.
Displaying Scheduled Reload Information
To display information about a previously scheduled reload or to find out if a reload has been scheduled on the switch, use the show reload privileged EXEC command.
It displays reload information including the time the reload is scheduled to occur and the reason for the reload (if it was specified when the reload was scheduled).
Custom Book
Welcome to the custom book wizard. Using this tool you can create books containing a custom selection of content. To get started, enter a name for the book or select an existing book to add to.
Select the topics and posts that you would like to add to your book.
Preview your selected content before you download or save to your dashboard.
PDF View with Adobe Reader on a variety of devices.
ePub View in various apps on iPhone, iPad, Android, Sony Reader or Windows devices.
Mobi View on Kindle device or Kindle app on multiple devices.
Save to Dashboard
Save the custom book to your dashboard for future downloads.
Your contact details will be kept confidential and will not be shared outside Cisco. If we need additional information regarding your feedback, we will contact you at this email address.
Select Folder
Content library - -.
Click on the file types below to dowload the content in that format.

IMAGES
VIDEO
COMMENTS
Configure IP Address Settings on a Switch using the CLI Updated: June 28, 2021 Document ID: SMB5557 Bias-Free Language Objective The switch can have multiple IP addresses. Each IP address can be assigned to specified interfaces or ports, Link Aggregation Groups (LAGs), or Virtual Local Area Networks (VLANs).
There are two ways to configure an IP address to a switch interface that is given below: Static Configuration: Consider a Multilayer Switch: First, we need to check whether an interface is a layer 2 port or a layer 3 port. show interfaces f0/1 switchport Switch port: Enabled means that the port is currently a layer 2 port.
Step 1: Open Cisco Packet Tracer and select the following devices: IPv4 Addressing Table: Create the following topology and label the configuration as shown in the figure: Also, assign the respective IP addresses and default gateways to all 4 PCs.
The Catalyst 4500 series switch supports Layer 3 interfaces with the Cisco IOS IP and IP routing protocols. Layer 3, the network layer, is primarily responsible for the routing of data in packets across logical internetwork paths.
Setting the In-Band (sc0) Interface IP Address Setting the Management Ethernet (me1) Interface IP Address Configuring Default Gateways Configuring the SLIP (sl0) Interface on the Console Port Using DHCP or RARP to Obtain an IP Address Configuration Renewing and Releasing a DHCP-Assigned IP Address
Using the Interface Command . To configure a physical interface (port), use the interface global configuration command to enter interface configuration mode and to specify the interface type, slot, and number. • Type—Fast Ethernet (fastethernet or fa) for 10/100 Ethernet or Gigabit Ethernet (gigabitethernet or gi) • Slot—The slot number on the switch (always 0 on this switch).
You can assign IP information through the switch setup program, through a Dynamic Host Configuration Protocol (DHCP) server, or manually. Use the switch setup program if you are a new user and want to be prompted for specific IP information. With this program, you can also configure a host name and an enable secret password.
If the relay device is a Cisco router, enable IP routing (ip routing global configuration command), and configure helper addresses by using the ip helper-address interface configuration command. For example, in Figure 3-2, configure the router interfaces as follows: On interface 10.0.0.2:
Here are the steps to configure an IP address under VLAN 1: enter the VLAN 1 configuration mode with the interface vlan 1 global configuration command. assign an IP address with the ip address IP_ADDRESS SUBNET_MASK interface subcommand. enable the VLAN 1 interface with the no shutdown interface subcommand.
Cisco 300 Series Managed Switches Command Reference Guide. ... ip address 192.168.1.99 255.255.255. - use this command to define an IP address for an interface. ... The IPv4 Interface Table will display the new static IP address assigned to the switch. In this example, we can see that our IP address is 192.168.1.99 with the IP Address Type ...
12-08-2020 11:05 PM - You can only do that on a l3 switch , here is an example : switch (config)# interface ethernet x/y switch (config-if)# no switchport switch (config-if)# ip address 192.0.2.1/8 -- ' 'Good body every evening' ' this sentence was once spotted on a logo at the entrance of a Weight Watchers Club ! 0 Helpful
In this edition of Cisco Tech Talk, I'll demonstrate how to add and change the IP address per VLAN and switch port interface on CBS250 and CBS350 series switches using the Command Line Interface (CLI). ... Cisco Tech Talk: Configure IP Address Settings on a Switch via CLI. 4:20. Share on Facebook; Tweet this video; Share on LinkedIn;
Assigning the Switch IP Address and Default Gateway This chapter describes how to create the initial switch configuration (for example, assigning the IP address and default gateway information) by using a variety of automatic and manual methods. It also describes how to modify the switch startup configuration.
Usually, the default VLAN 1 acts like the switch's own NIC for connecting into a LAN to send IP packets. Here are the steps to configure an IP address under VLAN 1: enter the VLAN 1 configuration mode with the interface vlan 1 global configuration command. assign an IP address with the ip address IP_ADDRESS SUBNET_MASK interface subcommand.
A layer 2 switch only does layer 2 fowarding, as such it doesn't have any additional ip interfaces. On a layer 2 switch the ip address is instead assigned to the vlan interface: config t. interface vlan 1. ip address 192.168.1.1 255.255.255. * Note on a L2 switch you can assign an ip to any vlan you want (vlan 1, vlan 2, vlan 4000).
If the relay device is a Cisco router, enable IP routing (ip routing global configuration command), and configure helper addresses by using the ip helper-address interface configuration command. For example, in Figure 4-2, configure the router interfaces as follows: On interface 10.0.0.2:
Assigning IP addresses to multiple switches in the same network can save the time for configuration. This video introduces how to assign IP addresses to Cisc...
Step 1 Connect your computer directly to the switch using a serial cable. If you would prefer to SSH into your switch, click here to view an article on gaining CLI access to a switch. Step 2 Log in to the switch console. The default username and password is cisco/cisco.
To start your switch, you need to follow the procedures in the hardware installation guide for installing and powering on the switch and setting up the initial switch configuration (IP address, subnet mask, default gateway, secret and Telnet passwords, and so forth).
Configure IP Address Settings on a Switch using the CLI Objective The switch can have multiple IP addresses. Each IP address can be assigned to specified interfaces or ports, Link Aggregation Groups (LAGs), or Virtual Local Area Networks (VLANs). To remotely manage the device, an IP address must be defined to access the switch. This allows you