First of all we will make the network topology as in the following picture,
If you've made a topology like the picture above, then we fill in the PC IP address of each PC
then we make vlan in switch 1 with command,
Switch>en
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
Switch(config-if)#ex
Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
Switch(config-if)#ex
Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 40
Switch(config-if)#ex
Switch(config)#int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 40
Switch(config-if)#ex
Switch(config)#int fa0/1(yang menuju ke router)
Di router 2
Router(config)#ip route 192.168.40.48 255.255.255.240 192.168.5.5
Router(config)#ip route 192.168.30.32 255.255.255.240 192.168.5.5
Then We already connect between our routers check if succes we further set the Server like this,
add Ip server
We also dns settings to be accessible via the browser on pc configuration
And the result
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name Muhammad-Zaid
Switch(config-vlan)#ex
Switch(config)#vlan 20
Switch(config-vlan)#name Misbakhul-Munir
Switch(config-vlan)#ex
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name Muhammad-Zaid
Switch(config-vlan)#ex
Switch(config)#vlan 20
Switch(config-vlan)#name Misbakhul-Munir
Switch(config-vlan)#ex
then Also in Switch 0,
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 30
Switch(config-vlan)#name pakeko
Switch(config-vlan)#ex
Switch(config)#vlan 40
Switch(config-vlan)#name masheru
Switch(config-vlan)#ex
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 30
Switch(config-vlan)#name pakeko
Switch(config-vlan)#ex
Switch(config)#vlan 40
Switch(config-vlan)#name masheru
Switch(config-vlan)#ex
next we go for Pc 0-1 to vlan 10 Pc 2-3 to vlan 20,
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex
Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex
Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#ex
Switch(config)#int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#ex
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex
Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex
Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#ex
Switch(config)#int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#ex
and also in pc 4-5 we input into vlan 30 and pc 6-7 to vlan 40
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
Switch(config-if)#ex
Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
Switch(config-if)#ex
Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 40
Switch(config-if)#ex
Switch(config)#int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 40
Switch(config-if)#ex
Then we add ip on the 2nd part router fa0 / 0 and 0/1 with configuration like this,
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/1
Router(config-if)#ip add 192.168.5.7 255.255.255.128
Router(config-if)#no shut
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.20.64 255.255.255.192
Router(config-if)#no shut
Router(config-if)#ex
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/1
Router(config-if)#ip add 192.168.5.7 255.255.255.128
Router(config-if)#no shut
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.20.64 255.255.255.192
Router(config-if)#no shut
Router(config-if)#ex
and also we add ip on router 0 with configuration like this,
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/1
Router(config-if)#ip add 192.168.5.6 255.255.255.128
Router(config-if)#no shut
Router(config-if)#ex
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.10.11 255.255.255.0
Router(config-if)#no shut
Router(config-if)#ex
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/1
Router(config-if)#ip add 192.168.5.6 255.255.255.128
Router(config-if)#no shut
Router(config-if)#ex
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.10.11 255.255.255.0
Router(config-if)#no shut
Router(config-if)#ex
if we have registered vlan 10 and 20 to router 2 with configuration like this,
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/1.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip add 192.168.10.35 255.255.255.224
Router(config-subif)#no shut
Router(config-subif)#ex
Router(config)#int fa0/1.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip add 192.168.20.35 255.255.255.224
Router(config-subif)#no shut
Router(config-subif)#ex
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/1.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip add 192.168.10.35 255.255.255.224
Router(config-subif)#no shut
Router(config-subif)#ex
Router(config)#int fa0/1.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip add 192.168.20.35 255.255.255.224
Router(config-subif)#no shut
Router(config-subif)#ex
then we also add vlan 30 and 40 in router 0 with configuration like this,
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0.30
Router(config-subif)#encapsulation dot1Q 30
Router(config-subif)#ip add 192.168.30.35 255.255.255.240
Router(config-subif)#no shut
Router(config-subif)#ex
Router(config)#int fa0/0.40
Router(config-subif)#encapsulation dot1Q 40
Router(config-subif)#ip add 192.168.40.51 255.255.255.240
Router(config-subif)#no shut
Router(config-subif)# exit
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0.30
Router(config-subif)#encapsulation dot1Q 30
Router(config-subif)#ip add 192.168.30.35 255.255.255.240
Router(config-subif)#no shut
Router(config-subif)#ex
Router(config)#int fa0/0.40
Router(config-subif)#encapsulation dot1Q 40
Router(config-subif)#ip add 192.168.40.51 255.255.255.240
Router(config-subif)#no shut
Router(config-subif)# exit
Next we will connect the two VLANs by making the Trunk configuration on both switches as below:
Switch1
Switch(config)#int fa0/5(yang menuju ke router)
Switch(config-if)#switchport mode trunk
Switch(config-if)#
di switch 7
Switch(config)#int fa0/1(yang menuju ke router)
Switch(config-if)#switchport mode trunk
Switch(config-if)#ex
Switch(config)#int fa0/3(yang menuju ke router)
Switch(config)#int fa0/3(yang menuju ke router)
Switch(config-if)#switchport mode trunk
di switch 0
Switch(config)#int fa0/5(yang menuju ke router)
Switch(config-if)#switchport mode trunk
If
we have previously written the vlan configuration in switch 3 with the
aim that vlan 10 and 20 can be accessed with configuration like this,
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#ex
Switch(config)#vlan 20
Switch(config-vlan)#ex
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#ex
Switch(config)#vlan 20
Switch(config-vlan)#ex
Next we will connect router 0 and router 2 by using ip route, its configuration like this,
Di Router 0
Router(config)#ip route 192.168.20.64 255.255.255.192 192.168.5.6
Router(config)#ip route 192.168.10.32 255.255.255.224 192.168.5.6
Router(config)#ip route 192.168.20.32 255.255.255.224 192.168.5.6
Di router 2
Router(config)#ip route 192.168.40.48 255.255.255.240 192.168.5.5
Router(config)#ip route 192.168.30.32 255.255.255.240 192.168.5.5
Then We already connect between our routers check if succes we further set the Server like this,
add Ip server
We also dns settings to be accessible via the browser on pc configuration
And the result