Article Title: the whole process of building a VPN Server on a Cisco network device. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Environment: Establish a VPN connection between the company's Nanjing office and the Shanghai office.
Nanjing office network settings:
Intranet IP address 10.1.1.0/24
Internet IP address 202.102.1.5/24
Shanghai office network settings:
Intranet IP address 10.1.2.0/24
Internet IP address 202.102.1.6/24
Nanjing router configuration
!
Service timestamps debug uptime
Service timestamps log uptime
No service password-encryption
!
Hostname nanjing
!
Enable cisco
!
!
! ------ The following configuration is encrypted --------
====================================
Crypto isakmp policy 1 generate iskamp policy number 1
Encryption des select to use DES encryption or use 3DES to specify three times DES encryption
Hash sha specifies the hash algorithm used, or md5 (two ends are consistent)
Authentication pre-share
Group 1 is specified as the Diffie-Hellman group. 1 indicates 768 bits and 2 indicates 1024 bits.
Life Time 14400 specifies the validity period of the Security Association. If it is not set, it is the default value.
------ The following key configuration method -----
Crypto isakmp identity address specifies the isakmp ID used to communicate with the remote router.
Crypto isakmp key 654321 address 202.102.1.6 use key 654321 for remote router port 202.102.1.6
Crypto isakmp key 654321 address 192.168.1.2 use key 654321 for the remote router tunnel port 192.168.1.2
!
------ The following defines a conversion set -----
Crypto ipsec transform-set tset1 ah-md5-hmac esp-des esp-md5-hmac can define one or more sets
!
!
------- Create an encryption diagram ------
Crypto map cmap1 local-address serial 0 defines the encryption graph cmap1 and specifies s0 as the local address
Crypto map cmap1 1 ipsec-isakmp use serial number 1 to set the encryption Graph
Set peer 202.102.1.6 set the target address
Set peer 192.168.1.2
Set transform-set test1 indicates the conversion set
Match address 111 specifies the address in encrypted access list 111
!
!
Process-max-time 200
!
------- Set the tunnel port as follows ------
Interface Tunnel0
Ip address 192.168.1.1 255.255.255.0
Tunnel source 202.102.1.5
Tunnel destination 202.102.1.6
Crypto map cmap
!
------- Set the Intranet port as follows ------
Interface Ethernet0
Ip address 10.1.1.1 255.255.255.0
!
------- Set the Internet port as follows ------
Interface serial0
Ip address 202.102.1.5 255.255.255.0
No ip mroute-cache
No fair-queue
Crypto map cmap
!
Ip classless
!
------- Create access list 111 ------
Access-list 111 permit ip host 202.102.1.5 host 202.102.1.6
Access-list 111 permit ip host 202.102.1.6 host 202.102.1.5
Access-list 111 permit ip 10.1.1.0 0.0.255 202.102.1.0 0.0.255
Access-list 111 permit ip 10.1.2.0 0.0.255 202.102.1.0 0.0.0.255
Access-list 111 permit ip 10.1.1.0 0.0.255 10.1.2.0 0.0.0.255
Access-list 111 permit ip 10.1.2.0 0.0.255 10.1.1.0 0.0.255
!
Line con 0
Line aux 0
Line vty 0 4
Password cisco
Login
!
End
!
Vro configuration in Shanghai
!
Service timestamps debug uptime
Service timestamps log uptime
No service password-encryption
!
Hostname shanghai
!
Enable cisco
!
!
! ------ The following configuration is encrypted --------
Crypto isakmp policy 1 generate iskamp policy number 1
Encryption des select to use DES encryption or use 3DES to specify three times DES encryption
Hash sha specifies the hash algorithm used, or md5 (two ends are consistent)
Authentication pre-share
Group 1 is specified as the Diffie-Hellman group. 1 indicates 768 bits and 2 indicates 1024 bits.
Life Time 14400 specifies the validity period of the Security Association. If it is not set, it is the default value.
------ The following key configuration method -----
Crypto isakmp identity address specifies the isakmp ID used to communicate with the remote router.
Crypto isakmp key 654321 address 202.102.1.5 use key 654321 for remote router port 202.102.1.6
Crypto isakmp key 654321 address 202.102.1.6 use key 654321 for remote router port 202.102.1.6
Crypto isakmp key 654321 address 192.168.1.1 use key 654321 for the remote router tunnel port 192.168.1.2
!
------ The following defines a conversion set -----
Crypto ipsec transform-set tset1 ah-md5-hmac esp-des esp-md5-hmac can define one or more sets
!
!
------- Create an encryption diagram ------
Crypto map cmap1 local-address serial 0 defines the encryption graph cmap1 and specifies s0 as the local address
Crypto map cmap1 1 ipsec-isakmp use serial number 1 to set the encryption Graph
Set peer 202.102.1.5 set the target address
Set peer 202.102.1.6
Set peer 192.168.1.1
Set transform-set test1 indicates the conversion set
Match address 111 specifies the address in encrypted access list 111
!
!
Process-max-time 200
!
------- Set the tunnel port as follows ------
Interface Tunnel0
Ip address 192.168.1.2 255.255.255.0
Tunnel source 202.102.1.6
Tunnel destination 202.102.1.5
Crypto map cmap
!
------- Set the Intranet port as follows ------
Interface Ethernet0
Ip address 10.1.2.1 255.255.255.0
!
------- Set the Internet port as follows ------
Interface serial0
Ip address 202.102.1.6 255.255.255.0
No ip mroute-cache
No fair-queue
Crypto map cmap
!
Ip classless
!
------- Create access list 111 ------
Access-list 111 permit ip host 202.102.1.5 host 202.102.1.6
Access-list 111 permit ip host 202.102.1.6 host 202.102.1.5
Access-list 111 permit ip 10.1.1.0 0.0.255 202.102.1.0 0.0.255
Access-list 111 permit ip 10.1.2.0 0.0.255 202.102.1.0 0.0.0.255
Access-list 111 permit ip 10.1.1.0 0.0.255 10.1.2.0 0.0.0.255
Access-list 111 permit ip 10.1.2.0 0.0.255 10.1.1.0 0.0.255
!
Line con 0
Line aux 0
Line vty 0 4
Password cisco
Login
!
End
!