实验拓扑
实验需求
你是公司的网络管理员,PC1代表公司的研发部门,PC2是公司的一些普通员工,公司内部有两台路由器和一台服务器,服务器上运行DNS服务,只提供给内部研发人员使用。
- 为了方便管理员管理设备,请按图示修改设备名称;
略。
- 如图所示,给对应的接口配置上IP地址;
R1:
[R1]in g0/0/0
[R1-GigabitEthernet0/0/0]ip ad 192.168.10.254 24
[R1-GigabitEthernet0/0/0]in g0/0/1
[R1-GigabitEthernet0/0/1]ip ad 10.1.1.1 24
R2:
[R2]in g0/0/0
[R2-GigabitEthernet0/0/0]ip ad 10.1.1.2 24
[R2-GigabitEthernet0/0/0]in g0/0/1
[R2-GigabitEthernet0/0/1]ip ad 112.18.1.2 24
Server1:
PC1&PC2:
- 为了使网络互通,请在 GW 和 R2 上配置对应的明细静态路由,实现全网互联;
R1:
[R1]ip route-static 112.18.1.0 24 10.1.1.2
R2:
[R2]ip route-static 192.168.10.0 24 10.1.1.1
Ping测试:
- 为了规范内部员工上网行为,需要对网络进行一些限制,具体如下:
a) 通过配置基本ACL2000实现PC2不能访问服务器的任何资源,但是可以访问其他路由器;
R2:
[R2]acl 2000
[R2-acl-basic-2000]rule 5 deny source 192.168.10.2 0
# 拒绝PC2的所有包
[R2-acl-basic-2000]in g0/0/1
[R2-GigabitEthernet0/0/1]traffic-filter outbound acl 2000
# 在出口方向调用
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210707165450701.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0ODc0NjQ1,size_16,color_FFFFFF,t_70)
测试:
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210707165459569.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0ODc0NjQ1,size_16,color_FFFFFF,t_70)
b) 在 GW 上配置基本ACL2001实现 PC2 访问 GW 时只ping 通,不能telnet 访问;
R1:
~~~bash
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123
[R1-ui-vty0-4]q
[R1]acl 2001
[R1-acl-basic-2001]rule deny source 192.168.10.2 0
[R1-acl-basic-2001]rule permit
# 默认允许动作
[R1-acl-basic-2001]user vty 0 4
[R1-ui-vty0-4]acl 2001 inbound
# 调用ACL
eNSP的PC没有telnet功能无法验证。
c) 在 GW 上配置高级ACL实现PC1无法访问服务器的DNS 服务,但不影响其他业务;
R1:
[R1]acl 3000
[R1-acl-adv-3000]rule deny tcp source 192.168.10.1 0 destination 112.18.1.100 0
destination-port eq 53
[R1-acl-adv-3000]rule deny udp source 192.168.10.1 0 destination 112.18.1.100 0
destination-port eq 53
[R1-acl-adv-3000]in g0/0/0
[R1-GigabitEthernet0/0/0]traffic-filter outbound acl 3000
d) 在 GW 上配置高级ACL实现client无法访问ftp 服务,但不影响其他业务;
R1:
[R1]acl 3001
[R1-acl-adv-3001]rule deny tcp source 192.168.10.3 0 destination 112.18.1.100 0 destination-port eq ftp
[R1-acl-adv-3001]in g0/0/0
[R1-GigabitEthernet0/0/0]traffic-filter outbound acl 3001