首先建立Tunnel隧道口
RT1
RT1 # int tunnel 1 //創(chuàng)建Tunnel口
RT1 # ip address 10.80.255.17 255.255.255.252 //給這個(gè)Tunnel隧道口分IP地址
RT1 # tunnel source g0/5 //定義隧道源的接口
RT1 # tunnel destination 10.80.255.30 //定義真實(shí)的通過接口
RT2
RT2 # int tunnel 1 //創(chuàng)建Tunnel口
RT2 # ip address 10.80.255.18 255.255.255.252 //給這個(gè)Tunnel隧道口分IP地址
RT2 # tunnel source g0/5 //定義隧道源的接口
RT2 # tunnel destination 10.80.255.25 //定義隧道目的接口
然后一個(gè)Tunnel隧道口就建好了。
然后建立一個(gè)訪問控制列表(設(shè)定列表里的流量直接從隧道走)
RT1 # ip access-list extended ipsecacl
RT1 # permit gre 10.80.255.25 255.255.255.255 10.80.255.30 255.255.255.255
// permit gre 源IP 源子網(wǎng)掩碼 目IP 目子網(wǎng)掩碼