第六次作业

实验要求与拓扑结构如下所示:

1. AS1存在两个环回,一个地址为192.168.1.0 /24该地址不能在任何协议中宣告
    AS3存在两个环回,一个地址为192.168.2.0 /24该地址不能在任何协议中宣告
    最终要求这两个环回可以相互通讯
2.整个AS2的IP地址为176.16.0.0 请合理分配
3.AS间的骨干链路IP地址随意定制
4.使用BGP协议让整个网络所有设备的环回可以互相访问
5.减少条目数量,避免环路出现

实验开始:
首先,图中IP已为我们规划完毕,所以我们直接配置即可。

R1:

[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
May 11 2024 14:06:21-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip add 172.16.0.1 32
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 192.168.1.1 24
R2:

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
May 11 2024 14:08:26-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 172.16.1.1 30
May 11 2024 14:08:45-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 172.16.1.21 30
May 11 2024 14:09:09-08:00 R2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R2-GigabitEthernet0/0/2]int l0
[R2-LoopBack0]ip add 172.16.0.2 32

R3:

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.1.2 30
May 11 2024 14:10:07-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 172.16.1.5 30
May 11 2024 14:10:24-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R3-GigabitEthernet0/0/1]int l0
[R3-LoopBack0]ip add 172.16.0.3 32
[R3-LoopBack0]int l1
[R3-LoopBack1]ip add 172.16.3.1 24

R4:

[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 172.16.1.6 30
May 11 2024 14:12:14-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 172.16.1.9 30
May 11 2024 14:12:29-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R4-GigabitEthernet0/0/1]int l0
[R4-LoopBack0]ip add 172.16.0.4 32
[R4-LoopBack0]int l1
[R4-LoopBack1]ip add 172.16.4.1 24

R5:

[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 172.16.1.22 30
May 11 2024 14:14:17-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 172.16.1.17 30
May 11 2024 14:14:49-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R5-GigabitEthernet0/0/1]int l0
[R5-LoopBack0]ip add 172.16.0.5 32
[R5-LoopBack0]int l1
[R5-LoopBack1]ip add 172.16.5.1 24

R6:

[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 172.16.1.18 30
May 11 2024 14:16:23-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R6-GigabitEthernet0/0/0]int g0/0/1
[R6-GigabitEthernet0/0/1]ip add 172.16.1.13 30
May 11 2024 14:16:45-08:00 R6 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R6-GigabitEthernet0/0/1]int l0
[R6-LoopBack0]ip add 172.16.0.6 32
[R6-LoopBack0]int l1
[R6-LoopBack1]ip add 172.16.6.1 24
R7:

[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 172.16.1.14 30
May 11 2024 14:17:56-08:00 R7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R7-GigabitEthernet0/0/0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.1.10 30
May 11 2024 14:18:27-08:00 R7 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R7-GigabitEthernet0/0/1]int g0/0/2
[R7-GigabitEthernet0/0/2]ip add 34.1.1.1 24
[R7-GigabitEthernet0/0/2]
May 11 2024 14:18:46-08:00 R7 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R7-GigabitEthernet0/0/2]int l0
[R7-LoopBack0]ip add 172.16.0.7 32
[R7-LoopBack0]int l1
[R7-LoopBack1]ip add 172.16.7.1 32
 

R8:

[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip add 34.1.1.2 24
May 11 2024 14:19:48-08:00 R8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R8-GigabitEthernet0/0/0]int l0
[R8-LoopBack0]ip add 172.16.0.8 32
[R8-LoopBack0]int l1
[R8-LoopBack1]ip add 192.168.2.1 24
配置好后建议使用display ip interface brief查看配置情况。

第二步是内网通,使用OSPF:

R2:

[R2]ospf 1
[R2-ospf-1]q
[R2]ospf 1 rou    
[R2]ospf 1 router-id 2.2.2.2
Info: The configuration succeeded. You need to restart the OSPF process to valid
ate the new router ID.
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255

R3:

[R3]ospf 1 rou    
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
 

R4:

[R4]ospf 1 rou    
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
 

R5:

[R5]ospf 1 rou    
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
 

R6:

[R6]ospf 1 rou    
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
 

R7:

[R7]ospf 1 rou 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
ping一下r7环回到r2环回:

内网通;

接下来配置BGP:

R1:

[R1]BGP 1
[R1-bgp]rot    
[R1-bgp]rou    
[R1-bgp]route-select
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.1.1.2 as-n    
[R1-bgp]peer 12.1.1.2 as-number 2
 

R2:

[R2]bgp 64512
[R2-bgp]conf    
[R2-bgp]confederation id 2
[R2-bgp]conf    
[R2-bgp]confederation peer as 64513
                           ^
Error: Wrong parameter found at '^' position.
[R2-bgp]confederation peer as 64513
[R2-bgp]confederation peer-as 64513
[R2-bgp]peer 12.1.1.1 as-num    
[R2-bgp]peer 12.1.1.1 as-number 1
[R2-bgp]
May 11 2024 14:55:34-08:00 R2 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
 peer 12.1.1.1 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, St
ateChangeReason=Up)  
[R2-bgp]peer 172.16.0.3 as-num    
[R2-bgp]peer 172.16.0.3 as-number 64512
[R2-bgp]peer 172.16.0.3 co    
[R2-bgp]peer 172.16.0.3 connect-interface lo    
[R2-bgp]peer 172.16.0.3 connect-interface LoopBack 0
[R2-bgp]peer 172.16.0.5 as-num    
[R2-bgp]peer 172.16.0.5 as-number 64513
[R2-bgp]peer 172.16.0.5 co    
[R2-bgp]peer 172.16.0.5 connect-interface lo    
[R2-bgp]peer 172.16.0.5 connect-interface LoopBack 0
 

R3:

[R3]bgp 64512
[R3-bgp]conf    
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.0.2 as-num    
[R3-bgp]peer 172.16.0.2 as-number 64512
[R3-bgp]peer 172.16.0.4 as-    
[R3-bgp]peer 172.16.0.4 as-number 64512

[R3-bgp]peer 172.16.0.4 connect-interface l 0

[R3-bgp]peer 172.16.0.2 connect-interface l 0

R4:

[R4]bgp 64512
[R4-bgp]con    
[R4-bgp]confederation id 2
[R4-bgp]con    
[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.0.3 as-num    
[R4-bgp]peer 172.16.0.3 as-number 64512
[R4-bgp]peer 172.16.0.3 conf    
[R4-bgp]peer 172.16.0.3 co    
[R4-bgp]peer 172.16.0.3 connect-interface lo    
[R4-bgp]peer 172.16.0.3 connect-interface LoopBack 0
[R4-bgp]peer 172.16.0.7 as-num    
[R4-bgp]peer 172.16.0.7 as-number 172.16
May 11 2024 15:22:34-08:00 R4 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
 peer 172.16.0.3 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, 
StateChangeReason=Up)  
[R4-bgp]peer 172.16.0.7 as-number 64513
[R4-bgp]peer 172.16.0.7 co    
[R4-bgp]peer 172.16.0.7 connect-interface lo    
[R4-bgp]peer 172.16.0.7 connect-interface LoopBack 0
[R4-bgp]peer 172.16.0.7 ebgp-max-hop

R5:

[R5]bgp 64513
[R5-bgp]conf    
[R5-bgp]confederation id 2
[R5-bgp]conf    
[R5-bgp]confederation peer-as 64512
[R5-bgp]peer 172.16.0.2 as-num    
[R5-bgp]peer 172.16.0.2 as-number 64512
[R5-bgp]peer 172.16.0.2 co    
[R5-bgp]peer 172.16.0.2 connect-interface lo    
[R5-bgp]peer 172.16.0.2 connect-interface LoopBack 0
[R5-bgp]peer 172.16.0.6 as-num 64513
[R5-bgp]
[R5-bgp]peer 172.16.0.6 co    
[R5-bgp]peer 172.16.0.6 connect-interface lo    
[R5-bgp]peer 172.16.0.6 connect-interface LoopBack 
[R5-bgp]peer 172.16.0.6 connect-interface LoopBack 0
[R5-bgp]peer 172.16.0.2 eb    
[R5-bgp]peer 172.16.0.2 ebgp-max-hop 
 

R6:

[R6]bgp 64513
[R6-bgp]conf    
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.0.5 as-num    
[R6-bgp]peer 172.16.0.5 as-number 64513
[R6-bgp]peer 172.16.0.5 co    
[R6-bgp]peer 172.16.0.5 connect-interface lo 0
[R6-bgp]peer 172.16.0.7 as-num    
[R6-bgp]peer 172.16.0.7 as-number 64513
[R6-bgp]peer 172.16.0.7 co    
[R6-bgp]peer 172.16.0.7 connect-interface lo 0
 

R7:

[R7]bgp 64513
[R7-bgp]conf    
[R7-bgp]confederation id 2
[R7-bgp]con    
[R7-bgp]confederation peer-as 64512
[R7-bgp]peer 172.16.0.6 as-num    
[R7-bgp]peer 172.16.0.6 as-number 64513
[R7-bgp]peer 172.16.0.6 co    
[R7-bgp]peer 172.16.0.6 connect-interface l 0
[R7-bgp]peer 172.16.0.4 as-num    
[R7-bgp]peer 172.16.0.4 as-number 64512
[R7-bgp]peer 172.16.0.4 co    
[R7-bgp]peer 172.16.0.4 connect-interface 
May 11 2024 15:32:58-08:00 R7 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
 peer 172.16.0.6 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, 
StateChangeReason=Up)  
[R7-bgp]peer 172.16.0.4 connect-interface l 0
[R7-bgp]peer 172.16.0.4 ebgp    
[R7-bgp]peer 172.16.0.4 ebgp-max-hop 
[R7-bgp]peer 34.1.1.2 as-number 3


R8:
[R8]bgp 3
[R8-bgp]peer 34.1.1.1 as-num    
[R8-bgp]peer 34.1.1.1 as-number 2
 

宣告网段:
R1:

[R1]bgp 1
[R1-bgp]net 172.16.0.1 32

[R8]bgp 3
[R8-bgp]net 172.16.0.8 32

修改R2下一跳地址为自己:
R2:

[R2]bgp 64512
[R2-bgp]peer 172.16.0.3 next    
[R2-bgp]peer 172.16.0.3 next-hop-local

在R3上配置反射器:
R3:
[R3]bgp 64512
[R3-bgp]peer 172.16.0.2 re    
[R3-bgp]peer 172.16.0.2 reflect-client 
修改R7的下一跳地址为自己

[R7]bgp 64513
[R7-bgp]peer 172.16.0.4 next    
[R7-bgp]peer 172.16.0.4 next-hop-invariable
[R7-bgp]peer 172.16.0.4 next-hop-local

[R7-bgp]peer 172.16.0.6 next-hop-local
 

在R6上配置反射器:
[R6]bgp 64513
[R6-bgp]peer 172.16.0.5 re    
[R6-bgp]peer 172.16.0.5 reflect-client 
再在R2上增加一条:
[R2]bgp 64512
[R2-bgp]peer 172.16.0.5 next    
[R2-bgp]peer 172.16.0.5 next-hop-invariable
[R2-bgp]peer 172.16.0.5 next-hop-local
最后在R2和R7上重发布:

[R2-bgp]imp    
[R2-bgp]import-route ospf 1
[R7-bgp]impo    
[R7-bgp]import-route ospf 1
观察R1上的路由表:

再ping一下两个网段:

最后建立R1与R8的隧道:

R1:

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 172.16.0.1
[R1-Tunnel0/0/0]destination 172.16.0.8
[R1-Tunnel0/0/0]q
[R1]ip route-static 192.168.2.0 24 10.1.1.2
 
 
 R8:
[R8]int Tunnel 0/0/0
[R8-Tunnel0/0/0]ip address 10.1.1.2 24
[R8-Tunnel0/0/0]tunnel-protocol gre    
[R8-Tunnel0/0/0]source 172.16.0.8
[R8-Tunnel0/0/0]destination 172.16.0.1
May 11 2024 16:03:27-08:00 R8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[R8-Tunnel0/0/0]
[R8-Tunnel0/0/0]q
[R8]ip route-static 192.168.1.0 24 10.1.1.1
 ping一下:

试验结束

  • 16
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值