Configuring a Cisco router and a Layer 2 switch for internet access involves setting up the WAN interface, configuring the LAN interface, assigning public IP addresses, and setting up default routes. Follow these steps to get your network up and running.
Using Console Cable:
Router> enable Router# configure terminal
Set up the WAN interface with the provided IP address and subnet mask.
Router(config)# interface gigabitEthernet 0/0 Router(config-if)# ip address 203.0.113.1 255.255.255.252 Router(config-if)# no shutdown Router(config-if)# exit
Set up the LAN interface with the internal IP address.
Router(config)# interface gigabitEthernet 0/1 Router(config-if)# ip address 198.51.100.1 255.255.255.0 Router(config-if)# no shutdown Router(config-if)# exit
Set up the default route to direct traffic to the internet through the specified gateway.
Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.2
Check the configuration to ensure everything is set up correctly.
Router# show ip interface brief Router# show ip route Router# show running-config
Save the configuration to ensure it persists after a reboot.
Router# write memory
Using Console Cable:
Switch> enable Switch# configure terminal
Set up the VLAN interface with the provided IP address and subnet mask.
Switch(config)# interface vlan 1 Switch(config-if)# ip address 198.51.100.2 255.255.255.0 Switch(config-if)# no shutdown Switch(config-if)# exit
Set up the default gateway to direct traffic through the router.
Switch(config)# ip default-gateway 198.51.100.1 Switch(config)# exit
Set the switch port connected to the router (e.g., FastEthernet 0/1) to access mode and assign it to VLAN 1.
Switch(config)# interface fastEthernet 0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 1 Switch(config-if)# exit
Check the configuration to ensure everything is set up correctly.
Switch# show ip interface brief Switch# show running-config
Save the configuration to ensure it persists after a reboot.
Switch# write memory
Perform a ping and traceroute to verify connectivity.
Router# ping 8.8.8.8 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 20/30/40 ms
By following these steps, you can successfully configure your Cisco router and Layer 2 switch for internet access. The setup involves configuring the WAN and LAN interfaces on the router, setting up VLAN and default gateway on the switch, and ensuring the correct physical connections. This basic configuration provides internet connectivity to devices on your network. For enhanced security and performance, consider implementing additional configurations such as access control lists (ACLs) and monitoring tools.
By adhering to this guide, you ensure a structured and efficient network setup, laying the foundation for a robust and secure network environment.