Konfiguracja sieci VPN na routerach CISCO

1. Zbuduj sieć na podstawie poniższego schematu topologii: 2. Ustaw interfejsy sieciowe routerów:

◦ R1:

Router# config t

Router(config)# hostname R1

R1(config)# int f1/0

R1(config-if)# ip address 10.5.6.1 255.255.255.0

R1(config-if)# no shutdown

R1(config-if)# exit

◦ R2:

Router# config t

Router(config)# hostname R2

R2(config)# int f1/0

R2(config-if)# ip address 10.5.6.2 255.255.255.0

R2(config-if)# no shutdown

R2(config-if)# exit

R2(config)# int f1/1

R2(config-if)# ip address 14.15.16.1 255.255.255.0

R2(config-if)# no shutdown

R2(config-if)# exit

◦ R3:

Router# config t

Router(config)# hostname R3

R3(config)# int f1/0

R3(config-if)# ip address 14.15.16.2 255.255.255.0

R3(config-if)# no shutdown

R3(config-if)# exit

R3(config)# int f1/1

R3(config-if)# ip address 22.23.24.1 255.255.255.0

R3(config-if)# no shutdown

R3(config-if)# exit

◦ R4:

Router# config t

Router(config)# hostname R4

R4(config)# int f1/0

R4(config-if)# ip address 22.23.24.2 255.255.255.0

R4(config-if)# no shutdown

R4(config-if)# exit

R4(config)# int f1/1

R4(config-if)# ip address 172.23.9.1 255.255.255.0

R4(config-if)# no shutdown R4(config-if)# exit

◦ R5:

Router# config t

Router(config)# hostname R5

R5(config)# int f1/0

R5(config-if)# ip address 172.23.9.2 255.255.255.0

R5(config-if)# no shutdown

R5(config-if)# exit

3. Ustaw trasy routingu statycznego dla routerów: R1(config)# ip route 0.0.0.0 0.0.0.0 10.5.6.2

R2(config)# ip route 0.0.0.0 0.0.0.0 14.15.16.2

R3(config)# ip route 14.15.16.0 255.255.255.0 14.15.16.1

R3(config)# ip route 22.23.24.0 255.255.255.0 22.23.24.2

R3(config)# ip route 10.5.6.0 255.255.255.0 14.15.16.1

R3(config)# ip route 172.23.9.0 255.255.255.0 22.23.24.2

R4(config)# ip route 0.0.0.0 0.0.0.0 22.23.24.1

R5(config)# ip route 0.0.0.0 0.0.0.0 172.23.9.1

Sprawdź połączenie za pomocą polecenia ping.

4. Ustawienie polityki ISAKMP/IKE na routerach R2 i R4: R2(config)# crypto isakmp policy 5

R2(config-isakmp)# encryption 3des R2(config-isakmp)# group 2

R2(config-isakmp)# hash sha

R2(config-isakmp)# lifetime 28800

R2(config-isakmp)# authentication pre-share R2(config-isakmp)# exit

R4(config)# crypto isakmp policy 5

R4(config-isakmp)# encryption 3des R4(config-isakmp)# group 2

R4(config-isakmp)# hash sha

R4(config-isakmp)# lifetime 28800

R4(config-isakmp)# authentication pre-share R4(config-isakmp)# exit

5. Ustawienie klucza dla klientów VPN: R2(config)# crypto isakmp key hr5xb84l6aa9r6 address 22.23.24.2

R4(config)# crypto isakmp key hr5xb84l6aa9r6 address 14.15.16.1

6. Ustawienia IPSec transform-set: R2(config)# crypto ipsec transform-set STRONG esp-3des esp-sha-hmac R2(cfg-crypto-trans)# exit

R4(config)# crypto ipsec transform-set STRONG esp-3des esp-sha-hmac R4(config-isakmp)# exit

7. Listy dostępu dla IPSec: R2(config)# access-list 101 permit ip 10.5.6.0 0.0.0.255 172.23.9.0 0.0.0.255

R2(config)# ip route 0.0.0.0 0.0.0.0 14.15.16.2

R4(config)# access-list 101 permit ip 172.23.9.0 0.0.0.255 10.5.6.0 0.0.0.255

R4(config)# ip route 0.0.0.0 0.0.0.0 22.23.24.1

8. Ustawienie tras dla zdalnych sieci VPN: R2(config)# ip route 172.23.9.0 255.255.255.0 14.15.16.2

R4(config)# ip route 10.5.6.0 255.255.255.0 22.23.24.1

9. Crypto map:

R2(config)# crypto map CISCO 10 ipsec-isakmp R2(config-crypto-map)# set security-association life seconds 3600

R2(config-crypto-map)# set transform-set STRONG

R2(config-crypto-map)# set pfs group2

R2(config-crypto-map)# set peer 22.23.24.2

R2(config-crypto-map)# match address 101

R2(config-crypto-map)# exit

R4(config)# crypto map CISCO 10 ipsec-isakmp R4(config-crypto-map)# set security-association life seconds 3600

R4(config-crypto-map)# set transform-set STRONG

R4(config-crypto-map)# set pfs group2

R4(config-crypto-map)# set peer 14.15.16.1

R4(config-crypto-map)# match address 101

R4(config-crypto-map)# exit

10. Przypisanie crypto map do interfejsu: R2(config)# int f1/1

R2(config-if)# crypto map CISCO

R2(config-if)# exit

R4(config)# int f1/0

R4(config-if)# crypto map CISCO

R4(config-if)# exit

11. Uruchomienie tunelu i sprawdzenie działania konfiguracji: R1# ping

Protocol [ip]:

Target IP address: 172.23.9.2

Repeat count [5]:

Datagram size [100]:

Timeout in seconds [2]:

Extended commands [n]: y

Source address or interface:

Type of service [0]:

Set DF bit in IP header? [no]:

Validate reply data? [no]:

Data pattern [0xABCD]:

Loose, Strict, Record, Timestamp, Verbose[none]: Sweep range of sizes [n]:

R2# show crypto isakmp sa

R2# show crypto ipsec sa