Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pr:laboratoare:09 [2016/12/15 19:01]
sergiu.costea [GRE (4p)]
pr:laboratoare:09 [2025/07/27 14:49] (current)
Line 1: Line 1:
-===== Laboratorul 09. GRE și IPsec ===== +===== Laboratorul 09. =====
- +
-==== Topologie ==== +
- +
-{{ :​pr:​laboratoare:​9_topologie.png |}} +
- +
-==== Cerințe ==== +
- +
-=== Setup === +
-<note important>​ Descărcați configurațiile inițiale de {{:​pr:​laboratoare:​08_bgp_initial_configs.zip|aici}}. </​note>​ +
- +
-=== Exerciții === +
-<note info> +
-Toate configurațiile au fost încărcate pe rutere. Nu începeți taskurile acestui laborator fără să încărcați initial_configs. +
-</​note>​ +
- +
- +
-==== GRE ==== +
- +
-1. [5p] Conectivitatea între Lucario și Machop a fost deja configurată folosind OSPF. Verificați faptul că Lucario poate da ping cu succes în Machop. +
- +
-2. [10p] Configurați un tunel GRE între Lucario și Machop. Folosiți pentru sursă și destinație interfețele fizice. Pentru partea de adresare, folosiți adrese din rețeaua 192.168.0.0/​30. +
- +
-3. [10p] Folosind rute statice, configurați ca traficul între interfețele Lo1 ale lui Lucario și Machop să treacă prin tunelul GRE. Testați folosind ''​traceroute''​. +
- +
-<note hint> +
-Pentru testare, folosiți opțiunea ''​source''​ a comenzii ''​traceroute''​. +
-</​note>​ +
- +
-<​solution -hidden -en> +
- +
-On **R1**: +
-<​code>​ +
-R1(config)#​interface Tunnel 0 +
-*Jan 14 22:​11:​14.371:​ %LINEPROTO-5-UPDOWN:​ Line protocol on Interface Tunnel0, changed state to down +
-R1(config-if)#​tunnel destination 192.168.23.3  +
-R1(config-if)#​tunnel source 192.168.12.1 ​    +
-*Jan 14 22:​11:​44.219:​ %LINEPROTO-5-UPDOWN:​ Line protocol on Interface Tunnel0, changed state to up +
-R1(config-if)#​ip address 13.13.13.1 255.255.255.248 +
-R1(config-if)#​exit +
-R1(config)#​ip route 11.3.3.0 255.255.255.0 13.13.13.3 +
-</​code>​ +
- +
-On **R3**: +
-<​code>​ +
-R3(config)#​interface Tunnel 0 +
-R3(config-if)#​tunnel source 192.168 +
-*Jan 14 22:​12:​27.599:​ %LINEPROTO-5-UPDOWN:​ Line protocol on Interface Tunnel0, changed state to down +
-R3(config-if)#​tunnel source 192.168.23.3 +
-R3(config-if)#​tunnel destination 192.168.12.1 +
-*Jan 14 22:​12:​36.351:​ %LINEPROTO-5-UPDOWN:​ Line protocol on Interface Tunnel0, changed state to up +
-R3(config-if)#​ip address 13.13.13.3 255.255.255.248 +
-R3(config-if)#​exit +
-R3(config)#​ip route 11.1.1.0 255.255.255.0 13.13.13.1 +
-</​code>​ +
- +
-If OSPF is running, the following commands are required to advertise the true loopback subnet masks (instead of the /32 masks): +
- +
-On **R1**: +
-<​code>​ +
-R1(config)#​interface Loopback 1 +
-R1(config-if)#​ip ospf network point-to-point +
-R1(config-if)#​exit +
-</​code>​ +
- +
-On **R3**: +
-<​code>​ +
-R3(config)#​interface Loopback 1 +
-R3(config-if)#​ip ospf network point-to-point +
-R3(config-if)#​exit +
-</​code>​ +
- +
-Test that traffic passes through the tunnel: +
-<​code>​ +
-R1#​traceroute 11.3.3.3 ​  +
-Translating "​11.3.3.3"​ +
- +
-Type escape sequence to abort. +
-Tracing the route to 11.3.3.3 +
- +
-  1 13.13.13.3 48 msec *  16 msec +
-</​code>​ +
- +
-</​solution>​ +
- +
- +
-==== IPSec  ==== +
-Dorim să criptăm traficul dintre Lo0 de pe Lucario și Lo0 de pe Machop. Vom configura un tunel IPsec între cele două rutere. +
- +
-4. [15p] Configurați următoarea politică ISAKMP pe Lucario și Machop: +
-  * autentificare:​ pre-shared keys  +
-  * criptare: aes 256  +
-  * hash: sha1  +
-  * grup diffie-hellman:​ 2  +
-  * lifetime: 3600  +
- +
-<​solution -hidden -en> +
-On **R1**: +
-<​code>​ +
-R1(config)#​crypto isakmp policy 1  +
-R1(config-isakmp)#​authentication pre-share +
-R1(config-isakmp)#​encryption aes 256 +
-R1(config-isakmp)#​hash sha +
-R1(config-isakmp)#​group 2 +
-R1(config-isakmp)#​lifetime 3600 +
-R1(config-isakmp)#​exit +
-</​code>​ +
- +
-On **R3**: +
-<​code>​ +
-R3(config)#​crypto isakmp policy 1 +
-R3(config-isakmp)#​authentication pre-share +
-R3(config-isakmp)#​encryption aes 256 +
-R3(config-isakmp)#​hash sha +
-R3(config-isakmp)#​group 2 +
-R3(config-isakmp)#​lifetime 3600 +
-R3(config-isakmp)#​exit +
-</​code>​ +
-</​solution>​ +
- +
-5. [10p] Configurați '​prrulz'​ ca pre-shared key pe Lucario și Machop. +
- +
-<​solution -hidden -en> +
- +
-On **R1**: +
-<​code>​ +
-R1(config)#​crypto isakmp key 0 srs!@# address 192.168.23.3 +
-</​code>​ +
- +
-On **R3**: +
-<​code>​ +
-R3(config)#​crypto isakmp key 0 srs!@# address 192.168.12.1 +
-</​code>​ +
- +
-</​solution>​ +
- +
-6. [10p] Configurați următorul transform set pe Lucario și Machop: +
-  * Nume: TS_PR  +
-  * Transform set: esp-aes 256 esp-sha-hmac  +
-  * Mod: transport  +
- +
-<​solution -hidden -en> +
- +
-On **R1**: +
-<​code>​ +
-R1(config)#​crypto ipsec transform-set TS_SRS esp-aes 256 esp-sha-hmac  +
-R1(cfg-crypto-trans)#​mode transport +
-R1(cfg-crypto-trans)#​exit +
-</​code>​ +
- +
-On **R3**: +
-<​code>​ +
-R3(config)#​crypto ipsec transform-set TS_SRS esp-aes 256 esp-sha-hmac +
-R3(cfg-crypto-trans)#​mode transport +
-R3(cfg-crypto-trans)#​exit +
-</​code>​ +
- +
-</​solution>​ +
- +
-7. [20p] Creați câte un ACL pe Lucario și Machop care să facă match pe traficul ce urmează să fie criptat (traficul dintre Lo0 Lucario - Lo0 Machop). +
- +
-<​solution -hidden -en> +
-On **R1**: +
-<​code>​ +
-R1(config)#​ip access-list extended INTERESTING +
-R1(config-ext-nacl)#​permit ip host 10.1.1.1 host 10.3.3.3 +
-R1(config-ext-nacl)#​exit +
-</​code>​ +
- +
-On **R3**: +
-<​code>​ +
-R3(config)#​ip access-list extended INTERESTING +
-R3(config-ext-nacl)#​permit ip host 10.3.3.3 host 10.1.1.1 +
-R3(config-ext-nacl)#​exit +
-</​code>​ +
- +
-</​solution>​ +
- +
-8. [10p] Creați un crypto map pe Lucario și Machop. Aveți în vedere următoarele aspecte: +
-  * crypto map-ul trebuie să selecteze traficul conform ACL-ului +
-  * folosiți interfețele fizice drept capetele tunelului IPsec  +
-  * folosiți transform set-ul configurat anterior +
- +
-Aplicați crypto map-ul pe interfețele fizice de pe Lucario și Machop. +
- +
-<​solution -hidden -en> +
-On **R1**: +
-<​code>​ +
-R1(config)#​crypto map TUNNEL_MAP 10 ipsec-isakmp  +
-% NOTE: This new crypto map will remain disabled until a peer +
-        and a valid access list have been configured. +
-R1(config-crypto-map)#​set peer 192.168.23.3 +
-R1(config-crypto-map)#​match address INTERESTING +
-R1(config-crypto-map)#​set transform-set TS_SRS +
-R1(config-crypto-map)#​exit +
-</​code>​ +
- +
-On **R3**: +
-<​code>​ +
-R3(config)#​crypto map TUNNEL_MAP 10 ipsec-isakmp +
-% NOTE: This new crypto map will remain disabled until a peer +
-        and a valid access list have been configured. +
-R3(config-crypto-map)#​set peer 192.168.12.1 +
-R3(config-crypto-map)#​match address INTERESTING +
-R3(config-crypto-map)#​set transform-set TS_SRS +
-R3(config-crypto-map)#​exit +
-</​code>​ +
- +
-</​solution>​ +
- +
- +
-9. [10p] Testați tunelul generând trafic între Lo0 de pe Lucario și Lo0 de pe Machop. Afișați SA-urile create și verificați incrementarea contoarelor de trafic. +
-<​solution -hidden -en> +
-<​code>​ +
-R1(config-if)#​crypto map TUNNEL_MAP +
-R1(config-if)#​ +
-*Jan 14 20:​24:​25.355:​ %CRYPTO-6-ISAKMP_ON_OFF:​ ISAKMP is ON +
-R1(config-if)#​exit +
-</​code>​ +
- +
-<​code>​ +
-R3(config-if)#​crypto map TUNNEL_MAP +
-R3 +
-Construct an access-list that will match the traffic that you want to encrypt.  +
-  * The access-list will have to define both the source and the destination of the traffic.  +
-  * An access-list must be defined on both R1 and R3.  +
-  * Watch out for the fact that the 2 ACLs must mirror each other.  +
-  * The access-list can match all IP traffic(config-if)#​ +
-*Jan 14 20:​24:​31.351:​ %CRYPTO-6-ISAKMP_ON_OFF:​ ISAKMP is ON +
-R3(config-if)#​exit +
-</​code>​ +
- +
-Create traffic to start tunnel setup: +
-<​code>​ +
-R1#ping 10.3.3.3 source 10.1.1.1 +
-Translating "​10.3.3.3"​ +
- +
-Type escape sequence to abort. +
-Sending 5, 100-byte ICMP Echos to 10.3.3.3, timeout is 2 seconds: +
-Packet sent with a source address of 10.1.1.1  +
-.!!!! +
-Success rate is 80 percent (4/5), round-trip min/avg/max = 12/14/20 ms +
-</​code>​ +
- +
-Check security associations:​ +
-<​code>​ +
-R1#show crypto isakmp sa +
-IPv4 Crypto ISAKMP SA +
-dst             ​src ​            ​state ​         conn-id slot status +
-192.168.23.3 ​   192.168.12.1 ​   QM_IDLE ​          ​1001 ​   0 ACTIVE +
- +
-IPv6 Crypto ISAKMP SA +
- +
-R1#show crypto ipsec sa +
- +
-interface: FastEthernet0/​0 +
-    Crypto map tag: TUNNEL_MAP, local addr 192.168.12.1 +
- +
-   ​protected vrf: (none) +
-   ​local ​ ident (addr/​mask/​prot/​port):​ (10.1.1.1/​255.255.255.255/​0/​0) +
-   ​remote ident (addr/​mask/​prot/​port):​ (10.3.3.3/​255.255.255.255/​0/​0) +
-   ​current_peer 192.168.23.3 port 500 +
-     ​PERMIT,​ flags={origin_is_acl,​} +
-    #pkts encaps: 4, #pkts encrypt: 4, #pkts digest: 4 +
-    #pkts decaps: 4, #pkts decrypt: 4, #pkts verify: 4 +
-    #pkts compressed: 0, #pkts decompressed:​ 0 +
-    #pkts not compressed: 0, #pkts compr. failed: 0 +
-    #pkts not decompressed:​ 0, #pkts decompress failed: 0 +
-    #send errors 1, #recv errors 0 +
- +
-     local crypto endpt.: 192.168.12.1,​ remote crypto endpt.: 192.168.23.3 +
-     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0/​0 +
-     ​current outbound spi: 0xD480DB37(3565214519) +
- +
-     ​inbound esp sas: +
-      spi: 0xB3825B11(3011664657) +
-        transform: esp-256-aes esp-sha-hmac , +
-        in use settings ={Tunnel, } +
-        conn id: 1, flow_id: SW:1, crypto map: TUNNEL_MAP +
-        sa timing: remaining key lifetime (k/sec): (4558528/​3557) +
-        IV size: 16 bytes +
-        replay detection support: Y +
-        Status: ACTIVE +
- +
-     ​inbound ah sas: +
- +
-     ​inbound pcp sas: +
- +
-     ​outbound esp sas: +
-      spi: 0xD480DB37(3565214519) +
-        transform: esp-256-aes esp-sha-hmac , +
-        in use settings ={Tunnel, } +
-        conn id: 2, flow_id: SW:2, crypto map: TUNNEL_MAP +
-        sa timing: remaining key lifetime (k/sec): (4558528/​3555) +
-        IV size: 16 bytes +
-        replay detection support: Y +
-        Status: ACTIVE +
- +
-     ​outbound ah sas: +
- +
-     ​outbound pcp sas: +
-</​code>​ +
- +
- +
-</​solution>​ +
- +
-10. [10p] Folosind Wireshark, interceptați traficul criptat dintre Lucario și Machop. +
- +
-<note hint> +
-  * Folosiți comanda ''​capture''​ din consola **dynagen** pentru a porni o captură +
-  * Generați trafic ce trece prin tunel +
-  * Opriți captura de trafic din consola dynagen +
-  * Deschideți fișierul de captură rezultat folosind Wireshark +
-</​note>​+
  
  
pr/laboratoare/09.1481821301.txt.gz · Last modified: 2016/12/15 19:01 by sergiu.costea
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0