Welcome to www.linknewnet.com.

New Promotion

-50%
Cisco Switch Catalyst 9500 Series C9500-40X-A
$4000 $2000
-29%
Cisco Catalyst 9300 Series Switch C9300-24T-A
$1750 $1250
-31%
Cisco MDS 9200 Series Switch DS-C9250I-K9
$1600 $1100
-38%
Cisco Catalyst 2960 Series Switch WS-C2960L-48PQ-LL
$800 $500
-42%
Cisco ASR 9001 Series Power Supply A9K-750W-AC
$600 $350

How to connect Cisco router and switch? (with configuration tutorial)
Mar 17 , 2024 1771

Cisco switches and routers are vital components of the network architecture. Switches are responsible for transferring data within a LAN, while routers are responsible for transferring data between different networks. Configuring these devices is one of the key steps in building a stable and efficient network.


connect cisco router.png


In an enterprise network, Cisco switches are used to connect end devices such as computers, printers, and IP phones in various departments. Routers are used to connect networks between different office buildings or branch offices and provide Internet access.


For data centers that require high-performance and high-availability network equipment, Cisco switches are typically used to build the core switching fabric of the data center, while routers are responsible for connecting the data center to the rest of the network.


In service provider networks, routers play a key role in managing large volumes of network traffic and connecting devices to the global Internet.


So, for Cisco products, how is the switch of the router connected? The following is the configuration code prepared by NetDirect Communications engineers for you, if you need it, you can collect the spare.


Configuration process:


1.Router configuration interface IP address


(config)#interface g1/0/1

(config-if)#no switchport

(config-if)#ip address 192.168.0.2 255.255.255.0

(config-if)#no shutdown


2.Segment VLANs for switches


By default, all ports of the switch belong to VLAN1, and create vlan 10 , vlan 20 , vlan 30 respectively. Configure with the Console serial line. The commands are as follows.


# conf t  //Entering Configuration Mode
# vlan 10
# vlan 20
# vlan 30  //Create three separate VLANs
# exit  //Exit Configuration


3. Configure Port to VLAN (Port to VLAN), i.e. multiple ports belonging to the same VLAN for direct access to the PC.


Example of planning:


VLAN labeling Physical port VLAN gateway

vlan 10  gi2-10  192.168.1.1
vlan 20  gi11-30  192.168.2.1
vlan 30  gi31-52  192.168.3.1


Assign the gateway IP to each Vlan first with the following commands

# interface vlan 10
# ip address 192.168.1.1  255.255.255.0
# exit
# interface vlan 20
# ip address 192.168.2.1 255.255.255.0
# exit
# interface vlan 30
# ip address 192.168.3.1 255.255.255.0
# exit


Specify the physical port range and join to the corresponding Vlan


# interface range gi2-10  //Specifies a range of vlan 10 ports, and gi is the physical port number.

# switchport mode access  //Specify the port operating mode, connecting to the PC as access

# switchport access vlan 10  //Classify the specified port as vlan 10

# exit
# interface range gi11-20
# switchport mode access
# switchport access vlan 20
# exit
# interface range gi21-52
# switchport mode access
# switchport access vlan 30
# exit


// There are two ways to do this step below:


Method one: Add a gateway to the switch's default vlan1 for connecting to the router (the previous operation did not specify the gi1 port, which belongs to vlan 1 by default).

# interface vlan 1
# ip address 192.168.0.2 255.255.255.0
# exit


Method two: # interface gi1 

# no switch port

# IP address  192.168.0.2 255.255.255.0 /Use no switchport to set as Layer 3 interface /

Add a default route rule pointing to router IP 192.168.0.1

# conf t
# ip route 0.0.0.0 0.0.0.0 192.168.0.1
# exit


Write the currently configured runtime parameters to the startup configuration file


# copy running-config startup-config


When finished, connect the PC to the ports corresponding to VLAN 10, 20, and 30, and configure the IP address of the NIC as 192.168.1.x/2.x/3.x and the gateway as 192.168.1.1/2.1/3.1. If you are able to ping each other's IPs and the vlan gateway, it means you have succeeded.


The router can be configured with a single backhaul route: the


# 192.168.0.0 255.255.0.0 192.168.0.2


Configuring Cisco switches and routers is part of a network engineer's daily routine. With proper configuration, you can ensure the efficient operation and reliability of your network. These configuration guides provide basic examples, but actual network requirements may vary. Before proceeding with the configuration, make sure that you fully understand the network topology and requirements, and refer to the official Cisco documentation for detailed configuration.

Related Blogs

WhatsApp
Quote
Contact
Top