小型内部局域网组建
某公司组建小型局域网内部使用,该公司现有员工200人,5个部门分别为经理室,财务部,人力资源部,销售部,企管部。实现如下要求:
1、 为了简化管理Vlan需要集中配置和管理。
2、 每个部门一个vlan,其中经理室和财务部数据可以互访,其他不能互访。
3、 为了安全性性各部分访问服务器通过做冗余备份,并且只有经理和财务部可以访问。
4、 为了减轻交换机负担,经理室和财务部访问服务器走不同的路径。
5、 连接pc端口实现端口安全,只允许当前主机接入,违规之后shutdown。
6、 所有接pc端口不进行生成树的计算。
通过以上需求分析指定vlan和ip网段如下:
经理室 vlan 10 192.168.10.0/24
财务部 vlan 20 192.168.20.0/24
人资部 vlan 30 192.168.30.0/24
销售部 vlan 40 192.168.40.0/24
企管部 vlan 50 192.168.50.0/24
设计拓扑图如下:
配置:
1、Vtp域名:abc , sw1为vtp server sw2,sw3为vtp client
sw1,2,3 vtp password cisco
2、通过在路由器上做单臂路由实验,经理室和财务室在路由上做网关,其他部门不做。
3、保证经理室和财务室的生成树根桥在不同交换机上。
4、int rang f0/3 -7
Switchport mode access
Switchport port-security
Spanning-tree portfast
路由与交换技术综合实训
题目: 小型内部局域网组建
学号:
姓名:
专业:
班级:
20##年12月
第一章 需求分析与整体结构设计
1.1 需求分析
某公司组建小型局域网内部使用,该公司现有员工200人,5个部门分别为经理室,财务部,人力资源部,销售部,企管部。实现如下要求:
7、为了简化管理Vlan需要集中配置和管理。
8、每个部门一个Vlan,其中经理室和财务部数据可以互访,其他不能互访。
9、为了安全性性各部分访问服务器通过做冗余备份,并且只有经理和财务部可以访问。
10、 为了减轻交换机负担,经理室和财务部访问服务器走不同的路径。
11、 连接pc端口实现端口安全,只允许当前主机接入,违规之后shutdown。
12、 所有接pc端口不进行生成树的计算。
1.2 整体结构设计及技术分析
指定vlan和ip网段如下:
经理室 vlan 10 192.168.10.0/24
财务部 vlan 20 192.168.20.0/24
人资部 vlan 30 192.168.30.0/24
销售部 vlan 40 192.168.40.0/24
企管部 vlan 50 192.168.50.0/24
Vlan 命名:
Vlan 10 jingli
Vlan 20 caiwu
Vlan 30 renzi
Vlan 40 xiaoshou
Vlan 50 qiguan
1、Vtp域名:abc , sw1为vtp server sw2,sw3为vtp client
sw1,2,3 vtp password cisco
2、通过在路由器上做单臂路由实验,经理室和财务室在路由上做网关,其他部门不做。
3、保证经理室和财务室的生成树根桥在不同交换机上。
第二章 网络拓扑设计
第三章 网络方案分析
1. 为交换机划分vlan
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name jingli
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name caiwu
Switch(config-vlan)#vlan 30
Switch(config-vlan)#name renzi
Switch(config-vlan)#vlan 40
Switch(config-vlan)#name xiaoshou
Switch(config-vlan)#vlan 50
Switch(config-vlan)#name qiguan
2. 使用vtp集中管理配置vlan
Switch2:
Switch(config)#vtp domain abc
Changing VTP domain name from NULL to abc
Switch(config)#vtp mode server
Device mode already VTP SERVER.
Switch3:
Switch(config)#vtp domain abc
Changing VTP domain name from NULL to abc
Switch(config)#vtp mode cli
Switch(config)#vtp mode client
Setting device to VTP CLIENT mode.
3. Trunk
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/2
Switch(config-if)#switchport mode trunk
4. 端口划分进vlan(每个部门一个vlan)
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/3
Switch(config-if)#switchport access vlan 10
Switch(config-if)#
Show Vlan:
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24, Gig1/1, Gig1/2
10 jingli active Fa0/5
20 caiwu active Fa0/4
30 renzi active Fa0/3
40 xiaoshou active Fa0/6
50 qiguan active Fa0/7
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
给主机设置ip地址,同一vlan下的互通:
PC>ping 192.168.10.2
Pinging 192.168.10.2 with 32 bytes of data:
Reply from 192.168.10.2: bytes=32 time=20ms TTL=128
Reply from 192.168.10.2: bytes=32 time=12ms TTL=128
Reply from 192.168.10.2: bytes=32 time=13ms TTL=128
Reply from 192.168.10.2: bytes=32 time=12ms TTL=128
Ping statistics for 192.168.10.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 12ms, Maximum = 20ms, Average = 14ms
5. 单臂路由
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/3
Switch(config-if)#switchport mode trunk
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/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
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip add 192.169.20.254 255.255.255.0
设置主机网管
经理室网关: 192.168.10.254
财务室网关: 192.168.20.254
互ping
PC>ping 192.168.20.2
Pinging 192.168.20.2 with 32 bytes of data:
Reply from 192.168.20.2: bytes=32 time=24ms TTL=127
Reply from 192.168.20.2: bytes=32 time=24ms TTL=127
Reply from 192.168.20.2: bytes=32 time=24ms TTL=127
Reply from 192.168.20.2: bytes=32 time=25ms TTL=127
Ping statistics for 192.168.20.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 24ms, Maximum = 25ms, Average = 24ms
PC>ping 192.168.10.1
Pinging 192.168.10.1 with 32 bytes of data:
Reply from 192.168.10.1: bytes=32 time=24ms TTL=127
Reply from 192.168.10.1: bytes=32 time=24ms TTL=127
Reply from 192.168.10.1: bytes=32 time=22ms TTL=127
Reply from 192.168.10.1: bytes=32 time=24ms TTL=127
Ping statistics for 192.168.10.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 22ms, Maximum = 24ms, Average = 23ms
6. 经理室和财务室走不同路径
Switch1作为经理室的根网桥
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#spanning-tree vlan 10 root primary
Switch(config)#
Switch2作为财务室的根网桥
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#spanning-tree vlan 20 root primary
Switch(config)#
查看网桥
Switch#show sp
Switch#show spanning-tree vlan 10
VLAN0010
Spanning tree enabled protocol ieee
Root ID Priority 16394
Address 00D0.FFE2.1476
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 16394 (priority 16384 sys-id-ext 10)
Address 00D0.FFE2.1476
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/2 Desg FWD 19 128.2 P2p
Fa0/3 Desg FWD 19 128.3 P2p
Switch#show spanning-tree vlan 20
VLAN0020
Spanning tree enabled protocol ieee
Root ID Priority 24596
Address 00E0.F725.0D2D
Cost 19
Port 2(FastEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32788 (priority 32768 sys-id-ext 20)
Address 00D0.FFE2.1476
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 AltnBLK 19 128.1 P2p
Fa0/2 Root FWD 19 128.2 P2p
Fa0/4 Desg FWD 19 128.4 P2p
7. 端口安全
Switch(config)#int f0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
Switch(config-if)#switchport port-security mac-address 0002.174B.41BA
Switch(config-if)#switchport port-security violation shutdown
Switch(config-if)#
只允许当前主机进入 违规后shutdown(mac地址唯一)
8.所有pc不计算生成树
Switch(config)#int range f0/3 -7
Switch(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast will be configured in 5 interfaces due to the range command
but will only have effect when the interfaces are in a non-trunking mode.
(把所有pc端口改为速端口)
第四章 总结
1. 应用vlan划分
2. vtp协议:集中管理配置vlan
3. 单臂路由
4. stp生成树优化
5. trunk:承载多组vlan的数据
6. 端口安全