2. 首先在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 ______ //配置子接口必须使用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 ______ //配置子接口必须使用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 ______ //配置子接口必须使用dot1Q进行封装
r1 (config-subif) # ip addr 192.168.3.1 255.255.255.0
我们把R2当作公网使用,所以只需要在R2的S0/0口上配置ip。
dot1Q 2 dot1Q 3 dot1Q 4
[解析] 由于试验过程中要使用VLAN间路由,所以需要使用dot1Q进行封装来配置子接口。
4. 通过配置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 ______
%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) # ______ //VLAN2命名为工程部
Switch (config-vlan) # exit
Switch (config) # vlan 3 创建VLAN 3
Switch (config-vlan) # ______ //VLAN2命名为财务部
Switch (config-vlan) # exit
Switch (config-vlan) # vlan 4 创建VLAN 4
Switch (confiq-vlan) # ______ //VLAN2命名为技术部
Switch (config-vlan) # exit
Switch (config) # int f0/2
Switch (config-if) # switchport access vlan 2 ______
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
现在通过配置后所有的员工都能与互联网通信。(由于主机较多就不一一列述)
配置Trunk链路 name gongchengbu vlan2 name caiwubu VLAN3 name jishubu VLAN4 给VLAN2手工添加成员
[解析] 参考VLAN配置。