
Sitiyasyon an
Mwen te resevwa yon vèsyon Demo nan C-Terra VPN pwodwi vèsyon 4.3 pou twa mwa. Mwen vle chèche konnen si lavi jeni mwen an ap vin pi fasil apre chanje nan nouvo vèsyon an.
Jodi a se pa difisil, yon sèl sak nan kafe enstantane 3 nan 1 ta dwe ase. M ap di w kijan pou w jwenn demo. Mwen pral eseye konstwi plan GRE-over-IPsec ak IPsec-over-GRE.
Ki jan yo ka resevwa yon Demo

Li swiv nan figi a ke yo nan lòd yo ka resevwa yon Demo ou bezwen:
- Ekri yon lèt bay presale@s-terra.ru depi adrès konpayi ou an;
- Nan lèt la, endike TIN òganizasyon w lan;
- Lis pwodwi yo ak kantite yo.
Demo yo valab pou twa mwa. Vandè a pa limite fonctionnalités yo.
Agrandi imaj la
Demo Security Gateway se yon imaj machin vityèl. Mwen itilize VMWare Workstation. Yon lis konplè ipèvizè ak anviwònman virtualizasyon ki sipòte yo disponib sou sit entènèt vandè a.
Anvan ou kòmanse, tanpri sonje pa gen okenn koòdone rezo nan imaj machin vityèl default la:

Lojik la klè, itilizatè a dwe ajoute anpil interfaces jan li bezwen. Mwen pral ajoute kat nan yon fwa:

Koulye a, mwen kòmanse machin vityèl la. Touswit apre lansman, pòtay la mande pou yon non itilizatè ak yon modpas.
Gen plizyè konsola nan S-Terra Gateway ak kont diferan. Mwen pral konte nimewo yo nan yon atik separe. Pou konnya:
Login as: administrator
Password: s-terra
Mwen inisyalize pòtay la. Inisyalizasyon se yon sekans aksyon: antre nan yon lisans, mete kanpe yon dèlko nimewo o aza byolojik (simulatè klavye - dosye mwen an se 27 segonn) ak kreye yon kat koòdone rezo.
Kat jeyografik rezo interfaces. Li te vin pi fasil
Vèsyon 4.2 salye itilizatè aktif la ak mesaj:
Starting IPsec daemon….. failed
ERROR: Could not establish connection with daemon
Yon itilizatè aktif (dapre yon enjenyè anonim) se yon itilizatè ki ka mete nenpòt bagay byen vit epi san dokiman.
Yon bagay t ap mal pase anvan ou eseye mete yon adrès IP sou koòdone a. Se tout sou kat koòdone rezo a. Li te nesesè yo fè:
/bin/netifcfg enum > /home/map
/bin/netifcfg map /home/map
service networking restart
Kòm yon rezilta, yo kreye yon kat koòdone rezo ki gen kat non koòdone fizik (0000:02:03.0) ak deziyasyon lojik yo nan sistèm operasyon an (eth0) ak konsole ki sanble ak Cisco (FastEthernet0/0):
#Unique ID iface type OS name Cisco-like name
0000:02:03.0 phye eth0 FastEthernet0/0
Deziyasyon lojik entèfas yo rele alyas. Alyas yo estoke nan fichye /etc/ifaliases.cf.
Nan vèsyon 4.3, lè machin vityèl la te kòmanse premye, yo kreye yon kat koòdone otomatikman. Si ou chanje kantite koòdone rezo nan machin vityèl la, tanpri rkree kat koòdone a:
/bin/netifcfg enum > /home/map
/bin/netifcfg map /home/map
systemctl restart networking
Scheme 1: GRE-sou-IPsec
Mwen deplwaye de pòtay vityèl, mwen chanje jan yo montre nan figi a:

Etap 1. Mete kanpe adrès IP ak wout
VG1(config) #
interface fa0/0
ip address 172.16.1.253 255.255.255.0
no shutdown
interface fa0/1
ip address 192.168.1.253 255.255.255.0
no shutdown
ip route 0.0.0.0 0.0.0.0 172.16.1.254VG2(config) #
interface fa0/0
ip address 172.16.1.254 255.255.255.0
no shutdown
interface fa0/1
ip address 192.168.2.254 255.255.255.0
no shutdown
ip route 0.0.0.0 0.0.0.0 172.16.1.253Tcheke koneksyon IP:
root@VG1:~# ping 172.16.1.254 -c 4
PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data.
64 bytes from 172.16.1.254: icmp_seq=1 ttl=64 time=0.545 ms
64 bytes from 172.16.1.254: icmp_seq=2 ttl=64 time=0.657 ms
64 bytes from 172.16.1.254: icmp_seq=3 ttl=64 time=0.687 ms
64 bytes from 172.16.1.254: icmp_seq=4 ttl=64 time=0.273 ms
--- 172.16.1.254 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 0.273/0.540/0.687/0.164 msEtap 2: Mete kanpe GRE
Mwen pran yon egzanp pou mete GRE nan scripts ofisyèl yo. Mwen kreye yon fichye gre1 nan /etc/network/interfaces.d anyè ak sa yo.
Pou VG1:
auto gre1
iface gre1 inet static
address 1.1.1.1
netmask 255.255.255.252
pre-up ip tunnel add gre1 mode gre remote 172.16.1.254 local 172.16.1.253 key 1 ttl 64 tos inherit
pre-up ethtool -K gre1 tx off > /dev/null
pre-up ip link set gre1 mtu 1400
post-down ip link del gre1Pou VG2:
auto gre1
iface gre1 inet static
address 1.1.1.2
netmask 255.255.255.252
pre-up ip tunnel add gre1 mode gre remote 172.16.1.253 local 172.16.1.254 key 1 ttl 64 tos inherit
pre-up ethtool -K gre1 tx off > /dev/null
pre-up ip link set gre1 mtu 1400
post-down ip link del gre1Mwen ogmante koòdone nan sistèm nan:
root@VG1:~# ifup gre1
root@VG2:~# ifup gre1Tcheke:
root@VG1:~# ip address show
8: gre1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1400 qdisc noqueue state UNKNOWN group default qlen 1
link/gre 172.16.1.253 peer 172.16.1.254
inet 1.1.1.1/30 brd 1.1.1.3 scope global gre1
valid_lft forever preferred_lft forever
root@VG1:~# ip tunnel show
gre0: gre/ip remote any local any ttl inherit nopmtudisc
gre1: gre/ip remote 172.16.1.254 local 172.16.1.253 ttl 64 tos inherit key 1C-Terra Gateway gen yon sniffer pake entegre - tcpdump. Mwen pral ekri yon pil fatra trafik nan yon dosye pcap:
root@VG2:~# tcpdump -i eth0 -w /home/dump.pcapMwen kòmanse ping ant interfaces GRE:
root@VG1:~# ping 1.1.1.2 -c 4
PING 1.1.1.2 (1.1.1.2) 56(84) bytes of data.
64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.918 ms
64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=0.850 ms
64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=0.918 ms
64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=0.974 ms
--- 1.1.1.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 0.850/0.915/0.974/0.043 msTinèl GRE ap fonksyone:

Etap 3. Ankripte ak GOST GRE
Mwen mete kalite idantifikasyon - pa adrès. Otantifikasyon ak yon kle predefini (dapre Kondisyon Itilizasyon yo, yo dwe itilize sètifika dijital):
VG1(config)#
crypto isakmp identity address
crypto isakmp key KEY address 172.16.1.254Mwen mete paramèt IPsec Faz I yo:
VG1(config)#
crypto isakmp policy 1
encr gost
hash gost3411-256-tc26
auth pre-share
group vko2Mwen mete paramèt IPsec Faz II yo:
VG1(config)#
crypto ipsec transform-set TSET esp-gost28147-4m-imit
mode tunnelMwen kreye yon lis aksè pou chifreman. Trafik vize - GRE:
VG1(config)#
ip access-list extended LIST
permit gre host 172.16.1.253 host 172.16.1.254Mwen kreye yon kat jeyografik kript epi mare li nan koòdone WAN la:
VG1(config)#
crypto map CMAP 1 ipsec-isakmp
match address LIST
set transform-set TSET
set peer 172.16.1.253
interface fa0/0
crypto map CMAPPou VG2, konfigirasyon an reflete, diferans ki genyen yo se:
VG2(config)#
crypto isakmp key KEY address 172.16.1.253
ip access-list extended LIST
permit gre host 172.16.1.254 host 172.16.1.253
crypto map CMAP 1 ipsec-isakmp
set peer 172.16.1.254Tcheke:
root@VG2:~# tcpdump -i eth0 -w /home/dump2.pcaproot@VG1:~# ping 1.1.1.2 -c 4
PING 1.1.1.2 (1.1.1.2) 56(84) bytes of data.
64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=1128 ms
64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=126 ms
64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=1.07 ms
64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=1.12 ms
--- 1.1.1.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 1.077/314.271/1128.419/472.826 ms, pipe 2
Statistik ISAKMP/IPsec:
root@VG1:~# sa_mgr show
ISAKMP sessions: 0 initiated, 0 responded
ISAKMP connections:
Num Conn-id (Local Addr,Port)-(Remote Addr,Port) State Sent Rcvd
1 1 (172.16.1.253,500)-(172.16.1.254,500) active 1086 1014
IPsec connections:
Num Conn-id (Local Addr,Port)-(Remote Addr,Port) Protocol Action Type Sent Rcvd
1 1 (172.16.1.253,*)-(172.16.1.254,*) 47 ESP tunn 480 480Pa gen okenn pake nan pil fatra trafik GRE:

Konklizyon: konplo GRE-over-IPsec travay kòrèkteman.
Figi 1.5: IPsec-sou-GRE
Mwen pa planifye pou itilize IPsec-over-GRE sou rezo a. Mwen kolekte paske mwen vle.

Pou deplwaye konplo GRE-over-IPsec nan lòt fason:
- Ranje lis aksè chifreman - vize trafik soti nan LAN1 a LAN2 ak vis vèrsa;
- Konfigure routage atravè GRE;
- Kwoke yon cryptomap sou koòdone GRE la.
Pa defo, pa gen okenn koòdone GRE nan konsole pòtay ki sanble ak Cisco. Li egziste sèlman nan sistèm operasyon an.
Mwen ajoute koòdone GRE a nan konsole a ki sanble ak Cisco. Pou fè sa, mwen edite fichye /etc/ifaliases.cf:
interface (name="FastEthernet0/0" pattern="eth0")
interface (name="FastEthernet0/1" pattern="eth1")
interface (name="FastEthernet0/2" pattern="eth2")
interface (name="FastEthernet0/3" pattern="eth3")
interface (name="Tunnel0" pattern="gre1")
interface (name="default" pattern="*")kote gre1 se deziyasyon koòdone nan sistèm operasyon an, Tunnel0 se deziyasyon koòdone nan konsole a ki sanble ak Cisco.
Mwen rekalkile hash dosye a:
root@VG1:~# integr_mgr calc -f /etc/ifaliases.cf
SUCCESS: Operation was successful.Koulye a, koòdone Tunnel0 a parèt nan konsole Cisco a:
VG1# show run
interface Tunnel0
ip address 1.1.1.1 255.255.255.252
mtu 1400Korije lis aksè a pou chifreman:
VG1(config)#
ip access-list extended LIST
permit ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255Mwen konfigirasyon routage atravè GRE:
VG1(config)#
no ip route 0.0.0.0 0.0.0.0 172.16.1.254
ip route 192.168.3.0 255.255.255.0 1.1.1.2Mwen retire cryptomap la nan Fa0 / 0 epi mare li nan koòdone GRE la:
VG1(config)#
interface Tunnel0
crypto map CMAPPou VG2 li sanble.
Tcheke:
root@VG2:~# tcpdump -i eth0 -w /home/dump3.pcaproot@VG1:~# ping 192.168.2.254 -I 192.168.1.253 -c 4
PING 192.168.2.254 (192.168.2.254) from 192.168.1.253 : 56(84) bytes of data.
64 bytes from 192.168.2.254: icmp_seq=1 ttl=64 time=492 ms
64 bytes from 192.168.2.254: icmp_seq=2 ttl=64 time=1.08 ms
64 bytes from 192.168.2.254: icmp_seq=3 ttl=64 time=1.06 ms
64 bytes from 192.168.2.254: icmp_seq=4 ttl=64 time=1.07 ms
--- 192.168.2.254 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 1.064/124.048/492.972/212.998 msStatistik ISAKMP/IPsec:
root@VG1:~# sa_mgr show
ISAKMP sessions: 0 initiated, 0 responded
ISAKMP connections:
Num Conn-id (Local Addr,Port)-(Remote Addr,Port) State Sent Rcvd
1 2 (172.16.1.253,500)-(172.16.1.254,500) active 1094 1022
IPsec connections:
Num Conn-id (Local Addr,Port)-(Remote Addr,Port) Protocol Action Type Sent Rcvd
1 2 (192.168.1.0-192.168.1.255,*)-(192.168.2.0-192.168.2.255,*) * ESP tunn 352 352Nan pil fatra trafik ESP la, pake yo enkapsule nan GRE:

Konklizyon: IPsec-over-GRE travay kòrèkteman.
Rezilta
Yon tas kafe te ase. Mwen te trase enstriksyon pou jwenn yon vèsyon Demo. Konfigirasyon GRE-over-IPsec ak deplwaye vis vèrsa.
Kat jeyografik rezo interfaces nan vèsyon 4.3 otomatik! Mwen teste pi lwen.
Enjenyè anonim
t.me/anonymous_engineer
Sous: www.habr.com
