写点什么

How to Connect 2 Cisco Switches Together

用户头像
心在飞
关注
发布于: 2021 年 03 月 21 日

This article describes how to connect 2 Cisco switches(L3 Switch C3560X and L2 Switch 2960) together.


  • VLAN Structure

  • Cisco Command

  • L3 Switch(C3560X)

  • L2 Switch(2960)

  • Hardware Connection

  • Dual Ethernet PC Configuration

VLAN Structure

  L3 Switch

    - Vlan10 - 192.168.10.254 255.255.255.0

    - Vlan20 - 192.168.20.254 255.255.255.0

  L2 Switch

    - Vlan20

    Note: L2 Switch only creates Vlan, Not assigning IP Address, L3 Switch will configure and assign IP address.

Cisco Command

L3 Switch(C3560X)

    run command and then input telnet 192.168.10.254

    password: admin

    Switch> enable

    admin

    Switch#> configure terminal

    Switch(config)# ip routing  # Enable ip routing

    # Create VLAN

    Switch(config)# interface vlan 10  # Create vlan 10

    Switch(config-if)# ip address 192.168.10.254 255.255.255.0  # Assign IP, SVI(Switch Virtual Interface) Routing

    Switch(config-if)# exit

    Switch(config)# interface vlan 20  # Create vlan 20

    Switch(config-if)# ip address 192.168.20.254 255.255.255.0

    Switch(config-if)# exit


    # Assign Ethernet Ports

    Switch(config)# interface range GigabitEthernet0/1 - 10  # Batch config Ethernet ports 

    Switch(config-if-range)# switchport mode access

    Switch(config-if-range)# switchport access vlan 10

    Switch(config-if-range)# exit

    Switch(config)# interface range GigabitEthernet0/14 - 20

    Switch(config-if-range)# switchport mode access

    Switch(config-if-range)# switchport access vlan 20

    Switch(config-if-range)# exit

    Switch(config)# exit

    Switch# copy running-config startup-config

    Destination filename start-config? Enter

    Switch# show run


NOTE: Reset Port to Default, e.g. reset port 3:

switch(config)#default interface FastEthernet0/3

L2 Switch(2960)

L2 Switch configuration is similar to L3 Switch. The difference is DO NOT assigning IP address when creating VLAN interface.

Connect your PC or laptop to the 2960 switch Ethernet port 48, configure the static IP address, mask and gateway, e.g.192.168.1.2, 255.255.255.0, 192.168.1.1


    run command and then input telnet 192.168.1.1

    password: admin

    Switch> enable

    admin

    Switch#> configure terminal

    # Create VLAN

    Switch(config)# interface vlan 20

    Switch(config-if)# exit


    # Assign Ethernet Ports

    Switch(config)# interface range FastEthernet0/1 - 46  # Batch config Ethernet ports. Port 47 is reserved, Port 48 is for telnet.

    Switch(config-if-range)# switchport mode access

    Switch(config-if-range)# switchport access vlan 20

    Switch(config-if-range)# exit

    Switch(config)# exit

    Switch# copy running-config startup-config

    Destination filename start-config? Enter

    Switch# show run

Hardware Connection

Connect L3 switch C3560X port 14 with L2 switch 2960 port 33. 

NOTE: You can connect ANY 2 ports together within the VLAN 20 range of the 2 switches(GigabitEthernet0/14 - 20 and FastEthernet0/1 - 46)

Dual Ethernet PC Configuration

Please skip below command if you only have 1 Ethernet adapter.

NOTE: Execute below commands in Windows Command line as Administrator

  1. Clear Default Route Table

  2. route delete 0.0.0.0

  3. Add Default Route Table, pointing to external gateway

  4. route -p add 0.0.0.0 mask 0.0.0.0 172.21.0.254 

  5. Add Internal Route Table, pointing to internal gateway

  6. route -p add 192.168.10.0 mask 255.255.255.0 192.168.20.254

  7. Print route table information

  8. route print

发布于: 2021 年 03 月 21 日阅读数: 15
用户头像

心在飞

关注

还未添加个人签名 2017.10.15 加入

2个女儿的爸爸 | 程序员 | CS 反恐精英

评论

发布
暂无评论
How to Connect 2 Cisco Switches Together