填空题 [说明]如图所示,企业中共有三个部门:工程部、财务部、技术部。只有一个公网地址为172.16.1.1/24,PC1、PC3、PC5分别为三个部门的部门经理使用。所有的员工通过一个公网地址与互联网通信;使各部门经理之间能相互通信,普通员工之间不能相互通信。
填空题 通过配置 1使企业中所有的计算机都能通过唯一的公网地址与互联网通信。通过配置 2划分各个部门,并配置 3实现每个部门经理之间能够通信,普通员工之间不能相互通信。
填空题 首先在R1和R2上做基本配置,完成部分语句的解释或命令。
R1
Router>en
Router#conf t
Enter configuration commands, one per 1ine. End with CNTL/Z.
Router (config) # host r1
r1 (config) # int s0/0
r1 (config-if) # ip addr 172.16.1.1 255.255.255.0
r1 (config-if) # no shut
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
r1 (config-if) # clock rate 64000
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to u
r1 (config-if) # exit
r1 (config) # int f0/0
r1 (config-if) # no ip addr
r1 (config-if) # no shut
r1 (config-if) # exit
r1 (config) # int f0/0.1 配置子接口
r1 (config-subif) # encapsulation 1 //配置子接口必须使用dot1Q进行封装
r1 (config-subif) # ip addr 192.168.1.1 255.255.255.0
r1 (config-subif) # no shut
r1 (config-subif) # exit
r1 (config) # int f0/0.2 配置子接口
r1 (config-subif) # encapsulation 2 //配置子接口必须使用dot1Q进行封装
r1 (config-subif) # ip addr 192.168.2.1 255.255.255.0
r1 (config-subif) # no shut
r1 (config-subif) # exit
r1 (config) # int f0/0.3 配置子接口
r1 (config-subif) # encapsulation 3 //配置子接口必须使用dot1Q进行封装
r1 (config-subif) # ip addr 192.168.3.1 255.255.255.0
我们把R2当作公网使用,所以只需要在R2的S0/0口上配置ip。
填空题 基本配置完成了,接下来第一步,我们要让企业中的所有员工都能通过唯一的公网ip 172.16.1.1/24与互联网相互通信。
R1
r1 (config) # ip nat pool internet 172.16.1.1 172.16.1.1 netmask 255.255.255.0 1
r1 (config) # access-list 10 permit 2 //通过标准访问控制列表定义内部网络的上网条件
r1 (config) # ip nat inside source list 10 pool internet overload //建立全局地址池与标准访问控制列表之间的映射关系
r1 (config) # int S0/0
r1 (config-if) #v //外网接口绑定(要想配置能实现应用必须在内外网接口上绑定)
r1 (config-if) # exit
r1 (config) # int f0/0
r1 (config-if) # 3 //内网接口绑定
填空题 通过配置VLAN划分各个部门,并配置ACL以实现每个部门经理之间能够通信,普通员工之间不能相互通信。
Sw
Switch>en
Switch#conf t
Enter confiquration commands, one per line. End with CNTL/Z.
Switch (config) # int f0/1
Switch (config-if) # switchport mode trunk 1
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Switch (config-if) # exit
Switch (config) # vlan 2 创建VLAN 2
Switch (config-vlan) # 2 //VLAN2命名为工程部
Switch (config-vlan) # exit
Switch (config) # vlan 3 创建VLAN 3
Switch (config-vlan) # 3 //VLAN2命名为财务部
Switch (config-vlan) # exit
Switch (config-vlan) # vlan 4 创建VLAN 4
Switch (confiq-vlan) # 4 //VLAN2命名为技术部
Switch (config-vlan) # exit
Switch (config) # int f0/2
Switch (config-if) # switchport access vlan 2 5
Switch (config-if) # exit
Switch (config) # int f0/3
Switch (config-if) # switchport access vlan 2
Switch (config-if) # exit
Switch (config) # int f0/4
Switch (config-if) # switchport access vlan 3
Switch (config-if) # exit
Switch (config) # int f0/5
Switch (config-if) # switchport access vlan 3
Switch (config-if) # exit
Switch (config) # int f0/6
Switch (config-if) # switchport access vlan 4
Switch (config-if) # exit
Switch (config) # int f0/7
Switch (config-if) # switchport access vlan 4
Switch (config-if) # exit
然后定义访问控制列表。(在此题中,允许一台特定主机而拒绝一个网段,所以要把拒绝主机放在上面。)
注意:要想一个访问列表能够得到应用,必须在接口绑定。
R1
r1 (config) # access-list 10 permit 192.168.2.2 0.0.0.0
r1 (config) # access-list 10 deny 192.168.2.0 0.0.0.255_
r1 (config) # access-list 10 permit 192.168.3.2 0.0.0.0_
r1 (config) # access-list 10 deny 192.168.3.0 0.0.0.255_
r1 (config) # access-list 10 permit any_
r1 (config) # int f0/0.1
r1 (config-subif) # ip access-group 10 out
r1 (config-subif) # exit
r1 (config) # access-list 11 permit 192.168.1.2 0.0.0.0
r1 (config) # access-list 11 deny 192.168.1.0 0.0.0.255
r1 (config) # access-list 11 permit 192.168.3.2 0.0.0.0
r1 (config) # access-list 11 deny 192.168.3.0 0.0.0.255
r1 (config) # access-list 11 permit any
r1 (config) # int f0/0.2
r1 (config-subif) # ip access-group 1l out
r1 (config-subif) # exit
r1 (config) # access-list 12 permit 192.168.1.2 0.0.0.0
r1 (config) # access-list 12 deny 192.168.1.0 0.0.0.255
r1 (config) # access-list 12 permit 192.168.2.2 0.0.0.0
r1 (config) # access-list 12 deny 192.168.2.0 0.0.0.255
r1 (config) # access-list 12 permit any
r1 (config) # int f0/0.3
r1 (config-subif) # ip access-group 12 out
r1 (config-subif) # exit
现在通过配置后所有的员工都能与互联网通信。(由于主机较多就不一一列述)