本文主要介绍通过RouterOS V7的IP-Tunnel来实现RIP异地组网。
一、组网准备
1、RouterOS v7.x 2个,这边使用的版本是7.8 (stable)
2、有公网IPv4的外网2个,我这边使用内网环境模拟
二、网络拓扑
地区1:R1路由外网IP:222.93.16.197 绑定域名:r1.77bx.com 内网:10.10.1.1/24 IP-Tunnel:10.255.255.1/24
地区2:R2路由外网IP:49.64.230.3 绑定域名:r2.77bx.com 内网:10.10.2.1/24 IP-Tunnel:10.255.255.2/24
三、基础配置
1、配置R1和R2上网,这边我就不详细写了,可以看看我以前的教程,已经写的很多了。
四、IP Tunnel配置
1、配置R1和R2的IP Tunnel,Interfaces -> Interface -> + -> IP Tunnel ,设置Name和Remote Address,其他的默认即可。
R1 Name:ipip-tunnel-r1,Remote Address:r2.77bx.com
R2 Name:ipip-tunnel-r2,Remote Address:r1.77bx.com
2、配置R1和R2的IP Tunnel IP地址,IP -> Address -> + , 设置Address和Interface
R1 Address:10.255.255.1/24,Network:10.255.255.0,Interface:ipip-tunnel-r1
R2 Address:10.255.255.2/24,Network:10.255.255.0,Interface:ipip-tunnel-r2
以下是IP Tunnel设置的所有操作命令:
[admin@R1] > interface ipip add name=ipip-tunnel-r1 remote-address=r2.77bx.com [admin@R1] > ip address add address=10.255.255.1/24 interface=ipip-tunnel-r1 [admin@R2] > interface ipip add name=ipip-tunnel-r2 remote-address=r1.77bx.com [admin@R2] > ip address add address=10.255.255.1/24 interface=ipip-tunnel-r2
五、RIP设置
1、R1和R2的RIP Instance设置。Routing -> RIP -> Instance -> + ,设置Name和Redistribute,其他的默认即可。
R1 Name:rip-instance-r1,Redistribute:connected
R2 Name:rip-instance-r2,Redistribute:connected
2、R1和R2的RIP Interfaces设置。Routing -> RIP -> Intface Templates -> + ,设置Name、Instance和Interfaces,其他的默认即可。
R1 Name:rip-interface-r1,Instance:rip-instance-r1,Interfaces:ipip-tunnel-r1
R2 Name:rip-interface-r2,Instance:rip-instance-r2,Interfaces:ipip-tunnel-r2
3、查看R1和R2的连接实例。Routing -> RIP -> Interface
4、查看R1和R2路由表,IP -> Routes
以下是RIP设置的所有命令
[admin@R1] > routing rip instance add name=rip-instance-r1 redistribute=connected [admin@R1] > routing rip interface-template add name=rip-interface-r1 instance=rip-instance-r1 interfaces=ipip-tunnel-r1 [admin@R2] > routing rip instance add name=rip-instance-r2 redistribute=connected [admin@R2] > routing rip interface-template add name=rip-interface-r2 instance=rip-instance-r2 interfaces=ipip-tunnel-r2
到此R1和R2已经组网成功,可以相互访问了。
评论(0)