1、配置所有设备IP,任意选择路由是所有设备互通
略
2、配置扩展访问控制列表
RA_config#ip access-list extended 1
RA_config_ext_nacl#permit ip 192.168.10.1 255.255.255.255 192.168.20.1 255.255.255.255
RB_config#ip access-list extended 1
RB_config_ext_nacl# permit ip 192.168.20.1 255.255.255.255 192.168.10.1 255.255.255.255
3、在RA上创建tunnel隧道并指定源和目的
RA_config#interface tunnel 1
RA_config_t1#interface gigaEthernet 0/1
RA_config_t1#ip add 1.1.1.1 255.255.255.252
RA_config_t1#tunnel source 192.168.10.1
RA_config_t1#tunnel destination 192.168.20.1
RB_config#interface tunnel 1
RB_config_t1#interface gigaEthernet 0/1
RB_config_t1#ip add 1.1.1.2 255.255.255.252
RB_config_t1#tunnel source 192.168.20.1
RB_config_t1#tunnel destination 192.168.10.1
4、为两设备配置loopback并配置一条隧道路由
RA_config#ip route 10.10.10.2 255.255.255.255 tunnel 1 1.1.1.2
RB_config#ip route 10.10.10.1 255.255.255.255 tunnel 1 1.1.1.1
5、最后使用RApingRB的tunnel1地址即可测试是否成功
RA_config#ping 1.1.1.2
PING 1.1.1.2 (1.1.1.2): 56 data bytes
!!!!!
--- 1.1.1.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms