Cisco Router and Switch Configuration Guide

Router Edge-Router Configuration

Initial Configuration

Enter global configuration mode and disable DNS lookup:

en
conf t
no ip domain lookup

Set the enable secret password:

enable secret class

Configure console and VTY line passwords:

line console 0
password cisco
login
exit
line vty 0 4
password cisco
login
exit

Set the MOTD banner and hostname:

banner motd #Authorized Access Only!#
hostname Edge-Router

Enable password encryption:

service password-encryption

Interface Configuration

Configure GigabitEthernet0/0/0 interface with IP address and description:

interface g0/0/0
ip address 192.168.0.1 255.255.255.0
no shutdown
description "R1 G0/0/0"
exit

Configure Serial0/1/0 interface with IP address and description:

interface s0/1/0
ip address 209.165.201.2 255.255.255.252
no shutdown
description "R1 S0/1/0"
exit

Configure GigabitEthernet0/0/1 subinterfaces for VLANs and assign IP addresses:

interface g0/0/1
no shutdown
interface g0/0/1.40
description "Gateway for VLAN40"
encapsulation dot1q 40
ip address 192.168.40.1 255.255.255.0
exit
interface g0/0/1.50
description "Gateway for VLAN50"
encapsulation dot1q 50
ip address 192.168.50.1 255.255.255.0
exit
interface g0/0/1.60
description "Gateway for VLAN60"
encapsulation dot1q 60
ip address 192.168.60.1 255.255.255.0
exit
interface g0/0/1.99
description "Gateway for VLAN99"
encapsulation dot1q 99 native
ip address 192.168.99.17 255.255.255.240

Routing Configuration

Configure static routes for connected networks:

ip route 192.168.10.0 255.255.255.0 GigabitEthernet0/0/0
ip route 192.168.20.0 255.255.255.0 GigabitEthernet0/0/0
ip route 192.168.30.0 255.255.255.0 GigabitEthernet0/0/0
ip route 192.168.99.0 255.255.255.240 GigabitEthernet0/0/0

Save Configuration

end
copy running-config startup-config

Switch Sw-C Configuration

VLAN and Interface Configuration

Configure VLANs and assign IP addresses to VLAN interfaces:

en
config t
interface vlan 99
ip address 192.168.99.18 255.255.255.240
no shutdown
exit
vlan 40
name BDG4
exit
interface vlan 40
ip address 192.168.40.1 255.255.255.0
description BDG4
exit
vlan 50
name BDG5
exit
interface vlan 50
ip address 192.168.50.1 255.255.255.0
description BDG5
exit
vlan 60
name BDG6
exit
interface vlan 60
ip address 192.168.60.1 255.255.255.0
description BDG6
exit
vlan 99
name Management
exit
interface vlan 99
ip address 192.168.99.18 255.255.255.240
description Management
exit

Configure default gateway and domain name:

ip default-gateway 192.168.99.17
ip domain-name acad.pt

Security Configuration

Generate RSA keys and configure username and password:

crypto key generate rsa
1024
username admin privilege 15 secret C1sco123!
enable secret C1sco123!

Enable SSH and set version to 2:

line vty 0 15
transport input ssh
login local
exit
ip ssh version 2

Switch Port Configuration

Configure access ports for VLANs:

interface range f0/1-5
switchport mode access
switchport access vlan 40
exit
interface range f0/6-10
switchport mode access
switchport access vlan 50
exit
interface range f0/11-15
switchport mode access
switchport access vlan 60
exit
interface f0/24
switchport mode access
switchport access vlan 99
exit

Configure trunk port and allowed VLANs:

interface g0/1
switchport mode trunk
switchport nonegotiate
switchport trunk allowed vlan 40,50,60,99
switchport trunk native vlan 99

Save Configuration

end
copy running-config startup-config

Switch L3-SW1 Configuration

VLAN and Interface Configuration

Configure VLANs and assign IP addresses to VLAN interfaces:

en
config t
vlan 10
name FL1
interface vlan 10
description FL1
ip address 192.168.10.1 255.255.255.0
exit
vlan 20
name FL2
interface vlan 20
description FL2
ip address 192.168.20.1 255.255.255.0
exit
vlan 30
name FL3
interface vlan 30
description FL3
ip address 192.168.30.1 255.255.255.0
exit
vlan 99
name Management
interface vlan 99
description Management
ip address 192.168.99.2 255.255.255.240
exit

Enable IP routing and configure GigabitEthernet1/1/1 interface:

ip routing
interface g1/1/1
no switchport
ip address 192.168.0.2 255.255.255.0
exit

Port Channel Configuration

Create port channels and configure trunking:

interface range g1/0/1-2
channel-group 1 mode active
exit
interface port-channel 1
switchport mode trunk
switchport trunk allowed vlan 10,20,30
exit
interface range g1/0/3-4
channel-group 2 mode active
exit
interface port-channel 2
switchport mode trunk
switchport trunk allowed vlan 10,20,30

Save Configuration

end
copy running-config startup-config

Switch Sw-A Configuration

VLAN and Interface Configuration

Configure VLANs and descriptions:

enable
config terminal
vlan 10
name FL1
interface vlan 10
description FL1
exit
vlan 20
name FL2
interface vlan 20
description FL2
exit
vlan 30
name FL3
interface vlan 30
description FL3
exit

Configure access ports for VLANs:

interface range f0/7-10
switchport mode access
switchport access vlan 10
exit
interface range f0/11-15
switchport mode access
switchport access vlan 20
exit
interface range f0/16-24
switchport mode access
switchport access vlan 30
exit

Port Channel Configuration

Create port channels and configure trunking:

interface range g0/1-2
channel-group 1 mode active
exit
interface port-channel 1
switchport mode trunk
switchport nonegotiate
exit
interface range f0/5-6
channel-group 3 mode active
exit
interface port-channel 3
switchport mode trunk
switchport nonegotiate

Save Configuration

end
copy running-config startup-config

Switch Sw-B Configuration

VLAN and Interface Configuration

Configure VLANs and descriptions:

en
config t
vlan 10
name FL1
interface vlan 10
description FL1
exit
vlan 20
name FL2
interface vlan 20
description FL2
exit
vlan 30
name FL3
interface vlan 30
description FL3
exit

Configure access ports for VLANs:

interface range f0/7-10
switchport mode access
switchport access vlan 10
exit
interface range f0/11-15
switchport mode access
switchport access vlan 20
exit
interface range f0/16-24
switchport mode access
switchport access vlan 30
exit

Port Channel Configuration

Create port channels and configure trunking:

interface range g0/1-2
channel-group 2 mode active
exit
interface port-channel 2
switchport mode trunk
switchport nonegotiate
exit
interface range f0/5-6
channel-group 3 mode active
exit
interface port-channel 3
switchport mode trunk
switchport nonegotiate

Save Configuration

end
copy running-config startup-config