- 实验说明
- 网络拓扑

- 实验任务
1、IP 配置
按照拓扑中 IP 标记配置 IP,每个部门的网关均为该部门所属网段最后一个可用 IP 地址。
2、OSPF 路由配置
SW1、R1、R2 以及 R3、R4、R5 之间使用 OSPF 路由协议,ospf 进程号 100,具体要求如下:
◼ 所有路由器均运行在骨干区域(area 0)
◼ route-id 分别为 R1: 1.1.1.1,R2: 2.2.2.2,SW1: 3.3.3.3,R3: 10.3.3.3,R4 :10.4.4.4,R5: 10.5.5.5
◼ 要求 R1 为两个网络中的 DR,SW-1、R2 均不参与 DR 的选举
◼ 通告对应路由,使得各部门之间能够互通。
◼ 在 R5 上宣告相应的网段,使得外部能访问到 PC4
3、BGP 路由配置
◼ R1 与 R3、R4 之间建立外部 BGP 邻居关系。R1 的 AS 为 24361, R3、R4 的 AS 为 45090
◼ 在 R1 上将 OSPF 的路由重分发到 BGP 中
◼ 在 R3 和 R4 上将 OSPF 的路由重分发到 BGP 中
◼ 在 R1 上将 BGP 中的路由重分发到 OSPF 中
◼ 在 R3 和 R4 上将 BGP 中的路由重分发到 OSPF 中
- 网络节点配置
PC1配置:

PC2配置:

PC3配置:

DC配置:

R1配置:
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#interface Gig0/3/0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/3/0, changed state to down
R1(config-if)#no shutdown
R1(config-if)#ip address 172.31.255.2 255.255.255.252
R1(config-if)#interface Gig0/0/0
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up
R1(config-if)#ip address 10.255.255.9 255.255.255.252
R1(config-if)#interface Gig0/2/0
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/2/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2/0, changed state to up
R1(config-if)#ip address 10.255.255.5 255.255.255.252
R1(config-if)#interface Gig0/1/0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/1/0, changed state to down
R1(config-if)#ip address 172.31.255.6 255.255.255.252
R1>enable
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface loopback0
R1(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#no shutdown
R1(config-if)#ip address 192.168.1.1 255.255.255.255
R1(config)#router ospf 100
R1(config-router)#router-id 1.1.1.1
R1(config-router)#redistribute bgp 65511 subnets
R1(config-router)#network 10.255.255.4 0.0.0.3 area 0
R1(config-router)#network 10.255.255.8 0.0.0.3 area 0
R1(config)#router bgp 65511
R1(config-router)#no bgp log-neighbor-changes
R1(config-router)#neighbor 172.31.255.1 remote-as 65512
R1(config-router)#neighbor 172.31.255.5 remote-as 65512
R1>enable
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router bgp 65511
R1(config-router)#no bgp log-neighbor-changes
R1(config-router)#neighbor 172.31.255.1 remote-as 65512
R1(config-router)#neighbor 172.31.255.5 remote-as 65512
R1(config-router)#exit
R1(config)#access-list 1 permit 172.16.1.0 0.0.0.255
R1(config)#access-list 1 permit 172.16.2.0 0.0.0.255
R1(config)#access-list 1 permit 10.100.2.0 0.0.0.255
R2配置:
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#interface Gig0/1
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
R2(config-if)#ip address 10.100.2.254 255.255.255.0
R2(config-if)#interface Gig0/0
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R2(config-if)#ip address 10.100.1.254 255.255.255.0
R2(config-if)#interface Gig0/0/0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to down
R2(config-if)#ip address 10.255.255.10 255.255.255.252
R2(config-if)#interface Gig0/1/0
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1/0, changed state to up
R2(config-if)#ip address 10.255.255.2 255.255.255.252
R2>enable
R2#config t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 10.100.2.0 0.0.0.255 area 0
R2(config-router)#network 10.100.1.0 0.0.0.255 area 0
R2(config-router)#network 10.255.255.8 0.0.0.3 area 0
R2(config-router)#
01:07:56: %OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on GigabitEthernet0/0/0 from LOADING to FULL, Loading Done
R2(config-router)#network 10.255.255.0 0.0.0.3 area 0
R2(config-router)#interface Gig0/0/0
R2(config-if)#ip ospf priority 0
R2(config-if)#interface Gig0/1/0
R2(config-if)#ip ospf priority 0
R3配置:
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3
R3(config)#interface Gig0/3/0
R3(config-if)#no shutdown
R3(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/3/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/3/0, changed state to up
R3(config-if)#ip address 172.31.255.1 255.255.255.252
R3(config-if)#interface Gig0/1/0
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/1/0, changed state to down
R3(config-if)#ip address 172.31.255.13 255.255.255.252
R3(config-if)#interface Gig0/0/0
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to down
R3(config-if)#ip address 172.31.255.9 255.255.255.252
R3>enable
R3#config t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#interface loopback0
R3(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R3(config-if)#no shutdown
R3(config-if)#ip address 192.168.1.3 255.255.255.255
R3(config)#router bgp 65512
R3(config-router)#no bgp log-neighbor-changes
R3(config-router)#neighbor 172.31.255.2 remote-as 65511
R4配置:
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R4
R4(config)#interface Gig0/1/0
R4(config-if)#no shutdown
R4(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1/0, changed state to up
R4(config-if)#ip address 172.31.255.5 255.255.255.252
R4(config-if)#interface Gig0/2/0
R4(config-if)#no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/2/0, changed state to down
R4(config-if)#ip address 172.31.255.17 255.255.255.252
R4(config-if)#interface Gig0/0/0
R4(config-if)#no shutdown
R4(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up
R4(config-if)#ip address 172.31.255.10 255.255.255.252
R4(config)#interface loopback0
R4(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R4(config-if)#no shutdown
R4(config-if)#ip address 192.168.1.4 255.255.255.255
R5配置:
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R5
R5(config)#interface Gig0/2/0
R5(config-if)#no shutdown
R5(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/2/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2/0, changed state to up
R5(config-if)#ip address 172.31.255.18 255.255.255.252
R5(config-if)#interface Gig0/1/0
R5(config-if)#no shutdown
R5(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1/0, changed state to up
R5(config-if)#ip address 172.31.255.14 255.255.255.252
- 实验数据
- 查看 SW1、R1、R2 上的路由表查看是否已通过 OSPF 学习到直联以外的各部门路由信息和AS45090内部的路由信息(AS45090 内部路由的类别代号为:O E2)
均已通过OSPF学习到各部分路由信息:



2、在 R1 上输入 show ip ospf neighbor 命令查看另外两台路由器的状态是否为 DR-OTHER

根据所配置的id号可证明,2.2.2.2表示的是R2
- 在 R3 和 R4 上查看是否已学习到 R1 发布的 BGP 路由

- 在 R5 上查看是否已学习到通过 R3 和 R4 OSPF 重分发 AS24361 内部的路由信息(路由类别代号为:OE2)

- 在R3和R4上查看是否可以通过OSPF学习到直联以外的路由信息

6、在R1上查看是否已学习到R3和R4发布的BGP路由 :

7、全网能够ping 通:
可以,放两张图以示证明:


1908

被折叠的 条评论
为什么被折叠?



