Skip to main content

VLANlar o’rtasida marshrutizatsiya

Eski variant (lekin amaliyotda ishlatilmoqda)

Yaxshiroq yechim (Router on a stick)

L3 switch orqali marshutizatsiya

Marshutizatsiya asoslari

Amaliyot

Cisco Packet Tracer dasturini ishga tushuramiz va ishni 2 ta 2811 router qurilmasini o’rnatishdan boshlaymiz, keyin 2 ta 2960 switch olamiz va routerlarda serial interfeys o’rnatilmaganligi sababli qo’shimcha NM-4A/S modulini o’natamiz.

Keyingi bosqich kabellarni bog’lash bo’lib, 2 ta routerni se1/0 interfeysiga Serial DCE kabel turi orqali bog’lab olamiz. Qolgan qurilmalarni ham to’g’ri-to’g’ri bog’lanishli kabel orqali bog’lab olamiz.

Would you like to enter the initial configuration dialog? [yes/no]: no

Router 1 ni sozlaymiz:

Router(config)#hostname R1
R1(config)#interface se1/0
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#interface fa0/1
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shut

Router 2 ni sozlaymiz:

Router(config)#hostname R2
R1(config)#interface se1/0
R1(config-if)#ip address 192.168.0.2 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#interface fa0/1
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#no shut

Kompyuterlarga IP address beramiz:

PC0 IP: 192.168.1.50
Gateway: 192.168.1.1
PC0 IP: 192.168.2.50
Gateway: 192.168.2.1

Kompyuterdan routerga ping berib ko’ramiz:

ping 192.168.1.1

Kompyuterdan routerning serial interfeysiga ping berib ko’ramiz:

ping 192.168.0.1 – bunda ping ga javob bor
ping 192.168.0.2 – bunda ping ga javob yo’q, kompyuter ko’radi lekin javob signali yo’q.

Routerlarga marshrut yozamiz:

R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.0.1 
R2#show ip route
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.0.2
R1#show ip route

Floating static route/Administrative distance/ Load balancing

Administrative distance – bu marshrutlash ma’lumotlarining ishonchli manbasi. Bir xil manzilga turli xil marshrutlash protokollaridan foydalangan holda ikki yoki undan ortiq marshrut mavjud bo’lganda marshrutizatorlar optimal yo’nalishni tanlash uchun foydalaniladi.
Load balancing – bu marshrutdagi yuklanishni taqsimlash degadi.
Floating static route – bu aloqa uzilganda foydalanish uchun qo’shimcha rezerv aloqa hisoblanadi.

Routerlarga yangi se1/1 interfeysiga yana bitta kabel bog’laymiz.

Router 1 ni sozlaymiz:

R1(config)#interface se1/1
R1(config-if)#ip address 192.168.3.1 255.255.255.0
R1(config-if)#no shut

Router 2 ni sozlaymiz:

R2(config)#interface se1/1
R2(config-if)#ip address 192.168.3.2 255.255.255.0
R2(config-if)#no shut

Statik marshrutlarni sozlaymiz:

R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2
R1#show ip route
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1
R2#show ip route

Administrativ distance ni o’zgartiramiz:

R1(config)#no ip route 192.168.2.0 255.255.255.0 192.168.3.2
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2 10
R2(config)#no ip route 192.168.1.0 255.255.255.0 192.168.3.1
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1 10
R1#show ip route

Routing between VLANs

Amaliyot

Cisco 2811 routeridan 1 ta Cisco 2960 switchidan 1 ta va 2 ta kompyuterni bog’laymiz.

Switchni sozlamiz:

Switch(config)#interface vlan 51
Switch(config)#exit
Switch(config)#interface vlan 52
Switch(config)#interface fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 51
Switch(config)#interface fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 52
Switch(config)#interface fa0/3
Switch(config-if)#switchport mode trunk

Kompyuterlarga IP beramiz:

PC0 ga 192.168.1.50 Gateway 192.168.1.1
PC1 ga 192.168.2.50 Gateway 192.168.2.1

Routerni sozlamiz:

Router(config)#interface fa0/0.51
Router(config-subif)#encapsulation dot1Q 51
Router(config-subif)#ip address 192.168.1.1 255.255.255.0
Router(config)#exit
Router(config)#interface fa0/0.52
Router(config-subif)#encapsulation dot1Q 52
Router(config-subif)#ip address 192.168.2.1 255.255.255.0
Router(config)#exit
Router(config)#interface fa0/0
Router(config-if)#no shut