1.R3为ISP,只能进行IP地址配置;其所有地址均为公有IP地址
2.R1和R3间使用PPP的PAP认证,R3为主认证方;
R4与R3之间使用PPP的chap认证,R3为主认证方;
R3与R5之间使用HDLC封装。
3.R1/R4/R5构建一个MGRE环境,R1为中心站点;R1、R2间为点到点的GRE。
4.整个私有网路基于RIP全网可达
5.所有PC设置私有IP为源IP,可以访问R3环回
一:对各个路由器接口进行IP地址配置,保证内网环境PING通
R1
R2
R3
R4
R5
PC1
PC2
PC3
PC4
R1,R2,R4和R5使用默认缺省路由指向R3,保证内网环境PING通
[R1]ip route-static 0.0.0.0 0 15.0.0.2
[R2]ip route-static 0.0.0.0 0 45.0.0.2
[R4]ip route-static 0.0.0.0 0 25.0.0.2
[R5]ip route-static 0.0.0.0 0 35.0.0.2
二:R3与R5之间使用HDLC封装。
1.R3与R5之间使用HDLC封装
R3
R5
三:R1和R3间使用PPP的PAP认证,R3为主认证方
ISP服务器(及R3)增添两个用户账号
增加用户账号a,提出建立连接需要pap验证
[R3]aaa
[R3-aaa]local-user a password cipher 123456
[R3-aaa]local-user a service-type ppp
R3在接口处调用,提出建立连接需要ppp验证类型,提出建立连接需要pap验证
[R3]int s 4/0/0
[R3-Serial4/0/0]ppp au
[R3-Serial4/0/0]ppp authentication-mode pap
shutdown关闭接口,undo shutdown取消关闭接口
dis ip int b 查看接口Serial4/0/0协议类型为down
在R1上提出建立连接需要pap验证
[R1]int s 4/0/0
[R1-Serial4/0/0]ppp pap local-user a password cipher 123456
shutdown关闭接口,undo shutdown取消关闭接口
dis ip int b 查看接口Serial4/0/0协议类型为up
四:R4与R3之间使用PPP的chap认证,R3为主认证方
增加用户账号b,提出建立连接需要chap验证
[R3]aaa
[R3-aaa]local-user b password cipher 111111
[R3-aaa]int s 3/0/0
[R3-Serial3/0/0]ppp authentication-mode chap
shutdown关闭接口,undo shutdown取消关闭接口
dis ip int b 查看接口3/0/0协议类型为down
R4上提出建立连接需要chap验证
[R4-Serial4/0/0]
[R4-Serial4/0/0]ppp chap user b
[R4-Serial4/0/0]ppp chap password cipher 111111
shutdown关闭接口,undo shutdown取消关闭接口
dis ip int b 查看接口4/0/0协议类型为up
五:R1/R4/R5构建一个MGRE环境,R1为中心站点
R1路由器建立栈道
1.以R1为中心,R4和R5扮演分支
R1的15.0.0.1 ip固定
[R1]interface Tunnel 0/0/0#创建虚拟栈道接口
[R1-Tunnel0/0/0]ip add 192.168.5.1 24#配置IP地址
增添报头
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp #点到多点的封装加头(源IP知道,目的IP不知道)
[R1-Tunnel0/0/0]source 15.0.0.1 #源IP地址固定
[R1-Tunnel0/0/0]nhrp entry multicast dynamic #destination目的IP地址,客户端ip地址多个且可变,写不了。故交给nhrp服务器来确定目标
R5路由器建立栈道
[R5]interface Tunnel 0/0/0#创建虚拟栈道接口
[R5-Tunnel0/0/0]ip add 192.168.5.3 24#配置IP地址
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source Serial 4/0/1 由于R5的IP地址可变,无法确定源,使用接口
[R5-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register #目标去找服务器nhrp注册
R6路由器建立栈道
[R6]interface Tunnel 0/0/0#创建虚拟栈道接口
[R6-Tunnel0/0/0]ip add 192.168.5.3 24
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp
[R6-Tunnel0/0/0]source Serial 4/0/0 由于R6的IP地址可变,无法确定源,使用接口
[R6-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register #目标去找服务器nhrp注册
使用RIP获取路由,所有Pc可以互相访问,并且可访问R3的环回
[R1]rip 1
[R1-rip-1]v 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 192.168.5.0
[R4]rip 1
[R4-rip-1]v 2
[R4-rip-1]network 192.168.2.0
[R4-rip-1]network 192.168.5.0
[R5]rip 1
[R5-rip-1]v 2
[R5-rip-1]network 192.168.3.0
[R5-rip-1]network 192.168.5.0
PC1可以访问PC2,PC3
但是PC3和PC2之间不能够直接访问需要添加路由
[R5]ip route-static 192.168.2.0 24 192.168.5.2
[R4]ip route-static 192.168.3.0 24 192.168.5.3
六:R1、R2间为点到点的GRE
[R1]interface Tunnel 0/0/1#创建虚拟栈道接口
[R1-Tunnel0/0/1]ip add 192.168.6.1 24#配置IP地址
[R1-Tunnel0/0/1]tunnel-protocol gre#定义该该接口发送流量时需要 GRE封装,GRE实则在源ipv4报头前方再封装一个IPV4报头 ,必须定义封装报头的中源目ip地址
需要手工定义GRE技术粘合的数据,及定义源IP和目的IP
[R1-Tunnel0/0/1]source 15.0.0.1 #源IP地址, 注意为物理接口IP地址
[R1-Tunnel0/0/1]destination 45.0.0.1 #目的IP地址
R2上也进行GRE配置
[R2]interface Tunnel 0/0/0#创建虚拟栈道接口
[R2-Tunnel0/0/0]ip add 192.168.6.2 24#配置IP地址
[R2-Tunnel0/0/0]tunnel-protocol gre
[R2-Tunnel0/0/0]source 45.0.0.2 #源IP地址
[R2-Tunnel0/0/0]destination 15.0.0.1#目的IP地址
R1和R2上的私网没有路由到达对方私网,补上缺省路由
[R1]ip route-satatic 192.168.4.0 24 192.168.6.2
[R2]ip route-satatic 192.168.1.0 24 192.168.6.1
使用PC1访问PC2,实现R1,R2点到点间GRE
使用PC1访问整个网络截图