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!
To set up the Cisco router, we’ll configure the WAN and LAN ports, set a default route, and assign IP addresses.
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
Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1
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.
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
Switch(config)# ip default-gateway 198.51.100.1
Switch(config)# int gig 0/24 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 1 Switch(config-if)#end
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
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