司令的女儿 发表于 2020-6-17 15:46:05

lvfeng 发表于 2020-6-17 21:41:33

HCNP路由交换实验指南

Fit 发表于 2020-6-18 09:53:29

感谢分享

csg2017 发表于 2020-6-19 16:49:29

谢谢分享

kyleloy 发表于 2020-6-19 21:22:02

y5wy54uy54w

pzxy 发表于 2020-6-22 17:20:28

看看泽阳

a89238381a 发表于 2020-6-23 16:30:17

谢谢大神分享

cs327 发表于 2020-6-28 13:32:53

good ,very good!

18310349943 发表于 2020-7-1 21:11:04

大萨达所大多

mailtowhc 发表于 2020-7-2 14:36:36

谢谢楼主

15028152673 发表于 2020-7-4 10:58:47

路由器配置GRE通过静态路由实现IPv4协议互通
IT网络技术 2020-05-05 10:00:00
一、组网需求:
如图所示,RouterA、RouterB、RouterC使用OSPF协议路由实现公网互通。在PC1和PC2上运行IPv4私网协议,现需要PC1和PC2通过公网实现IPv4私网互通。
其中PC1和PC2上分别指定RouterA和RouterC为自己的缺省网关。

配置GRE使用静态路由组网图
二、配置思路:
要实现PC1和PC2通过公网互通。需要在RouterA和RouterC之间建立直连链路,部署GRE隧道,通过静态路由指定到达对端的报文通过Tunnel接口转发,PC1和PC2就可以互相通信了。
配置GRE通过静态路由实现IPv4协议互通的思路如下:
所有设备之间运行OSPF路由协议实现设备间路由互通。
在RouterA和RouterC上创建Tunnel接口,创建GRE隧道,并在RouterA和RouterC上配置经过Tunnel接口的静态路由,使PC1和PC2之间的流量通过GRE隧道传输,实现PC1和PC2互通。
三、操作步骤:
配置各物理接口的IP地址
# 配置RouterA。
<Huawei> system-view
sysname RouterA
interface gigabitethernet 1/0/0
ip address 20.1.1.1 255.255.255.0
quit
interface gigabitethernet 2/0/0
ip address 10.1.1.2 255.255.255.0
quit
# 配置RouterB。
<Huawei> system-view
sysname RouterB
interface gigabitethernet 1/0/0
ip address 20.1.1.2 255.255.255.0
quit
interface gigabitethernet 2/0/0
ip address 30.1.1.1 255.255.255.0
quit
# 配置RouterC。
<Huawei> system-view
sysname RouterC
interface gigabitethernet 1/0/0
ip address 30.1.1.2 255.255.255.0
quit
interface gigabitethernet 2/0/0
ip address 10.2.1.2 255.255.255.0
quit
配置设备间使用OSPF路由
# 配置RouterA。
ospf 1
area 0
network 20.1.1.0 0.0.0.255
quit
quit
# 配置RouterB。
ospf 1
area 0
network 20.1.1.0 0.0.0.255
network 30.1.1.0 0.0.0.255
quit
quit
# 配置RouterC。
ospf 1
area 0
network 30.1.1.0 0.0.0.255
quit
quit
# 配置完成后,在RouterA和RouterC上执行display ip routing-table命令,可以看到他们能够学到去往对端接口网段地址的OSPF路由。
# 以RouterA的显示为例。
display ip routing-table protocol ospf
                                    
------------------------------------------------------------------------------      
Public routing table : OSPF                                                         
         Destinations : 1      Routes : 1                                          
                                                                                    
OSPF routing table status : <Active>                                                
         Destinations : 1      Routes : 1                                          
                                                                                    
Destination/Mask    Proto   PreCost      Flags NextHop         Interface         
                                                                                    
       30.1.1.0/24OSPF    10   2         D   20.1.1.2      GigabitEthernet1/0/0
                                                                                    
OSPF routing table status : <Inactive>                                             
         Destinations : 0      Routes : 0   
配置Tunnel接口
# 配置RouterA。
interface tunnel 0/0/1
tunnel-protocol gre
ip address 10.3.1.1 255.255.255.0
source 20.1.1.1
destination 30.1.1.2
quit
# 配置RouterC。
interface tunnel 0/0/1
tunnel-protocol gre
ip address 10.3.1.2 255.255.255.0
source 30.1.1.2
destination 20.1.1.1
quit
# 配置完成后,Tunnel接口状态变为Up,Tunnel接口之间可以Ping通,直连隧道建立。
# 以RouterA的显示为例:
ping -a 10.3.1.1 10.3.1.2
PING 10.3.1.2: 56data bytes, press CTRL_C to break      
    Reply from 10.3.1.2: bytes=56 Sequence=1 ttl=255 time=1 ms
    Reply from 10.3.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms
    Reply from 10.3.1.2: bytes=56 Sequence=3 ttl=255 time=1 ms
    Reply from 10.3.1.2: bytes=56 Sequence=4 ttl=255 time=1 ms
    Reply from 10.3.1.2: bytes=56 Sequence=5 ttl=255 time=1 ms
                                                            
--- 10.3.1.2 ping statistics ---                           
    5 packet(s) transmitted                                 
    5 packet(s) received                                    
    0.00% packet loss                                       
    round-trip min/avg/max = 1/1/1 ms   
配置静态路由
# 配置RouterA。
ip route-static 10.2.1.0 255.255.255.0 tunnel 0/0/1
# 配置RouterC。
ip route-static 10.1.1.0 255.255.255.0 tunnel 0/0/1
# 配置完成后,在RouterA和RouterC上执行display ip routing-table命令,可以看到去往对端用户侧网段的静态路由出接口为Tunnel接口。
# 以RouterA的显示为例。
display ip routing-table 10.2.1.0                                 
------------------------------------------------------------------------------
Routing Table : Public                                                      
Summary Count : 1                                                            
Destination/Mask    Proto   PreCost      Flags NextHop         Interface   
                                                                              
       10.2.1.0/24Static60   0         D   10.3.1.2      Tunnel0/0/1
PC1和PC2可以相互Ping通。

caijike1987 发表于 2020-7-4 11:21:01

谢谢谢谢

313609839 发表于 2020-7-6 23:07:12

{:6_267:}

1061908568 发表于 2020-7-7 18:05:46

asdqweasdqweasdqwe

blackglasee 发表于 2020-7-7 21:55:03

瞧一瞧,看一看,有用就保留
页: 154 155 156 157 158 159 160 161 162 163 [164] 165 166 167 168 169 170 171 172 173
查看完整版本: 《HCNP路由交换实验指南》华为技术认证