Tunnel can be seen as the simplest form of VPN. Its parameters are simple as long as the Tunnel Source and Tunnel Destination parameters are configured.
The following is an example of the configuration method:
The topology is as follows:
Create a Tunnel between R1 and R2
R1:
S1/0: 192.168.1.1
F0/0: 192.168.10.1
Loop0: 10.1.1.1
R3:
S1/0: 192.168.1.2
S1/1: 192.168.2.1
R2:
S1/1: 192.168.2.2
F0/0: 192.168.20.1
Loop0: 10.2.2.1
C1:
192.168.10.2
C2:
192.168.20.2
========================================
Routing configuration, as long as it can be configured through static or dynamic. However, do not advertise the address of a tunnel. For example, the above two network segments 192.168.10.0 and 192.168.20.0 hope that it will go through the Tunnel, so there is no need to announce the way out.
========================================
Tunnel Configuration:
R1:
R1 (config) # int tunnel 0
R1 (config) # ip add 172.16.1.1 255.255.255.0
R1 (config-if) # tunnel source loopback 0 // use the loopback interface to improve tunnel channel stability
R1 (config-if) # tunnel destination 10.2.2.1 //
R2:
R2 (config) # int tunnel 0
R2 (config) # ip add 172.16.1.2 255.255.255.0
R2 (config-if) # tunnel source loopback 0 //
R2 (config-if) # tunnel destination 10.1.1.1 //
Add a Tunnel route:
R1:
R1 (config) # ip route 192.168.20.0 255.255.255.0 tunnel 0
R2:
R2 (config) # ip route 192.168.10.0 255.255.255.0 tunnel 0
========================================================== ========= Split line
Now our Tunnel channel has been configured. Check the test result:
Take a look at the host traffic routing:
The routing in the middle is invisible to the host and only the channel information is displayed.