دوره CCNA فصل ۱۱ - استاتیک روتینگ بخش دوم

از پاپیروس
پرش به ناوبریپرش به جستجو
en
conf t
hostname HQ
int g 0/0
no sh
ip add 10.10.10.1 255.255.255.0
int g 0/1
no sh
ip add 10.10.20.1 255.255.255.0
int g 0/0/0
no sh
ip add 150.150.150.1 255.255.255.0
int g 0/1/0
no sh
ip add 200.200.200.1 255.255.255.0
end
BR1:
en
conf t
hostname BR1
int g 0/0/0
no sh
ip add 150.150.150.2 255.255.255.0
int g 0/0
no sh
ip add 10.10.30.1 255.255.255.0
end
BR2:
en
conf t
hostname BR2
int g 0/0/0
no sh
ip add 200.200.200.2 255.255.255.0
int g 0/0
no sh
ip add 10.10.40.1 255.255.255.0
end

تا اینجا فقط به روترها آی‌پی داده‌ایم.
برای اینکه end deviceها بتوانند یکدیگر را ping کنند باید این کامند‌ها را در روترها بزنیم:

HQ
(c)#ip route 10.10.30.0 255.255.255.0 150.150.150.2
(c)#ip route 10.10.40.0 255.255.255.0 200.200.200.2
BR1:
(c)#ip route 10.10.10.0 255.255.255.0 150.150.150.1
(c)#ip route 10.10.20.0 255.255.255.0 150.150.150.1
(c)#ip route 10.10.40.0 255.255.255.0 150.150.150.1
BR2:
(c)#ip route 10.10.10.0 255.255.255.0 200.200.200.1
(c)#ip route 10.10.20.0 255.255.255.0 200.200.200.1
(c)#ip route 10.10.30.0 255.255.255.0 200.200.200.1

می‌توانیم در BR1 و BR2 دستورات را خلاصه کنیم. به این صورت:

BR1:
(c)#ip route 10.10.0.0 255.255.0.0 150.150.150.1
BR2:
(c)#ip route 10.10.0.0 255.255.0.0 200.200.200.1

اگر چه هم‌اکنون همه‌ی end deviceها می‌توانند یکدیگر را ping کنند اما
PC1 نمی‌تواند 200.200.200.1 یا 2 را ping کند.
یا
PC2 نمی‌تواند 150.150.150.1 یا 2 را ping کند.
برای حل این مشکل می‌توانیم در BR1 و BR2 این دستورات را بزنیم:

BR1:
(c)#ip route 200.200.200.0 255.255.255.0 150.150.150.1
BR2:
(c)#ip route 150.150.150.0 255.255.255.0 200.200.200.1

در حال حاضر دانش روترها یا همان routing table آنها به این صورت است (با زدن دستور show ip route در محیط privileged می‌توان مشاهده کرد):

HQ:
     10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C       10.10.10.0/24 is directly connected, GigabitEthernet0/0
L       10.10.10.1/32 is directly connected, GigabitEthernet0/0
C       10.10.20.0/24 is directly connected, GigabitEthernet0/1
L       10.10.20.1/32 is directly connected, GigabitEthernet0/1
S       10.10.30.0/24 [1/0] via 150.150.150.2
S       10.10.40.0/24 [1/0] via 200.200.200.2
     150.150.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       150.150.150.0/24 is directly connected, GigabitEthernet0/0/0
L       150.150.150.1/32 is directly connected, GigabitEthernet0/0/0
     200.200.200.0/24 is variably subnetted, 2 subnets, 2 masks
C       200.200.200.0/24 is directly connected, GigabitEthernet0/1/0
L       200.200.200.1/32 is directly connected, GigabitEthernet0/1/0
BR1:
     10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
S       10.10.0.0/16 [1/0] via 150.150.150.1
C       10.10.30.0/24 is directly connected, GigabitEthernet0/0
L       10.10.30.1/32 is directly connected, GigabitEthernet0/0
     150.150.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       150.150.150.0/24 is directly connected, GigabitEthernet0/0/0
L       150.150.150.2/32 is directly connected, GigabitEthernet0/0/0
S    200.200.200.0/24 [1/0] via 150.150.150.1
BR2:
     10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
S       10.10.0.0/16 [1/0] via 200.200.200.1
C       10.10.40.0/24 is directly connected, GigabitEthernet0/0
L       10.10.40.1/32 is directly connected, GigabitEthernet0/0
     150.150.0.0/24 is subnetted, 1 subnets
S       150.150.150.0/24 [1/0] via 200.200.200.1
     200.200.200.0/24 is variably subnetted, 2 subnets, 2 masks
C       200.200.200.0/24 is directly connected, GigabitEthernet0/0/0
L       200.200.200.2/32 is directly connected, GigabitEthernet0/0/0

خطوط highlight شده routeهای استاتیک هستند که به صورت دستی وارد شده اند. در صورتی که بخواهیم فقط استاتیک‌ها را ببینیم می‌توانیم در محیط privileged دستور show ip route static را بزنیم.