计算机网络访问控制列表实验

计算机网络
实验四:访问控制列表实验
问题:添加三个路由器,三台计算机,首先设置静态路由,并实验访问控制列表的设置
在这里插入图片描述

/****************路由器B基础设置****************/
<Quidway>system
Enter system view, return to user view with Ctrl+Z.
[Quidway]]interface ethernet0
[Quidway-Ethernet0]]ip address 10.65.1.2 255.255.0.0
[Quidway-Ethernet0]undo shutdown
//上面是对路由器的接口e0进行配置,设置了ip地址和子网掩码
[Quidway-Ethernet0]int e1
[Quidway-Ethernet1]ip address 10.66.1.2 255.255.0.0
[Quidway-Ethernet1]undo shutdown
//对接口e1进行了配置,设置了ip地址和子网掩码
[Quidway-Ethernet1]int s1
[Quidway-Serial1]ip address 10.68.1.2 255.255.0.0
 [Quidway-Serial1]clock rate 64000
[Quidway-Serial1]undo shutdown
//对接口s1进行了配置,这里注意的是,自己设置了clock,这样就表示成功了,如果自己在这里不主动设置clock,那么即使在后面在系统的提示下设置clock,也不会成功
 [Quidway-Serial1]quit
[Quidway]ip routing
[Quidway]ip route-static 10.69.0.0 255.255.0.0 10.68.1.1  (静态路由,下同)/*设置静态路由,说明到达10.69.0.0 网络的下一跳路由为10.68.1.1*/
[Quidway]ip route-static 10.65.0.0 255.255.0.0 10.68.1.2/*设置静态路由,说明到达10.65.0.0 网络的下一跳路由为10.68.1.2*/

/**********************路由器A基础设置*******************/
<Quidway>system
Enter system view, return to user view with Ctrl+Z.
[Quidway]interface ethernet0
[Quidway-Ethernet0]ip address 10.69.1.2 255.255.0.0
[Quidway-Ethernet0]undo shutdown
//对路由器的接口e0进行设置IP地址,子网掩码
[Quidway-Ethernet1]int s0
[Quidway-Serial0]ip address 10.78.1.1 255.255.0.0
[Quidway-Serial0]clock rate 64000
[Quidway-Serial0]undo shutdown
//对s0接口进行设置IP地址,子网掩码,同时设置clock
[Quidway-Serial0]quit
[Quidway]ip routing
[Quidway]ip route-static 10.65.0.0 255.255.0.0 10.78.1.2   (静态路由)
[Quidway]ip route-static 10.69.0.0 255.255.0.0 10.78.1.1

/**********************路由器C基础设置*******************/
router>system
Enter system view, return to user view with Ctrl+Z.
[Quidway]interface s0
[Quidway-Serial0]ip address 10.68.1.1 255.255.0.0
[Quidway-Serial0]undo shutdown
//对路由器c的s0接口进行设置IP地址,子网掩码
[Quidway-Serial0]int s1
[Quidway-Serial1]ip address 10.78.1.2 255.255.0.0
[Quidway-Serial1]undo shutdown
//对s1接口进行设置IP地址,子网掩码
[Quidway-Serial1]quit
[Quidway]ip routing
[Quidway]ip route-static 10.69.0.0 255.255.0.0 10.78.1.1(静态路由)
[Quidway]ip route-static 10.65.0.0 255.255.0.0 10.68.1.2 

/********************主机A设置************************/
PCA login: root
password: linux
[root@PCA root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0
//设置A的ip地址
[root@PCA root]# route add default gw 10.65.1.2
//设置A的默认路由,相当于A入网,能和外界联系
证明:

/*******************主机B设置*************************/
PCC login: root
password: linux
[root@PCC root]# ifconfig eth0 10.69.1.1 netmask 255.255.0.0
//设置B的ip地址
[root@PCC root]# route add default gw 10.69.1.2
设置B的默认路由,相当于入网,能和外界联系

/*******************主机C设置*************************/
PCC login: root
password: linux
[root@PCC root]# ifconfig eth0 10.66.1.1 netmask 255.255.0.0
//设置C的IP地址
[root@PCC root]# route add default gw 10.66.1.2
//设置C的默认路由,相当于入网,能和外网


默认路由的作用:
在这里插入图片描述
在这里插入图片描述

[root@PCA root]#ping 10.69.1.1 通
根据:
路由器B  [Quidway]ip route-static 10.69.0.0 255.255.0.0 10.68.1.1
路由器C  [Quidway]ip route-static 10.69.0.0 255.255.0.0 10.78.1.1
主机B    [root@PCB root]# route add default gw 10.69.1.2
[root@PCB root]#ping 10.69.1.1
对路由器C设置访问控制列表
[Quidway]firewall enable
[Quidway]firewall default permit
[Quidway]acl 10
[Quidway-acl-10]rule normal deny source 10.65.1.1  /*禁止源为10.65.1.1的访问*/
[Quidway-acl-10]rule normal permit soure any
[Quidway-acl-10]int s0
[Quidway-Serial0]firewall packet-filter 10 inbound
[Quidway-Serial0]quit
[Quidway]display acl

[root@PCA root]#ping 10.69.1.1 不通
因为[Quidway-acl-10]rule normal deny source 10.65.1.1  /*禁止源为10.65.1.1的访问*/


[root@PCB root]#ping 10.69.1.1通


更改路由器C设置
[Quidway]undo acl 10
[root@PCA root]#ping 10.69.1.1[root@PCB root]#ping 10.69.1.1
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值