Skip to content
Website under migration: We are moving to a new design. Some pages may look different or load slowly for a few days. Thank you for your patience.
SwitchFirewall
IPv4 Detecting…
IPv6 Detecting…

How to Set Up Cisco Router and Switch for Internet Access

Last updated:

Introduction

In this tutorial, we’ll guide you through the step-by-step process of configuring a Cisco router and switch to enable internet access for LAN users. We'll assign public IP addresses to the router’s WAN and LAN interfaces, configure DHCP on the switch for LAN users.

This setup ensures all LAN users can connect to the internet, with IP assignments handled automatically through DHCP. Let’s dive in!

Network Layout:

Router:
WAN IP POOL: 203.0.113.0/30
WAN IP: 203.0.113.2 255.255.255.252
LAN IP POOL: 198.51.100.0/28
LAN IP: 198.51.100.1 255.255.255.240
Default route: 203.0.113.1
Switch: Switch Management IP: 198.51.100.2
DHCP Range for LAN Devices: 198.51.100.3 - 198.51.100.14

Cisco Router Configuration:

To set up the Cisco router, we’ll configure the WAN and LAN ports, set a default route, and assign IP addresses.

WAN Port Configuration:

Router> enable
Router# configure terminal
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip address 203.0.113.2 255.255.255.252
Router(config-if)# no shutdown
Router(config)# interface GigabitEthernet0/1
Router(config-if)# ip address 198.51.100.1 255.255.255.240
Router(config-if)# no shutdown

Default Route

Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1

Cisco Switch Configuration:

With the router configured, we’ll move on to the switch to enable DHCP and assign IPs to LAN devices within the same /28 subnet.

Configure Interface VLAN

Switch> enable
Switch# configure terminal
Switch(config)# interface vlan 1
Switch(config-if)# ip address 198.51.100.2 255.255.255.240
Switch(config-if)# no shutdown  

Default-Gateway

Switch(config)# ip default-gateway 198.51.100.1

Connect Route to Switch:

Here, the router's LAN cable is connected to the switch at GigabitEthernet0/24
Switch(config)# int gig 0/24
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 1
Switch(config-if)#end

DHCP Configuration

Switch(config)# ip dhcp pool LAN-CLIENTS
Switch(dhcp-config)# network 198.51.100.0 255.255.255.240
Switch(dhcp-config)# default-router 198.51.100.1
Switch(dhcp-config)# dns-server 8.8.8.8 8.8.4.4

Testing the Configuration

  1. Connect LAN Devices: Ensure that LAN devices receive IPs from the 51.100.3 - 198.51.100.14 range.
  2. Ping External IPs: Verify internet connectivity by pinging a public IP (e.g., 8.8.8).
  3. DNS Resolution Test: Confirm DNS by pinging a domain (e.g., com).

Conclusion

Configuring Cisco routers and switches for internet access involves setting up WAN and LAN ports, a default route, and DHCP services for seamless connectivity. This configuration enables automatic IP allocation, reliable internet access, and efficient network management for connected devices. By following these steps, you can establish a well-structured network foundation suitable for various small to medium-sized environments