how to assign static IP on a switch – 14861 – The Cisco Learning Network

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:

 

config t

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).

 

Config t

int fa0/1

ip address 192.168.1.1 255.255.255.0

description *** Assigning an ip address to a physical fast ethernet port on the switch***

 

int vlan 1

ip address 192.168.2.1 255.255.255.0

description *** Assigning an ip address to the virtual (vlan) interface on the switch ***

 

int vlan 2

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.

 

Example

 

int fa0/1

ip address 192.168.1.1 255.255.255.252

description *** This interface is on the 192.168.1.0/30 network ***

 

int fa0/2

ip address 192.168.1.5 255.255.255.252

description *** This interface is on the 192.168.1.4/30 network***

 

int vlan 1

ip address 192.168.9 255.255.255.252

description *** This interface is on the 192.168.1.8/30 network ***

 

HTH

Source: how to assign static IP on a switch – 14861 – The Cisco Learning Network

how to assign static IP on a switch – 14861 – The Cisco Learning Network was last modified: July 13th, 2017 by Jovan Stosic

Basic Router Configuration  [Support] – Cisco Systems

 

Basic Router Configuration

Interface Port Labels

Viewing the Default Configuration

Information Needed for Configuration

Configuring Basic Parameters

Configure Global Parameters

Configure Fast Ethernet LAN Interfaces

Configure WAN Interfaces

Configure the Fast Ethernet WAN Interface

Configure the ATM WAN Interface

Configure the Wireless Interface

Configuring a Loopback Interface

Configuration Example

Verifying Your Configuration

Configuring Command-Line Access to the Router

Configuration Example

Configuring Static Routes

Configuration Example

Verifying Your Configuration

Configuring Dynamic Routes

Configuring RIP

Configuration Example

Verifying Your Configuration

Configuring Enhanced IGRP

Configuration Example

Verifying Your Configuration

Source: Basic Router Configuration  [Support] – Cisco Systems

Basic Router Configuration  [Support] – Cisco Systems was last modified: July 13th, 2017 by Jovan Stosic

Configuring a LAN with DHCP and VLANs

The Cisco 870 series routers support clients on both physical LANs and virtual LANs (VLANs). The routers can use the Dynamic Host Configuration Protocol (DHCP) to enable automatic assignment of IP configurations for nodes on these networks.

Configuring a LAN with DHCP and VLANs was last modified: July 13th, 2017 by Jovan Stosic