On each switch (S1-4)

Create VLANs

S1(config)# vlan 10
S1(config)# vlan 20
S1(config)# vlan 99
S1, S2

Configure ports

S1(config)# int r f0/1-9
S1(config-if-range)# switchport mode access
S1(config-if-range)# switchport access vlan 10
S1(config)# int r f0/10-19
S1(config-if-range)# switchport mode access
S1(config-if-range)# switchport access vlan 20
S1(config)# int r f0/20-24, g1/1-2
S1(config-if-range)# switchport mode trunk
S1(config-if-range)# switchport trunk native vlan 99

S3, S4

Configure ports

S3(config)# int r f0/1-9
S3(config-if-range)# switchport mode access
S3(config-if-range)# switchport access vlan 10
S3(config)# int r f0/10-20
S3(config-if-range)# switchport mode access
S3(config-if-range)# switchport access vlan 20
S3(config)# int r f0/21-24, g1/1-2
S3(config-if-range)# switchport mode trunk
S3(config-if-range)# switchport trunk native vlan 99

S1

Configure ports

S1(config)# int r g1/1 - 2
S1(config-if-range)# channel-group 1 mode active
S1(config)# int range f0/23-24
S1(config-if-range)# channel-group 3 mode active
S1(config)# int range f0/21-22
S1(config-if-range)# channel-group 5 mode active
Spanning-tree
S1(config)# spanning-tree mode rapid-pvst
S1(config)# spannning-tree vlan 10 priority 4096
S1(config)# spannning-tree vlan 20 priority 8192
S1(config)# int port-channel 1
S1(config-if)# switchport trunk native vlan 99
S1(config)# int port-channel 3
S1(config-if)# switchport trunk native vlan 99

S2

Configure ports

S2(config)# int r g1/1 - 2
S2(config-if-range)# channel-group 2 mode active
S2(config)# int range f0/23-24
S2(config-if-range)# channel-group 3 mode active
S2(config)# int range f0/21-22
S2(config-if-range)# channel-group 6 mode active

Configure ports

S2(config)# spanning-tree mode rapid-pvst
S2(config)# spannning-tree vlan 10 priority 8192
S2(config)# spannning-tree vlan 20 priority 4096
S2(config)# int port-channel 2
S2(config-if)# switchport trunk native vlan 99
S2(config)# int port-channel 3
S2(config-if)# switchport trunk native vlan 99

S3

Configure ports

S3(config)# int r g1/1 - 2
S3(config-if-range)# channel-group 1 mode active
S3(config)# int range f0/23-24
S3(config-if-range)# channel-group 4 mode active
S3(config)# int range f0/21-22
S3(config-if-range)# channel-group 6 mode active

Spanning-tree

S3(config)# spanning-tree mode rapid-pvst
S3(config)# spanning-tree vlan 10 priority 32768
S3(config)# spanning-tree vlan 20 priority 32768
S3(config)# int port-channel 1
S3(config-if)# switchport trunk native vlan 99
S3(config)# int port-channel 4
S3(config-if)# switchport trunk native vlan 99

S4

Configure ports

S4(config)# int r g1/1 - 2
S4(config-if-range)# channel-group 2 mode active
S4(config)# int range f0/23-24
S4(config-if-range)# channel-group 4 mode active
S4(config)# int range f0/21-22
S4(config-if-range)# channel-group 5 mode active

Spaning-tree

S4(config)# spanning-tree mode rapid-pvst
S4(config)# spanning-tree vlan 10 priority 32768
S4(config)# spanning-tree vlan 20 priority 32768
S4(config)# int port-channel 2
S4(config-if)# switchport trunk native vlan 99
S4(config)# int port-channel 4
S4(config-if)# switchport trunk native vlan 99

R1

Configure ports

R1(config)# interface g0.1
R1(config-subif)# encapsylation dot1q 99 native
R1(config-subif)# ip address 192.168.99.1 255.255.255.0
R1(config)# int g0/10
R1(config-subif)# encapsulation dot 10
R1(config-subif)# ip add 192.168.10.1 255.255.255.0
R1(config)# int g0/20
R1(config-subif)# encapsulation dot 20
R1(config-subif)# ip add 192.168.20.1 255.255.255.0
R1(config)# int g0/0
R1(config-if)# no sh

OSPF

R1(config)# router ospf 1
R1(config-router)# network 192.168.99.0 0.0.0.255 area 0
R1(config-router)# network 192.168.10.0 0.0.0.255 area 0
R1(config-router)# network 192.168.20.0 0.0.0.255 area 0
R1(config-router)# passive interface 0/0.1
R1(config-router)# passive interface 0/0.10
R1(config-router)# passive interface 0/0.20

R2

Configure ports

R2(config)# interface g0.1
R2(config-subif)# encapsylation dot1q 99 native
R2(config-subif)# ip address 192.168.99.2 255.255.255.0
R2(config)# int g0/10
R2(config-subif)# encapsulation dot 10
R2(config-subif)# ip add 192.168.10.2 255.255.255.0
R2(config)# int g0/20
R2(config-subif)# encapsulation dot 20
R2(config-subif)# ip add 192.168.20.2 255.255.255.0
R2(config)# int g0/0
R2(config-if)# no sh

OSPF

R2(config)# router ospf 1
R2(config-router)# network 192.168.99.0 0.0.0.255 area 0
R2(config-router)# network 192.168.10.0 0.0.0.255 area 0
R2(config-router)# network 192.168.20.0 0.0.0.255 area 0
R2(config-router)# passive interface 0/0.1
R2(config-router)# passive interface 0/0.10
R2(config-router)# passive interface 0/0.20
#  CCNA3