文章目录
实验要求 拓扑图连接 表1 网络连接规划表 表2 网络设备明细表 表3 IP规划表
各设备的IP地址配置 OSPF协议配置及BGP协议配置 在R1、R2和R3上配置ospf协议 在R2、R3、R4和R5上配置BGP协议
路由引入 利用路由策略实现路由过滤
某一学校拟对单位网络进行规划设计。请根据下列具体要求给出你的网络规划和设计方案,并在HCL模拟器上完成配置。图中PC_1、PC_2、r1、r2、r3、SW1为局域网内的设备,其中r2、r3为自治系统边界路由器;r4模拟ISP的一路由器, PC_3、PC_4、r5模拟广域网上的设备。
实验要求
(1) 请根据下面拓扑图,完善表1(网络连接规划表)、表2(设备明细表)和表3 (IP规划表) (2)IP地址规划 1)IP 地址掩码长度均使用24位; 外网要使用公网上可以使用的IP地址。请填写表3。 2)IP地址的第三段为学号的最后2位,内网使用ospf协议,ospf的进程号使用学号的最后3位, BGP进程号按照图1要求配置。 (3) 根据表3中的规划,作好各设备的IP地址配置,在r1、r2和r3上配置ospf协议,在r2、r3、r4和r5上配置BGP协议,并用display ip routing-table显示r2上的路由表,给出执行结果截图,使用display bgp routing-table ipv4显示r5的bgp路由表,给出执行结果截图。 (4)路由引入 在内网r2和r3两台路由器上实现路由引入,将ospf路由引入BGP路由,将BGP路由引入ospf路由。并用display ip routing-table显示r2上的路由表,给出执行结果截图。 (5) 利用路由策略实现路由过滤,在路由器r1上配置路由过滤策略实现PC_1和PC_2不可访问PC_4的流量,给出关键配置语句。并在PC_1上ping PC_4,给出执行结果截图,并做相应简要说明。
拓扑图连接
表1 网络连接规划表
设备名称 设备接口 目标设备名称 设备接口 SW1 G0/1 R1 G0/0 G0/2 PC2 G0/1 G0/3 PC1 G0/1 R1 G0/0 SW1 G0/1 G0/1 R2 G0/1 G0/2 R3 G0/2 R2 G0/0 R3 G0/0 G0/1 R1 G0/1 G0/2 R4 G0/2 R3 G0/0 R2 G0/0 G0/1 R4 G0/1 G0/2 R1 G0/2 R4 G0/0 R5 G0/0 G0/1 R3 G0/1 G0/2 R2 G0/2 R5 G0/0 R4 G0/0 G0/1 PC3 G0/1 G0/2 PC4 G0/2 PC1 G0/1 SW1 G0/3 PC2 G0/1 SW1 G0/2 PC3 G0/1 R5 G0/1 PC4 G0/1 R5 G0/2
表2 网络设备明细表
名称和型号 版本 数量 描述 PC 4 MSR36-20_11 5 S5820V2-54QS-GE_11 1
表3 IP规划表
设备名称 接口 IP地址/掩码 网关 SW1 G0/1 10.1.75.1/24 G0/2 10.1.75.1/24 G0/3 10.1.75.1/24 R1 G0/0 10.1.75.1/24 G0/1 10.2.75.1/24 G0/2 10.4.75.1/24 R2 G0/0 10.0.75.2/24 G0/1 10.2.75.2/24 G0/2 10.3.75.2/24 R3 G0/0 10.0.75.3/24 G0/1 10.5.75.3/24 G0/2 10.4.75.3/24 R4 G0/0 192.0.75.4/24 G0/1 10.5.75.4/24 G0/2 10.3.75.4/24 R5 G0/0 192.0.75.1/24 G0/1 192.1.75.1/24 G0/2 192.2.75.1/24 PC1 G0/1 10.1.75.2/24 10.1.75.1 PC2 G0/1 10.1.75.3/24 10.1.75.1 PC3 G0/1 192.1.75.2/24 192.1.75.1 PC4 G0/1 192.2.75.2/24 192.2.75.1
各设备的IP地址配置
< H3C> sys
System View: return to User View with Ctrl+ Z.
[ H3C] sysn R1
[ R1] int g0/ 0
[ R1- GigabitEthernet0/ 0 ] ip add 10.1 .75 .1 24
[ R1- GigabitEthernet0/ 0 ] int g0/ 1
[ R1- GigabitEthernet0/ 1 ] ip add 10.2 .75 .1 24
[ R1- GigabitEthernet0/ 1 ] int g0/ 2
[ R1- GigabitEthernet0/ 2 ] ip add 10.4 .75 .1 24
< H3C> sys
System View: return to User View with Ctrl+ Z.
[ H3C] sysn R2
[ R2] int g0/ 0
[ R2- GigabitEthernet0/ 0 ] ip add 10.0 .75 .2 24
[ R2- GigabitEthernet0/ 0 ] int g0/ 1
[ R2- GigabitEthernet0/ 1 ] ip add 10.2 .75 .2 24
[ R2- GigabitEthernet0/ 1 ] int g0/ 2
[ R2- GigabitEthernet0/ 2 ] ip add 10.3 .75 .2 24
< H3C> sys
System View: return to User View with Ctrl+ Z.
[ H3C] sysn R3
[ R3] int g0/ 0
[ R3- GigabitEthernet0/ 0 ] ip add 10.0 .75 .3 24
[ R3- GigabitEthernet0/ 0 ] int g0/ 1
[ R3- GigabitEthernet0/ 1 ] ip add 10.5 .75 .3 24
[ R3- GigabitEthernet0/ 1 ] int g0/ 2
[ R3- GigabitEthernet0/ 2 ] ip add 10.4 .75 .3 24
[ R3- GigabitEthernet0/ 2 ]
< H3C> sys
System View: return to User View with Ctrl+ Z.
[ H3C] sysn R4
[ R4] int g0/ 0
[ R4- GigabitEthernet0/ 0 ] ip add 192.0 .75 .4 24
[ R4- GigabitEthernet0/ 0 ] int g0/ 1
[ R4- GigabitEthernet0/ 1 ] ip add 10.5 .75 .4 24
[ R4- GigabitEthernet0/ 1 ] int g0/ 2
[ R4- GigabitEthernet0/ 2 ] ip add 10.4 .75 .4 24
[ R4- GigabitEthernet0/ 2 ]
< R5> sys
System View: return to User View with Ctrl+ Z.
[ H3C] sysn R5
[ R5] int g0/ 0
[ R5- GigabitEthernet0/ 0 ] ip add 192.0 .75 .1 24
[ R5- GigabitEthernet0/ 0 ] int g0/ 1
[ R5- GigabitEthernet0/ 1 ] ip add 192.1 .75 .1 24
[ R5- GigabitEthernet0/ 1 ] int g0/ 2
[ R5- GigabitEthernet0/ 2 ] ip add 192.2 .75 .1 24
OSPF协议配置及BGP协议配置
在R1、R2和R3上配置ospf协议
[ R1] ospf 875
[ R1- ospf- 875 ] area 0
[ R1- ospf- 875 - area- 0.0 .0 .0 ] network 10.1 .75 .0 0.0 .0 .255
[ R1- ospf- 875 - area- 0.0 .0 .0 ] network 10.2 .75 .0 0.0 .0 .255
[ R1- ospf- 875 - area- 0.0 .0 .0 ] network 10.4 .75 .0 0.0 .0 .255
[ R1- ospf- 875 - area- 0.0 .0 .0 ]
[ R2] ospf 875
[ R2- ospf- 875 ] area 0
[ R2- ospf- 875 - area- 0.0 .0 .0 ] network 10.0 .75 .0 0.0 .0 .255
[ R2- ospf- 875 - area- 0.0 .0 .0 ] network 10.2 .75 .0 0.0 .0 .255
[ R2- ospf- 875 - area- 0.0 .0 .0 ] network 10.3 .75 .0 0.0 .0 .255
[ R2- ospf- 875 - area- 0.0 .0 .0 ]
[ R3] ospf 875
[ R3- ospf- 875 ] area 0
[ R3- ospf- 875 - area- 0.0 .0 .0 ] network 10.0 .75 .0 0.0 .0 .255
[ R3- ospf- 875 - area- 0.0 .0 .0 ] network 10.5 .75 .0 0.0 .0 .255
[ R3- ospf- 875 - area- 0.0 .0 .0 ] network 10.4 .75 .0 0.0 .0 .255
[ R3- ospf- 875 - area- 0.0 .0 .0 ]
在R2、R3、R4和R5上配置BGP协议
[ R2] bgp 875
[ R2- bgp- default ] peer 10.0 .75 .3 as- number 875
[ R2- bgp- default ] peer 10.3 .75 .4 as- number 876
[ R2- bgp- default ] address- family ipv4 unicast
[ R2- bgp- default - ipv4] network 10.2 .75 .0 255.255 .255 .0
[ R2- bgp- default - ipv4] network 10.0 .75 .0 255.255 .255 .0
[ R2- bgp- default - ipv4] network 10.3 .75 .0 255.255 .255 .0
[ R2- bgp- default - ipv4] peer 10.0 .75 .3 enable
[ R2- bgp- default - ipv4] peer 10.3 .75 .4 enable
[ R2- bgp- default - ipv4]
[ R3] bgp 875
[ R3- bgp- default ] peer 10.0 .75 .2 as- number 875
[ R3- bgp- default ] peer 10.5 .75 .4 as- number 876
[ R3- bgp- default ] address- family ipv4 unicast
[ R3- bgp- default - ipv4] network 10.4 .75 .0 255.255 .255 .0
[ R3- bgp- default - ipv4] network 10.0 .75 .0 255.255 .255 .0
[ R3- bgp- default - ipv4] network 10.5 .75 .0 255.255 .255 .0
[ R3- bgp- default - ipv4] peer 10.0 .75 .2 enable
[ R3- bgp- default - ipv4] peer 10.5 .75 .4 enable
[ R3- bgp- default - ipv4]
[ R4] bgp 876
[ R4- bgp- default ] peer 10.3 .75 .2 as- number 875
[ R4- bgp- default ] peer 10.5 .75 .3 as- number 875
[ R4- bgp- default ] peer 192.0 .75 .1 as- number 877
[ R4- bgp- default ] address- family ipv4 unicast
[ R4- bgp- default - ipv4] network 10.3 .75 .0 255.255 .255 .0
[ R4- bgp- default - ipv4] network 10.5 .75 .0 255.255 .255 .0
[ R4- bgp- default - ipv4] network 192.0 .75 .0 255.255 .255 .0
[ R4- bgp- default - ipv4] peer 10.3 .75 .2 enable
[ R4- bgp- default - ipv4] peer 10.5 .75 .3 enable
[ R4- bgp- default - ipv4] peer 192.0 .75 .1 enable
[ R4- bgp- default - ipv4]
[ R5] bgp 877
[ R5- bgp- default ] peer 192.0 .75 .4 as- number 876
[ R5- bgp- default ] address- family ipv4 unicast
[ R5- bgp- default - ipv4] network 192.0 .75 .0 255.255 .255 .0
[ R5- bgp- default - ipv4] network 192.1 .75 .0 255.255 .255 .0
[ R5- bgp- default - ipv4] network 192.2 .75 .0 255.255 .255 .0
[ R5- bgp- default - ipv4] peer 192.0 .75 .4 enable
路由引入
[ R2] ospf 875
[ R2- ospf- 875 ] import- route bgp
[ R2- ospf- 875 ] q
[ R2] bgp 875
[ R2- bgp- default ] address- family ipv4 unicast
[ R2- bgp- default - ipv4] import- route ospf 875
[ R2- bgp- default - ipv4]
[ R3] ospf 875
[ R3- ospf- 875 ] import- route bgp
[ R3- ospf- 875 ] q
[ R3] bgp 875
[ R3- bgp- default ] address- family ipv4 unicast
[ R3- bgp- default - ipv4] import- route ospf 875
[ R3- bgp- default - ipv4]
利用路由策略实现路由过滤
[ R1] acl advanced 3000
[ R1- acl- ipv4- adv- 3000 ] rule 5 deny ip source 10.1 .75 .2 0 destination 192.2 .75 .2 0
[ R1- acl- ipv4- adv- 3000 ] rule 10 deny ip source 10.1 .75 .3 0 destination 192.2 .75 .2 0
[ R1] int g0/ 0
[ R1- GigabitEthernet0/ 0 ] packet- filter 3000 inbound