hcip实验3——gre配置实验

文章详细描述了在华为路由器上配置静态路由、RIPV2和OSPF协议,以实现PC1和PC2通过Tunnel进行通信的实验过程,包括Tunnel配置、路由设置以及公网互通的验证测试。
摘要由CSDN通过智能技术生成

实验拓扑:

实验内容:

PC1;

PC2:

R1配置:

[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 100.1.1.1 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]sys	
[Huawei]sysname R1
[R1]

#静态缺省路由配置
[R1]ip route-static 0.0.0.0 0 100.1.1.2

#配置tunnel隧道
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 192.168.3.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 100.1.1.1
[R1-Tunnel0/0/0]destination 100.2.2.3
Mar 28 2024 21:07:20-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 

R2配置:

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 100.1.1.2 24
[R2-GigabitEthernet0/0/0]q
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 100.2.2.2 24

R3配置:

[Huawei]sys	
[Huawei]sysname R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 100.2.2.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.2.3 24

#静态缺省路由配置
[R3]ip route-static 0.0.0.0 0 100.2.2.2

#配置tunnel隧道
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip add 192.168.3.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre
[R3-Tunnel0/0/0]source 100.2.2.3
[R3-Tunnel0/0/0]destination 100.1.1.1
Mar 28 2024 21:09:47-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 

公网通检测:

测试隧道两端是否相通:

ping -a 源ip  目标ip(可以选择用哪一个ip到哪一个ip通信)

让PC1和PC2互相通信

方法一:在隧道两边配置静态路由

[R1]ip route-static 192.168.2.0 24 192.168.3.3

[R3]ip route-static 192.168.1.0 24 192.168.3.1

测试:

方法二:配置RIPV2

#删除静态路由
[R1]undo ip route-static 192.168.2.0 24 192.168.3.3
[R3]undo ip route-static 192.168.1.0 24 192.168.3.1

#R1配置
[R1]rip 1
[R1-rip-1]v 2
[R1-rip-1]undo su	
[R1-rip-1]undo summary 
[R1-rip-1]net	
[R1-rip-1]network 192.168.1.0
[R1-rip-1]ne	
[R1-rip-1]network 192.168.3.0

#R3配置
[R3]rip 1
[R3-rip-1]v 2
[R3-rip-1]undo summary 	
[R3-rip-1]network 192.168.3.0	
[R3-rip-1]network 192.168.2.0

测试:

方法三:配置ospf

#删除rip配置
[R1]undo rip 1
Warning: The RIP process will be deleted. Continue?[Y/N]y
[R3]undo rip 1
Warning: The RIP process will be deleted. Continue?[Y/N]y

#R1配置
[R1]ospf router-id 1.1.1.1
[R1-ospf-1]a 0
[R1-ospf-1-area-0.0.0.0]n	
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255

#R3配置
[R3]ospf router-id 1.1.1.1
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值