From: xf0r3m Date: Sat, 5 Oct 2024 18:35:20 +0000 (+0200) Subject: Rozpoczęcie pisania rozdziału 15, modułu 2, kursu CCNA. X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=28be8e4be14fc5ccab39f7ed7350637d66ffecd1;p=mmdev.git Rozpoczęcie pisania rozdziału 15, modułu 2, kursu CCNA. --- diff --git a/articles/terminallog/Cisco_-_CCNA.html b/articles/terminallog/Cisco_-_CCNA.html index 70c76b7..7ef5238 100755 --- a/articles/terminallog/Cisco_-_CCNA.html +++ b/articles/terminallog/Cisco_-_CCNA.html @@ -11239,6 +11239,301 @@ Router(config)# ipv6 route 2001:db8:acad:4::/64 fe80::2:c opisaliśmy sobie wewnętrzne protokoły routingu - w jaki sposób wybierają trasę.

+

2.15. Statyczny routing IP

+

+ W poprzednim rodziale poznaliśmy polecenie za pomocą, które możemy + dodać trasy statyczne IP do tablicy routingu, ale to nie jest wszystko. + Samych tras statyczny mogą być trzy rodzaje: +

+ +

+ W trasach statycznych jednym z parametrów potrzebnych do jej utworzenia + jest podanie następnego skoku i to w jaki sposób podamy ten parametr, + a możemy na trzy sposoby definiujej kolejne typy tras statycznych. +

+ +

+ Polecenie ip route, odpowiedzialne za + dodawanie tras statycznych do tablicy routingu w raz argumentami + wygląda następująco: +

+
+Router(config)#ip route network-address subnet-mask { ip-address | exit-intf [ip-address] } [distance]
+
+ +

+ Dla IPv6 wyżej wymienione polecenie wygląda następująco: +

+
+Router(config)#ipv6 route prefix/prefix-length { ipv6-address | exit-intf [ipv6-address] } [distance]
+
+ +

+ W celu dalszego omawiania konfiguracji sieci statycznych, stworzyłem + w PT taką o to topologię. +

+

+ +

+

+ Po skonfigurowaniu adresów w tablicy routingu nie ma żadnych wpisów + poza trasami bezpośrednio podłączonymi oraz lokalnymi. Poniżej znajduje + się zrzut tablicy z routera R2. +

+
+R2#show ip route
+Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
+       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
+       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
+       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
+       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
+       * - candidate default, U - per-user static route, o - ODR
+       P - periodic downloaded static route
+
+Gateway of last resort is not set
+
+     172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
+C       172.16.1.0/24 is directly connected, Vlan1
+L       172.16.1.1/32 is directly connected, Vlan1
+C       172.16.2.0/24 is directly connected, GigabitEthernet0/0
+L       172.16.2.2/32 is directly connected, GigabitEthernet0/0
+     192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
+C       192.168.1.0/24 is directly connected, GigabitEthernet0/1
+L       192.168.1.2/32 is directly connected, GigabitEthernet0/1
+R2#show ipv6 route
+IPv6 Routing Table - 7 entries
+Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
+       U - Per-user Static route, M - MIPv6
+       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
+       ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
+       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
+       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
+       D - EIGRP, EX - EIGRP external
+C   2001:DB8:ACAD:1::/64 [0/0]
+     via Vlan1, directly connected
+L   2001:DB8:ACAD:1::1/128 [0/0]
+     via Vlan1, receive
+C   2001:DB8:ACAD:2::/64 [0/0]
+     via GigabitEthernet0/0, directly connected
+L   2001:DB8:ACAD:2::2/128 [0/0]
+     via GigabitEthernet0/0, receive
+C   2001:DB8:CAFE:1::/64 [0/0]
+     via GigabitEthernet0/1, directly connected
+L   2001:DB8:CAFE:1::2/128 [0/0]
+     via GigabitEthernet0/1, receive
+L   FF00::/8 [0/0]
+     via Null0, receive
+
+

+ W celu powtórzenia poleceń z po poprzeniego rozdziału możemy sobie + sprawdzić zarówno tablice routingu poszczególnych routerów jak i + spróbować spingować komputery między sobą. Pamiętajmy aby nadać adresy + IP komputerom przez wydaniem polecenia ping. +

+

2.15.1. Konfigurowanie tras statycznych IP

+

+ Jeśli wykonaliśmy sprawdzenie łączności między komputerami to wiemy + się one niepowiodły, aby mógł zajść routing między tymi sieciami + musimy w najgorszym przypadku skonfigurować trasy statyczne na każdym + z routerów wskazując pokolei adresy następnego skoku przez, które + osiągalne są następujące sieci. Tak wyglądają polecenia wpisane + na poszczególnych routerach. +

+
+#R1:
+R1(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.2
+R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.2.2
+R1(config)#ipv6 route 2001:db8:acad:1::/64 2001:db8:acad:2::2
+R1(config)#ipv6 route 2001:db8:cafe:2::/64 2001:db8:acad:2::2
+
+#R2:
+R2(config)#ip route 172.16.3.0 255.255.255.0 172.16.2.1
+R2(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.1
+R2(config)#ipv6 route 2001:db8:acad:3::/64 2001:db8:acad:2::1
+R2(config)#ipv6 route 2001:db8:cafe:2::/64 2001:db8:cafe:1::1
+
+#R3:
+R3(config)#ip route 172.16.1.0 255.255.255.0 192.168.1.2
+R3(config)#ip route 172.16.3.0 255.255.255.0 192.168.1.2
+R3(config)#ipv6 route 2001:db8:acad:1::/64 2001:db8:cafe:1::2
+R3(config)#ipv6 route 2001:db8:acad:3::/64 2001:db8:cafe:1::2
+
+

+ Teraz polecenie ping pomiędzy wszystkimi komputerami powinno + się udać. Warto zwrócić uwagę na to, że R1 nie musi mieć trasy do sieci + między R2 a R3 i vice versa. R3 nie musi mieć trasy do sieci między + R2 a R1, żeby komputery mogły się ze sobą komunikować. + W ten sposób stworzyliśmy trasy następnego skoku. Tablice routingu + routera R2 prezentują się w następujący sposób: +

+
+R2#show ip route | begin Gateway
+Gateway of last resort is not set
+
+     172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
+C       172.16.1.0/24 is directly connected, Vlan1
+L       172.16.1.1/32 is directly connected, Vlan1
+C       172.16.2.0/24 is directly connected, GigabitEthernet0/0
+L       172.16.2.2/32 is directly connected, GigabitEthernet0/0
+S       172.16.3.0/24 [1/0] via 172.16.2.1
+     192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
+C       192.168.1.0/24 is directly connected, GigabitEthernet0/1
+L       192.168.1.2/32 is directly connected, GigabitEthernet0/1
+S    192.168.2.0/24 [1/0] via 192.168.1.1
+	
+R2#show ipv6 route
+IPv6 Routing Table - 9 entries
+...
+C   2001:DB8:ACAD:1::/64 [0/0]
+     via Vlan1, directly connected
+L   2001:DB8:ACAD:1::1/128 [0/0]
+     via Vlan1, receive
+C   2001:DB8:ACAD:2::/64 [0/0]
+     via GigabitEthernet0/0, directly connected
+L   2001:DB8:ACAD:2::2/128 [0/0]
+     via GigabitEthernet0/0, receive
+S   2001:DB8:ACAD:3::/64 [1/0]
+     via 2001:DB8:ACAD:2::1
+C   2001:DB8:CAFE:1::/64 [0/0]
+     via GigabitEthernet0/1, directly connected
+L   2001:DB8:CAFE:1::2/128 [0/0]
+     via GigabitEthernet0/1, receive
+S   2001:DB8:CAFE:2::/64 [1/0]
+     via 2001:DB8:CAFE:1::1
+L   FF00::/8 [0/0]
+     via Null0, receive
+
+

+ Następnym rodzajem tras statycznych są trasy bezpośrednio podłączone. + Konfigurując naszą topologię, zamiast adresu następne skoku, podajemy + interfejs wyjściowy, w moim przypadku będzie Gig0/0 oraz + Gig0/1 (w przypadku R2). +

+
+#R1:
+R1(config)#ip route 172.16.1.0 255.255.255.0 gig0/0
+%Default route without gateway, if not a point-to-point interface, may impact performance
+R1(config)#ip route 192.168.2.0 255.255.255.0 gig0/0
+%Default route without gateway, if not a point-to-point interface, may impact performance
+R1(config)#ipv6 route 2001:db8:acad:1::/64 gig0/0
+R1(config)#ipv6 route 2001:db8:cafe:2::/64 gig0/0
+
+#R2: 
+R2(config)#ip route 172.16.3.0 255.255.255.0 gig0/0
+%Default route without gateway, if not a point-to-point interface, may impact performance
+R2(config)#ip route 192.168.2.0 255.255.255.0 gig0/1
+%Default route without gateway, if not a point-to-point interface, may impact performance
+R2(config)#ipv6 route 2001:db8:acad:3::/64 gig0/0
+R2(config)#ipv6 route 2001:db8:cafe:2::/64 gig0/1
+
+#R3:
+R3(config)#ip route 172.16.1.0 255.255.255.0 gig0/0
+%Default route without gateway, if not a point-to-point interface, may impact performance
+R3(config)#ip route 172.16.3.0 255.255.255.0 gig0/0
+%Default route without gateway, if not a point-to-point interface, may impact performance
+R3(config)#ipv6 route 2001:db8:acad:1::/64 gig0/0
+R3(config)#ipv6 route 2001:db8:acad:3::/64 gig0/0
+
+R2#show ip route | begin Gateway
+Gateway of last resort is not set
+
+     172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
+C       172.16.1.0/24 is directly connected, Vlan1
+L       172.16.1.1/32 is directly connected, Vlan1
+C       172.16.2.0/24 is directly connected, GigabitEthernet0/0
+L       172.16.2.2/32 is directly connected, GigabitEthernet0/0
+S       172.16.3.0/24 is directly connected, GigabitEthernet0/0
+     192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
+C       192.168.1.0/24 is directly connected, GigabitEthernet0/1
+L       192.168.1.2/32 is directly connected, GigabitEthernet0/1
+S    192.168.2.0/24 is directly connected, GigabitEthernet0/1
+
+R2#show ipv6 route
+IPv6 Routing Table - 9 entries
+Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
+       U - Per-user Static route, M - MIPv6
+       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
+       ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
+       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
+       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
+       D - EIGRP, EX - EIGRP external
+C   2001:DB8:ACAD:1::/64 [0/0]
+     via Vlan1, directly connected
+L   2001:DB8:ACAD:1::1/128 [0/0]
+     via Vlan1, receive
+C   2001:DB8:ACAD:2::/64 [0/0]
+     via GigabitEthernet0/0, directly connected
+L   2001:DB8:ACAD:2::2/128 [0/0]
+     via GigabitEthernet0/0, receive
+S   2001:DB8:ACAD:3::/64 [1/0]
+     via GigabitEthernet0/0, directly connected
+C   2001:DB8:CAFE:1::/64 [0/0]
+     via GigabitEthernet0/1, directly connected
+L   2001:DB8:CAFE:1::2/128 [0/0]
+     via GigabitEthernet0/1, receive
+S   2001:DB8:CAFE:2::/64 [1/0]
+     via GigabitEthernet0/1, directly connected
+L   FF00::/8 [0/0]
+     via Null0, receive
+
+

+ Tego rodzaju trasy są przeznaczone dla połączeń szeregowych punkt-punkt + o czym informuje nas IOS podczas dodawania takiej trasy IPv4. + Trasy IPv4 działają, i komunikacja z dość widocznym opoźnieniem + dochodzi do skutku, natomiast w przypadku IPv6 próby pingowania się + komputerów nawzajem nie dochodzi do skutku. Teraz mimo że dwie trasy + zostały dodane statyczne, to wyświetlane jest tablicy + directly connected. +