OSPF多区域+ACL实验

一、实验拓扑

二、实验需求
  1. 按照图示配置IP地址
  2. 按照图示划分区域
  3. 要求PC6能ping通PC7
  4. 在R3上down掉G0/2时测试链路连通性,并查看追踪路由
  5. 在R3上down掉G0/1时测试链路连通性,并查看追踪路由
  6. 分别为每台路由器配置两个环回口,要求PC6能够ping通R12345的所有环回口
  7. 要求PC6不能访问192.168.4.0网段,访问其他网段均能ping通,以及PC7不能访问192.168.1.0网段,访问其他网段均能ping通
  8. 要求PC6不能访问PC7,访问其他网段均能ping通
  9. 要求PC6不能ping通R2的所有环回口,访问其他网段均能ping通,要求PC7不能ping通R1的所有环回口,访问其他网段均能ping通
  10. 要求PC6不能ping通R5的所有环回口,访问其他网段均能ping通
三、实验步骤
  1. 按照图示配置IP地址
[R1]display  ip int br 
*down: administratively down
(s): spoofing  (l): loopback
Interface           Physical Protocol IP address/Mask    VPN instance Description  
GE0/0               up       up       192.168.1.1/24     --           --
GE0/1               up       up       192.168.6.1/24   
[R2]display ip int br 
*down: administratively down
(s): spoofing  (l): loopback
Interface           Physical Protocol IP address/Mask    VPN instance Description  
GE0/0               up       up       192.168.5.2/24     --           --
GE0/1               up       up       192.168.7.2/24     --
[R3]display ip int brief 
*down: administratively down
(s): spoofing  (l): loopback
Interface           Physical Protocol IP address/Mask    VPN instance Description  
GE0/0               up       up       192.168.1.3/24     --           --
GE0/1               up       up       192.168.4.3/24     --           --
GE0/2               up       up       192.168.2.3/24     --
[R4]display ip int br 
*down: administratively down
(s): spoofing  (l): loopback
Interface           Physical Protocol IP address/Mask    VPN instance Description  
GE0/0               up       up       192.168.5.4/24     --           --
GE0/1               up       up       192.168.4.4/24     --           --
GE0/2               up       up       192.168.3.4/24     --   
[R5]display ip int br 
*down: administratively down
(s): spoofing  (l): loopback
Interface           Physical Protocol IP address/Mask    VPN instance Description  
GE0/0               up       up       192.168.2.5/24     --           --
GE0/1               up       up       192.168.3.5/24     --   
  1. 按照图示划分区域
[R1]router id 1.1.1.1
[R1]ospf 1
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.2]network 192.168.6.0 0.0.0.255 
[R1-ospf-1-area-0.0.0.2]network 192.168.1.0 0.0.0.255 
[R1-ospf-1-area-0.0.0.2]display ospf peer 

         OSPF Process 1 with Router ID 1.1.1.1
               Neighbor Brief Information

 Area: 0.0.0.2        
 Router ID       Address         Pri Dead-Time  State             Interface
 3.3.3.3         192.168.1.3     1   34         Full/BDR  
[R2]router id 2.2.2.2
[R2]ospf 1 
[R2-ospf-1]area 1 
[R2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.1]network 192.168.5.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]network 192.168.7.0 0.0.0.255
<R2>display ospf peer 

         OSPF Process 1 with Router ID 2.2.2.2
               Neighbor Brief Information

 Area: 0.0.0.1        
 Router ID       Address         Pri Dead-Time  State             Interface
 4.4.4.4         192.168.5.4     1   37         Full/BDR          GE0/0
[R3]router id 3.3.3.3 
[R3]ospf 1 
[R3-ospf-1]area 2
[R3-ospf-1-area-0.0.0.2]network 3.3.3.3 0.0.0.0 
[R3-ospf-1-area-0.0.0.2]network 192.168.1.0 0.0.0.255 
[R3-ospf-1-area-0.0.0.2]area 0
[R3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
<R3>display ospf peer 

         OSPF Process 1 with Router ID 3.3.3.3
               Neighbor Brief Information

 Area: 0.0.0.0        
 Router ID       Address         Pri Dead-Time  State             Interface
 4.4.4.4         192.168.4.4     1   39         Full/BDR          GE0/1
 5.5.5.5         192.168.2.5     1   35         Full/BDR          GE0/2

 Area: 0.0.0.2        
 Router ID       Address         Pri Dead-Time  State             Interface
 1.1.1.1         192.168.1.1     1   39         Full/DR           GE0/0
[R4]router id 4.4.4.4 
[R4]ospf 1 
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.1]network 192.168.5.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
<R4>display ospf peer 

         OSPF Process 1 with Router ID 4.4.4.4
               Neighbor Brief Information

 Area: 0.0.0.0        
 Router ID       Address         Pri Dead-Time  State             Interface
 3.3.3.3         192.168.4.3     1   35         Full/DR           GE0/1
 5.5.5.5         192.168.3.5     1   36         Full/BDR          GE0/2

 Area: 0.0.0.1        
 Router ID       Address         Pri Dead-Time  State             Interface
 2.2.2.2         192.168.5.2     1   39         Full/DR           GE0/0
[R5]router id 5.5.5.5
[R5]ospf 1 
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
<R5>display ospf peer 

         OSPF Process 1 with Router ID 5.5.5.5
               Neighbor Brief Information

 Area: 0.0.0.0        
 Router ID       Address         Pri Dead-Time  State             Interface
 3.3.3.3         192.168.2.3     1   36         Full/DR           GE0/0
 4.4.4.4         192.168.3.4     1   32         Full/DR           GE0/1
  1. 要求PC6能ping通PC7
    在这里插入图片描述

  2. 在R3上down掉G0/2时测试链路连通性,并查看追踪路由

[R3]int g0/2 
[R3-GigabitEthernet0/2]shutdown 

在这里插入图片描述

  1. 在R3上down掉G0/1时测试链路连通性,并查看追踪路由
[R3-GigabitEthernet0/2]int g0/1 
[R3-GigabitEthernet0/1]shutdown 

在这里插入图片描述

  1. 分别为每台路由器配置两个环回口,要求PC6能够ping通R12345的所有环回口
[R1]int l1
[R1-LoopBack1]ip add 11.11.11.11 32
[R1]ospf 1 
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]network 11.11.11.11 0.0.0.0
[R2]int l1
[R2-LoopBack1]ip add 22.22.22.22 32
[R2]ospf 1
[R2-ospf-1] area 1 	
[R2-ospf-1-area-0.0.0.1]network 22.22.22.22 0.0.0.0 

依次类推....
在这里插入图片描述

  1. 要求PC6不能访问192.168.4.0网段,访问其他网段均能ping通,以及PC7不能访问192.168.1.0网段,访问其他网段均能ping通
[R1]acl advanced 3000
[R1-acl-ipv4-adv-3000]rule deny icmp source 192.168.6.6 0 destination 192.168.4.
0 0.0.0.255 
[R1]int g0/1
[R1-GigabitEthernet0/1]packet-filter 3000 inbound 
[R2]acl advanced 3000
[R2-acl-ipv4-adv-3000]rule deny icmp source 192.168.7.7 0 destination 192.168.1.
0 0.0.0.255
[R2]int g0/1 
[R2-GigabitEthernet0/1]packet-filter 3000 inbound
  1. 要求PC6不能访问PC7,访问其他网段均能ping通
[R1]acl advanced 3000
[R1-acl-ipv4-adv-3000]rule deny icmp source 192.168.6.6 0 destination 192.168.7.
7 0
  1. 要求PC6不能ping通R2的所有环回口,访问其他网段均能ping通,要求PC7不能ping通R1的所有环回口,访问其他网段均能ping通
[R1]acl advanced 3000
[R1-acl-ipv4-adv-3000]rule deny icmp source 192.168.6.6 0 destination 2.2.2.2 0
[R1-acl-ipv4-adv-3000]rule deny icmp source 192.168.6.6 0 destination 22.22.22.2
2 0
[R2]acl advanced 3000 
[R2-acl-ipv4-adv-3000]rule deny icmp source 192.168.7.7 0 destination 1.1.1.1 0
[R2-acl-ipv4-adv-3000]rule deny icmp source 192.168.7.7 0 destination 11.11.11.1
1 0
  1. 要求PC6不能ping通R5的所有环回口,访问其他网段均能ping通
[R1]acl advanced 3000
[R1-acl-ipv4-adv-3000]rule deny icmp source 192.168.6.6 0 destination 5.5.5.5 0 
[R1-acl-ipv4-adv-3000]rule deny icmp source 192.168.6.6 0 destination 55.55.55.5
5 0
四、实验结果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
好的,以下是一个包含链路聚合 VLAN acl ospf ppp配置的实验: 1. 配置链路聚合: 首先需要在交换机上创建链路聚合组(LAG),例如LAG1,然后将两个物理接口eth1和eth2添加到LAG1中。 ``` Switch(config)# lacp system-priority 8192 Switch(config)# interface range ethernet 1/1-2 Switch(config-if)# channel-group 1 mode active ``` 2. 配置VLAN: 假设需要创建两个VLAN,VLAN10和VLAN20。首先需要将交换机端口trunk化,然后创建VLAN并将端口分配到相应的VLAN中。 ``` Switch(config)# interface range ethernet 1/3-4 Switch(config-if)# switchport mode trunk Switch(config)# vlan 10 Switch(config-vlan)# name VLAN10 Switch(config-vlan)# exit Switch(config)# vlan 20 Switch(config-vlan)# name VLAN20 Switch(config-vlan)# exit Switch(config)# interface range ethernet 1/5-6 Switch(config-if)# switchport access vlan 10 Switch(config-if)# exit Switch(config)# interface range ethernet 1/7-8 Switch(config-if)# switchport access vlan 20 Switch(config-if)# exit ``` 3. 配置ACL: 这里以VLAN10为例,假设需要允许IP地址为192.168.1.0/24的主机访问VLAN10。首先需要创建一个名为ACL1的ACL,然后添加相应的规则。 ``` Switch(config)# access-list 1 permit ip 192.168.1.0 0.0.0.255 any Switch(config)# interface vlan 10 Switch(config-if)# ip access-group 1 in Switch(config-if)# exit ``` 4. 配置OSPF: 假设需要将交换机连接到一个OSPF区域中。首先需要启用OSPF进程,并将交换机端口添加到相应的区域中。 ``` Switch(config)# router ospf 1 Switch(config-router)# network 192.168.1.0 0.0.0.255 area 0 Switch(config-router)# network 192.168.2.0 0.0.0.255 area 0 Switch(config-router)# exit Switch(config)# interface vlan 10 Switch(config-if)# ip ospf 1 area 0 Switch(config-if)# exit Switch(config)# interface vlan 20 Switch(config-if)# ip ospf 1 area 0 Switch(config-if)# exit ``` 5. 配置PPP: 假设需要通过PPP连接到另一个网络。首先需要在交换机上创建一个PPP接口,然后将其连接到另一个网络的PPP接口上。 ``` Switch(config)# interface ppp 1 Switch(config-if)# ip address 192.168.3.1 255.255.255.0 Switch(config-if)# ppp pap sent-username username password password Switch(config-if)# exit Switch(config)# interface vlan 10 Switch(config-if)# pppoe-client dial-pool-number 1 Switch(config-if)# exit ``` 注意,以上配置仅供参考,具体配置取决于实验环境和需求。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学识小鑫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值