Configure basic switch and router configurations using CLI commands.
Configuring basic switch and router settings using Command Line Interface (CLI) commands involves accessing the devices' command-line interface and entering specific commands to set up various parameters. Below, I'll provide a basic guide for configuring a switch and a router separately.
Basic Switch Configuration:
- Access the Switch CLI:
- Connect to the switch using a console cable or through a network connection (SSH or Telnet).
- Use a terminal emulation program like PuTTY or HyperTerminal.
- Enter Privileged EXEC Mode:bashCopy code
Switch> enable
Switch# - Configure the Switch Hostname:bashCopy code
Switch# configure terminal
Switch(config)# hostname SWITCH_NAME
SWITCH_NAME(config)# - Configure Interface VLAN (SVI):bashCopy code
SWITCH_NAME(config)# interface vlan 1
SWITCH_NAME(config-if)# ip address SWITCH_IP_ADDRESS SWITCH_SUBNET_MASK
SWITCH_NAME(config-if)# no shutdown
SWITCH_NAME(config-if)# exit - Set a Management IP (Optional):bashCopy code
SWITCH_NAME(config)# interface vlan 1
SWITCH_NAME(config-if)# ip address SWITCH_MANAGEMENT_IP SWITCH_MANAGEMENT_SUBNET_MASK
SWITCH_NAME(config-if)# exit - Configure Port Settings (Optional):bashCopy code
SWITCH_NAME(config)# interface range GigabitEthernet0/1 - 24
SWITCH_NAME(config-if-range)# switchport mode access
SWITCH_NAME(config-if-range)# switchport access vlan 1
SWITCH_NAME(config-if-range)# exit - Save Configuration:bashCopy code
SWITCH_NAME# write memory
Basic Router Configuration:
- Access the Router CLI:
- Connect to the router using a console cable or through a network connection (SSH or Telnet).
- Use a terminal emulation program like PuTTY or HyperTerminal.
- Enter Privileged EXEC Mode:bashCopy code
Router> enable
Router# - Configure the Router Hostname:bashCopy code
Router# configure terminal
Router(config)# hostname ROUTER_NAME
ROUTER_NAME(config)# - Configure Interface IP Addresses:bashCopy code
ROUTER_NAME(config)# interface GigabitEthernet0/0
ROUTER_NAME(config-if)# ip address ROUTER_IP_ADDRESS ROUTER_SUBNET_MASK
ROUTER_NAME(config-if)# no shutdown
ROUTER_NAME(config-if)# exit - Configure Routing (if needed):bashCopy code
ROUTER_NAME(config)# ip routing
- Set a Default Gateway (if needed):bashCopy code
ROUTER_NAME(config)# ip route 0.0.0.0 0.0.0.0 GATEWAY_IP_ADDRESS
- Save Configuration:bashCopy code
ROUTER_NAME# write memory