实验九 典型企业网络实训案例
实验九典型企业网络实训案例
实验目的:
1. 能够叙述企业网络规划设计的主要流程、注意事项;
2. 能清晰表达在企业网络建设中可能用到的主要技术以及实现方法;
3. 能利用前面所学的知识和技能,初步学会网络的设计与规划。
实验内容:
如图1,一个中型企业的XX 通信公司,大约200名员工,公司分为5个部门,人事部、财务部、销售部、市场部、技术部。现在要设计一个网络,要求如下:
1. 公司内部要有内网,使各部门员工的终端能够实现连通。
2. 所有公司员工都能访问远程分支机构。
3. 公司财务部的数据很重要,要有一定的安全措施。
4. 按表格里的内容划分VLAN 。
5. SW1作为核心交换机,配置VTP 域,域名为company ,SW2~5作为接入层交换机,要求
能够自己学习核心交换机上的VLAN 信息。
6. 配置交换机之间的Trunk 链路,保证能够进行跨交换机之间的VLAN 通信。
7. 配置生成树协议,手工选举核心交换机为STP 根桥。
8. 配置单区域的OSPF 动态路由协议。
9. 验证:①相同VLAN 的主机之间是否能通信;②不同VLAN 之间的主机是否能通信;③
主机能否ping 通自己的网关;④主机是否能与远程分支机构的主机通信。
图1 网络拓扑图
1. 配置步骤
1.Trunk 模式设置
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname switch1
switch1(config)#interface fa 0/2
switch1(config-if)#switchport mode trunk
switch1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up switch1(config-if)#exit
switch1(config)#interface fa 0/3
switch1(config-if)#switchport mode trunk
switch1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up switch1(config-if)#exit
switch1(config)#interface fa 0/4
switch1(config-if)#switchport mode trunk
switch1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up switch1(config-if)#exit
switch1(config)#interface fa 0/5
switch1(config-if)#switchport mode trunk
switch1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up switch1(config-if)#exit
switch1(config)#
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname Switch2
Switch2(config)#interface fa0/2
Switch2(config-if)#switchport mode trunk
Switch2(config-if)#exit
Switch2(config)#
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname Switch 3
^
% Invalid input detected at '^' marker.
Switch(config)#hostname Switch3
Switch3(config)#interface f0/3
Switch3(config-if)#switchport mode trunk
Switch3(config-if)#exit
Switch3(config)#
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname Switch4
Switch4(config)#interface fa0/4
Switch4(config-if)#switchport mode trunk
Switch4(config-if)#exit
Switch4(config)#
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname Switch5
Switch5(config)#interface fa 0/5
Switch5(config-if)#switchport mode trunk
Switch5(config-if)#exit
Switch5(config)#
2. 配置交换机VTP
switch1(config)#vtp domain company
Changing VTP domain name from NULL to company
switch1(config)#vtp mode server
Device mode already VTP SERVER.
switch1(config)#
Switch2(config)#vtp domain company
Domain name already set to company.
Switch2(config)#vtp mode client
Setting device to VTP CLIENT mode.
Switch2(config)#
Switch3(config)#vtp mode client
Setting device to VTP CLIENT mode.
Switch3(config)#
Switch4(config)#vtp domain company
Domain name already set to company.
Switch4(config)#vtp mode client
Setting device to VTP CLIENT mode.
Switch4(config)#
Switch5(config)#vtp domain company
Domain name already set to company.
Switch5(config)#vtp mode client
Setting device to VTP CLIENT mode.
Switch5(config)#
3. 配置各交换机VLAN
switch1#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
switch1(vlan)#vlan 30 name technic
VLAN 30 added:
Name: technic
switch1(vlan)#vlan 40 name HR
VLAN 40 added:
Name: HR
switch1(vlan)#vlan 50 name financial
VLAN 50 added:
Name: financial
switch1(vlan)#vlan 10 name sales
VLAN 10 added:
Name: sales
switch1(vlan)#vlan 20 name marketing
VLAN 20 added:
Name: marketing
switch1(vlan)#exit
APPLY completed.
4. 将各接口划分到指定的vlan 中
switch1(config)#int fa 0/6
switch1(config-if)#switchport access vlan 50
…….
5. 设置Switch1为根桥,并在switch1~5上设置RSTP 快速生成树协议
switch1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
switch1(config)#spanning-tree vlan 10,20,30,40,50 root primary
switch1(config)#spanning-tree mode rapid-pvst
switch2(config)#spanning-tree mode rapid-pvst
switch3(config)#spanning-tree mode rapid-pvst
switch4(config)#spanning-tree mode rapid-pvst
switch5(config)#spanning-tree mode rapid-pvst
6.switch1~5配置链路类型
switch1(config)#interface range fa0/2-5
switch1(config-if-range)#duplex full
switch1(config-if-range)#
%LINK-5-CHANGED: Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down %LINK-5-CHANGED: Interface FastEthernet0/3, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINK-5-CHANGED: Interface FastEthernet0/4, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down %LINK-5-CHANGED: Interface FastEthernet0/5, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down switch1(config-if-range)#spanning-tree link-type point-to-point
Switch2(config)#interface range fa0/2
Switch2(config-if-range)#duplex full
Switch2(config-if-range)#
%LINK-5-CHANGED: Interface FastEthernet0/2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up Switch2(config-if-range)#spanning-tree link-type point-to-point
Switch3(config)#interface range fa0/3
Switch3(config-if-range)#duplex full
Switch3(config-if-range)#
%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch3(config-if-range)#spanning-tree link-type point-tp-point
^
% Invalid input detected at '^' marker.
Switch3(config-if-range)#spanning-tree link-type point-to-point
Switch4(config)#interface range fa0/4
Switch4(config-if-range)#duplex full
Switch4(config-if-range)#
%LINK-5-CHANGED: Interface FastEthernet0/4, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up
Switch4(config-if-range)#spanning-tree link-type point-to-point
Switch5(config)#interface range fa0/5
Switch5(config-if-range)#duplex full
Switch5(config-if-range)#
%LINK-5-CHANGED: Interface FastEthernet0/5, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up Switch5(config-if-range)#spanning-tree link-type point-to-point
7. 设置路由器子接口
R1(config)#int fa0/0
R1(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R1(config-if)#exit
R1(config)#int fa0/0.1
%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up R1(config-subif)#encapsulation dot1Q 10 //封装vlan10 dot1Q信息
R1(config-subif)#ip add 192.168.10.1 255.255.255.0
R1(config-subif)#no sh
R1(config-subif)#exit
R1(config)#int fa0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up R1(config-subif)#encapsulation dot1Q 30 //封装vlan30 dot1Q信息
R1(config-subif)#ip add 192.168.11.1 255.255.255.0
R1(config-subif)#no sh
R1(config-subif)#exit
…………………
R1(config)#int fa0/1
R1(config-if)#ip add 192.168.20.1 255.255.255.0
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
R1(config-if)#no sh
8. 配置单区域OSPF 动态路由协议
R1(config)#router ospf 1
R1(config-router)#network 192.168.10.0 0.0.0.255 area 0
R1(config-router)#network 192.168.20.0 0.0.0.255 area 0
R1(config-router)#network 192.168.11.0 0.0.0.255 area 0
R1(config-router)#exit
R1(config)#
R2(config)#int fa 0/1
R2(config-if)#ip add 192.168.20.2 255.255.255.0
R2(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up R2(config-if)#
R2(config)#router ospf 1
R2(config-router)#network 192.168.20.0 0.0.0.255 area 0
R2(config-router)#exit
Router(config)#
9. 配置测试计算机基本IP 等信息(前面已经将交换机接口划分到了指定vlan 中) 总经理PC :ip:192.168.11.162 vlan 50
副总经理PC :ip:192.168.11.163 vlan 50
用户1 PC:ip:192.168.10.2 vlan 10
用户2 PC:ip:192.168.10.130 vlan 20
用户3 PC:ip:192.168.20.10 远程分支机构用户PC
10. 验证:
1. 相同vlan 之间通信:在总经理PC 上ping 副总经理PC
PC>ping 192.168.11.163
Pinging 192.168.11.163 with 32 bytes of data:
Reply from 192.168.11.163: bytes=32 time=11ms TTL=128
Reply from 192.168.11.163: bytes=32 time=0ms TTL=128
Reply from 192.168.11.163: bytes=32 time=0ms TTL=128
Reply from 192.168.11.163: bytes=32 time=0ms TTL=128
Ping statistics for 192.168.11.163:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 11ms, Average = 2ms
2. 不同vlan 之间通信:在用户1 PC上ping 总经理PC
PC>ping 192.168.11.162
Pinging 192.168.11.162 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.11.162:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)
3. 主机ping 自己的网关:用户2 PC (vlan20)ping自己网关(192.168.10.129)
PC>ping 192.168.10.129
Pinging 192.168.10.129 with 32 bytes of data:
Reply from 192.168.10.129: bytes=32 time=18ms TTL=128
Reply from 192.168.10.129: bytes=32 time=13ms TTL=128
Reply from 192.168.10.129: bytes=32 time=17ms TTL=128
Reply from 192.168.10.129: bytes=32 time=1ms TTL=128
Ping statistics for 192.168.10.129:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 18ms, Average = 12ms
4. 本地主机与远程分支机构主机的通信:在用户1 PC上ping 用户3 PC
PC>ping 192.168.20.10
Pinging 192.168.20.10 with 32 bytes of data:
Reply from 192.168.20.10: bytes=32 time=4ms TTL=128
Reply from 192.168.20.10: bytes=32 time=1ms TTL=128
Reply from 192.168.20.10: bytes=32 time=3ms TTL=128
Reply from 192.168.20.10: bytes=32 time=4ms TTL=128
Ping statistics for 192.168.20.10:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 4ms, Aver
2. 总结
在本次实验中,对以前的知识进行了总结,比如vlan 的划分、设置VTP 、配置交换机Trunk 链路、设置路由器子接口、生成树协议、配置单区域的OSPF 动态路由协议等等。由于对以前已学过的知识不能够熟练掌握,所以在执行实验任务时出现了很多问题,只能够大致叙述出配置步骤,但具体在编程设置上出现了许多错误,导致多次连接不通,在多次查看以往实验及请教同学和老师后了解了问题所在,并顺利解决了问题。经过本次实验,我意识到了深入理解及复习所学的重要性,在以后的学习中应注意这些,避免出现相同的错误,并在多次实验中不断进步。