Cisco Router and Switch Configuration Step by Step | Connect Cisco Router & Switch to Internet

3 min read 4 hours ago
Published on Nov 02, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial provides a comprehensive guide on configuring Cisco routers and switches using the Router-on-a-Stick method. Aimed at beginners and those preparing for CCNA or CCNP certifications, this step-by-step tutorial will help you understand how to set up a Cisco network from scratch, including VLANs, DHCP, and NAT configurations.

Step 1: Understand Network Topology

  • Review the network diagram provided in the video.
  • Identify the devices (Cisco Router and Switch) and their connections.
  • Familiarize yourself with the concept of Router-on-a-Stick, where a single router interface handles multiple VLANs.

Step 2: Physical Connectivity

  • Connect the Cisco router to the switch using an Ethernet cable.
  • Ensure that the switch ports and router interfaces are powered on and properly connected.

Step 3: Configure the Cisco Router

  1. Access the Cisco Router CLI (Command Line Interface).
  2. Enter global configuration mode:
    configure terminal
    
  3. Set the hostname for the router:
    hostname Router1
    
  4. Configure the interface connected to the switch as a trunk port:
    interface GigabitEthernet0/0
    no shutdown
    

Step 4: Configure Static Route

  • Define a static route to direct traffic:
    ip route [destination_network] [subnet_mask] [next_hop_address]
    
  • Example:
    ip route 0.0.0.0 0.0.0.0 [ISP_gateway]
    

Step 5: Configure Sub-Interfaces

  1. Create sub-interfaces for each VLAN:
    interface GigabitEthernet0/0.10
    encapsulation dot1Q 10
    ip address [VLAN10_IP] [subnet_mask]
    
    • Repeat for additional VLANs (e.g., .20, .30).

Step 6: Configure DHCP Server on Router

  1. Enable DHCP service:
    ip dhcp pool [pool_name]
    network [VLAN_network] [subnet_mask]
    default-router [default_gateway]
    

Step 7: Configure DHCP on Switch

  • Ensure that the switch ports are configured to allow DHCP requests from connected devices.

Step 8: Configure NAT on Router

  1. Enable NAT for Internet access:
    ip nat inside source list [access-list-number] interface [public_interface] overload
    
  2. Create an access list:
    access-list [access-list-number] permit [inside_network] [wildcard_mask]
    

Step 9: Configure Access Control Lists

  • Set up access control lists to manage traffic flow:
    access-list [list_number] permit [protocol] [source] [destination]
    

Step 10: Configure the Cisco Switch

  1. Access the switch CLI:
    enable
    configure terminal
    
  2. Set the switch hostname:
    hostname Switch1
    

Step 11: Configure Trunk Ports on Switch

  • Configure the interface connected to the router as a trunk port:
    interface FastEthernet0/1
    switchport mode trunk
    

Step 12: Configure VLANs on Switch

  1. Create VLANs:
    vlan [vlan_id]
    name [vlan_name]
    
  2. Assign VLANs to ports:
    interface FastEthernet0/2
    switchport access vlan [vlan_id]
    

Step 13: Configure Access Ports on Switch

  • Ensure that access ports are assigned to the correct VLANs to allow devices to connect:
    interface FastEthernet0/3
    switchport mode access
    switchport access vlan [vlan_id]
    

Step 14: Verify Connectivity

  • Use the ping command to test connectivity between devices in the same VLAN:
    ping [IP_address]
    

Conclusion

You have now configured a Cisco router and switch for a small to medium-sized network using the Router-on-a-Stick method. Key configurations included setting up VLANs, DHCP, NAT, and access control lists. For further learning, consider experimenting with more complex network setups or diving deeper into advanced routing techniques.