实验还原
配置如下
AR1
[Huawei]un in en
[Huawei]sys AR1
[AR1]inte g0/0/0
[AR1-GigabitEthernet0/0/0]ip ad 192.168.1.254 24
[AR1-GigabitEthernet0/0/0]inte g0/0/1
[AR1-GigabitEthernet0/0/1]ip ad 192.1.1.1 24
[AR1-GigabitEthernet0/0/1]ospf
[AR1-ospf-1]ar 1
[AR1-ospf-1-area-0.0.0.1]net 192.1.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.1]inte tun0/0/1
[AR1-Tunnel0/0/1]ip add 192.168.4.1 24
[AR1-Tunnel0/0/1]tun gre
[AR1-Tunnel0/0/1]so g0/0/1
[AR1-Tunnel0/0/1]des 192.1.2.1
[AR1-Tunnel0/0/1]keepalive
[AR1-Tunnel0/0/1]rip
[AR1-rip-1]ver 2
[AR1-rip-1]un sum
[AR1-rip-1]net 192.168.1.0
[AR1-rip-1]net 192.168.4.0
[AR1-rip-1]net 192.168.5.0
[AR1]inte tun0/0/2
[AR1-Tunnel0/0/2]ip add 192.168.5.1 24
[AR1-Tunnel0/0/2]tun gre
[AR1-Tunnel0/0/2]so g0/0/1
[AR1-Tunnel0/0/2]des 192.1.3.1
[AR1-Tunnel0/0/2]keepalive
AR2
<Huawei>sys
[Huawei]un in en
[Huawei]sys AR2
[AR2]inte g0/0/0
[AR2-GigabitEthernet0/0/0]ip ad 192.168.2.254 24
[AR2-GigabitEthernet0/0/0]inte g0/0/1
[AR2-GigabitEthernet0/0/1]ip ad 192.1.2.1 24
[AR2-GigabitEthernet0/0/1]ospf
[AR2-ospf-1]ar 1
[AR2-ospf-1-area-0.0.0.1]net 192.1.2.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.1]inte tun0/0/1
[AR2-Tunnel0/0/1]ip add 192.168.4.2 24
[AR2-Tunnel0/0/1]tun gre
[AR2-Tunnel0/0/1]so g0/0/1
[AR2-Tunnel0/0/1]des 192.1.1.1
[AR2-Tunnel0/0/1]keepalive
[AR2-Tunnel0/0/1]inte tun0/0/3
[AR2-Tunnel0/0/3]ip add 192.168.6.1 24
[AR2-Tunnel0/0/3]tun gre
[AR2-Tunnel0/0/3]so g0/0/1
[AR2-Tunnel0/0/3]des 192.1.3.1
[AR2-Tunnel0/0/3]keepalive
[AR2-Tunnel0/0/3]rip
[AR2-rip-1]ver 2
[AR2-rip-1]un sum
[AR2-rip-1]net 192.168.2.0
[AR2-rip-1]net 192.168.4.0
[AR2-rip-1]net 192.168.6.0
AR3
<Huawei>sys
[Huawei]un in en
[Huawei]sys AR3
[AR3]inte g0/0/1
[AR3-GigabitEthernet0/0/1]ip ad 192.168.3.254 24
[AR3-GigabitEthernet0/0/1]inte g0/0/0
[AR3-GigabitEthernet0/0/0]ip ad 192.1.3.1 24
[AR3-GigabitEthernet0/0/0]ospf
[AR3-ospf-1]ar 1
[AR3-ospf-1-area-0.0.0.1]net 192.1.3.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.1]inte tun0/0/2
[AR3-Tunnel0/0/2]ip add 192.168.5.2 24
[AR3-Tunnel0/0/2]tun gre
[AR3-Tunnel0/0/2]so g0/0/0
[AR3-Tunnel0/0/2]des 192.1.1.1
[AR3-Tunnel0/0/2]keepalive
[AR3-Tunnel0/0/2]inte tun0/0/3
[AR3-Tunnel0/0/3]ip add 192.168.6.2 24
[AR3-Tunnel0/0/3]tun gre
[AR3-Tunnel0/0/3]so g0/0/0
[AR3-Tunnel0/0/3]des 192.1.2.1
[AR3-Tunnel0/0/3]keepalive
[AR3-Tunnel0/0/3]rip
[AR3-rip-1]ver 2
[AR3-rip-1]un sum
[AR3-rip-1]net 192.168.3.0
[AR3-rip-1]net 192.168.5.0
[AR3-rip-1]net 192.168.6.0
AR4
<Huawei>sys
[Huawei]un in en
[Huawei]sys AR4
[AR4]inte g0/0/1
[AR4-GigabitEthernet0/0/1]ip ad 192.1.4.1 24
[AR4-GigabitEthernet0/0/1]inte g0/0/0
[AR4-GigabitEthernet0/0/0]ip ad 192.1.1.2 24
[AR4-GigabitEthernet0/0/0]inte g0/0/2
[AR4-GigabitEthernet0/0/2]ip ad 192.1.6.1 24
[AR4-GigabitEthernet0/0/2]ospf
[AR4-ospf-1]ar 1
[AR4-ospf-1-area-0.0.0.1]net 192.1.4.0 0.0.0.255
[AR4-ospf-1-area-0.0.0.1]net 192.1.1.0 0.0.0.255
[AR4-ospf-1-area-0.0.0.1]net 192.1.6.0 0.0.0.255
AR5
<Huawei>sys
[Huawei]un in en
[Huawei]sys AR5
[AR5]inte g0/0/1
[AR5-GigabitEthernet0/0/1]ip ad 192.1.4.2 24
[AR5-GigabitEthernet0/0/1]inte g0/0/0
[AR5-GigabitEthernet0/0/0]ip ad 192.1.2.2 24
[AR5-GigabitEthernet0/0/0]inte g0/0/2
[AR5-GigabitEthernet0/0/2]ip ad 192.1.5.1 24
[AR5-GigabitEthernet0/0/2]ospf
[AR5-ospf-1]ar 1
[AR5-ospf-1-area-0.0.0.1]net 192.1.4.0 0.0.0.255
[AR5-ospf-1-area-0.0.0.1]net 192.1.2.0 0.0.0.255
[AR5-ospf-1-area-0.0.0.1]net 192.1.5.0 0.0.0.255
AR6
<Huawei>sys
[Huawei]un in en
[Huawei]sys AR6
[AR6]inte g0/0/1
[AR6-GigabitEthernet0/0/1]ip ad 192.1.5.2 24
[AR6-GigabitEthernet0/0/1]inte g0/0/0
[AR6-GigabitEthernet0/0/0]ip ad 192.1.6.2 24
[AR6-GigabitEthernet0/0/0]inte g0/0/2
[AR6-GigabitEthernet0/0/2]ip ad 192.1.3.2 24
[AR6-GigabitEthernet0/0/2]ospf
[AR6-ospf-1]ar 1
[AR6-ospf-1-area-0.0.0.1]net 192.1.3.0 0.0.0.255
[AR6-ospf-1-area-0.0.0.1]net 192.1.5.0 0.0.0.255
[AR6-ospf-1-area-0.0.0.1]net 192.1.6.0 0.0.0.255
整个实验ospf是将公网打通,rip是打通隧道内的路由,一般情况下写gre都是采用静态,这里用的是动态路由,我们要学会举一反三哦,灵活运用
ospf验证
蓝色区域中运行ospf,打通公网路由,以下是ar4、ar5、ar6的ospf邻居
ar1-ar2为隧道1
ar1-ar3为隧道2
ar2-ar3为隧道3
两两之间建立rip,并且将业务也宣告进rip中,保证隧道流量的网络可达
rip邻居验证
AR1
AR2
AR3
路由验证
每台边界路由器都能通过rip学习到私网路由
业务测试
通过抓包,也可以到gre的封装