实验报告
Trunk和单臂路由
一、实验环境
硬件环境:PC机一台;
软件环境:Packet Tracer v5.0
二、项目需求
根据Benet通信公司的组织结构图为公司组建网络实现信息化办公。要求:
1.用户公司需要连接内部网络,各部门员工的终端能实现连通。
2.所有公司员工都能访问远程分支机构。
3.公司财务部的数据很重要,不希望其他部门的员工访问到。
三、项目设计
Benet通信公司的全部的地址空间是192.168.10.0/24和192.168.11.0/24`远程分支机构的IP 地址段是192.168.20.0/24,与本端接口的IP是192.168.20.2/30。
IP子网地址规划
|
部门 |
地址空间 |
所属Vlan |
|
总经理 |
192.168.11.162/27 |
Vlan50 |
|
副总经理 |
192.168.11.163/27 |
Vlan50 |
|
销售部 |
192.168.10.0/25 |
Vlan10 |
|
市场部 |
192.168.10.128/25 |
Vlan20 |
|
技术支持部 |
192.168.11.0/25 |
Vlan30 |
|
人事行政部 |
192.168.11.128/27 |
Vlan40 |
|
财务部 |
192.168.11.160/27 |
Vlan50 |
路由器接口IP地址规划
|
路由器接口 |
IP地址空间 |
用途 |
|
路由器对外接口地址 |
192.168.20.1/30 |
Fa0/1 |
|
路由器内部接口地址 |
192.168.10.1/25 |
Fa0/0.1 Vlan 10 网关 |
|
192.168.10.129/25 |
Fa0/0.2 Vlan 20 网关 |
|
192.168.11.1/25 |
Fa0/0.3 Vlan 30 网关 |
|
192.168.11.129/27 |
Fa0/0.4 Vlan 40 网关 |
|
192.168.11.161/27 |
Fa0/0.5 Vlan 50 网关 |
端口规划
|
设备名称 |
接口 |
用途 |
接口类型 |
|
R1 |
Fastethernet0/0 |
连接SW1 |
Trunk接口 |
|
Fastethernet0/1 |
连接远程分支机构 |
路由接口 |
|
SW1 |
Fastethernet0/1 |
连接R1 |
Trunk接口 |
|
Fastethernet0/2 |
连接SW2 |
Trunk接口 |
|
Fastethernet0/3 |
连接SW3 |
Trunk接口 |
|
Fastethernet0/4 |
连接SW4 |
Trunk接口 |
|
Fastethernet0/5 |
连接SW5 |
Trunk接口 |
|
Fastethernet0/6 |
连接总经理PC |
Access接口,Vlan50 |
|
Fastethernet0/7 |
连接副总经理PC |
Access接口,Vlan50 |
|
Fastethernet0/11~30 |
连接用户PC |
Access接口,Vlan10 |
|
Fastethernet0/31~45 |
连接用户PC |
Access接口,Vlan20 |
|
SW2 |
Fastethernet0/1 |
连接SW1 |
Trunk接口 |
|
Fastethernet0/6~40 |
连接用户PC |
Access接口,Vlan10 |
|
Fastethernet0/41~48 |
连接用户PC |
Access接口,Vlan20 |
|
SW3 |
Fastethernet0/1 |
连接SW1 |
Trunk接口 |
|
Fastethernet0/6~10 |
连接用户PC |
Access接口,Vlan10 |
|
Fastethernet0/11~47 |
连接用户PC |
Access接口,Vlan20 |
|
SW4 |
Fastethernet0/1 |
连接SW1 |
Trunk接口 |
|
Fastethernet0/6~35 |
连接用户PC |
Access接口,Vlan30 |
|
Fastethernet0/36~45 |
连接用户PC |
Access接口,Vlan40 |
|
SW5 |
Fastethernet0/1 |
连接SW1 |
Trunk接口 |
|
Fastethernet0/6~35 |
连接用户PC |
Access接口,Vlan30 |
|
Fastethernet0/36~45 |
连接用户PC |
Access接口,Vlan50 |
交换机配置数据
|
序号 |
需要配置的参数 |
内容 |
|
1 |
主机名 |
SW1、SW2、SW3、SW4、SW5 |
|
2 |
加密保存的密码 |
123 |
|
3 |
添加Vlan |
ID:10 名称:sales |
|
ID:20 名称:marketing |
|
ID:30 名称:technic |
|
ID:40 名称:FR |
|
ID:50 名称:financial |
|
4 |
配置Vlan Trunk |
详细请参考表端口规划 |
路由配置数据
|
序号 |
需要配置的参数 |
内容 |
|
1 |
主机名 |
R1 |
|
2 |
加密保存的密码 |
123 |
|
3 |
配置单臂路由 |
封装802.1Q,支持VLAN ID1、10、20、30、40、50 |
|
4 |
配置默认路由 |
连接远程分支机构 |
四、项目实施
在R1路由器上设置单臂路由:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#in f0/0.1
R1(config-subif)#enc
R1(config-subif)#encapsulation dot
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip addre
R1(config-subif)#ip address 192.168.10.1 255.255.255.128
R1(config-subif)#in f0/0.2
R1(config-subif)#enc
R1(config-subif)#encapsulation dot
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip add
R1(config-subif)#ip address 192.168.10.129 255.255.255.128
R1(config-subif)#in f0/0.3
R1(config-subif)#enc
R1(config-subif)#encapsulation dot
R1(config-subif)#encapsulation dot1Q 30
R1(config-subif)#ip add
R1(config-subif)#ip address 192.168.11.1 255.255.255.128
R1(config-subif)#in f0/0.4
R1(config-subif)#enc
R1(config-subif)#encapsulation do
R1(config-subif)#encapsulation dot1Q 40
R1(config-subif)#ip add
R1(config-subif)#ip address 192.168.11.129 255.255.255.224
R1(config-subif)#in f0/0.5
R1(config-subif)#enc
R1(config-subif)#encapsulation dot
R1(config-subif)#encapsulation dot1Q 50
R1(config-subif)#ip add
R1(config-subif)#ip address 192.168.11.161 255.255.255.224
在SW1上划分VLAN:
SW1#show vl
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active
10 sales active Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
Fa0/16
20 marketing active Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
50 financial active Fa0/6, Fa0/7
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
在SW2上划分Vlan
SW2#show vl
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
10 sales active Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15
20 marketing active Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
在SW3上划分Vlan
SW3#show vl
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
10 sales active Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15
20 marketing active Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
在SW4上划分Vlan
sw4#show vl
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
30 technic active Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15
40 FR active Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
在SW5上划分Vlan
SW5#show vl
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
30 technic active Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15
50 financial active Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
在SW1上把F0/1~5接口模式更改为Trunk
SW1(config)#in f0/1
SW1(config-if)#sw 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
SW1(config-if)#in f0/2
SW1(config-if)#sw mode trunk
%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
SW1(config-if)#in f0/3
SW1(config-if)#sw mode trunk
%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
SW1(config-if)#in f0/4
SW1(config-if)#sw mode trunk
%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
SW1(config-if)#in f0/5
SW1(config-if)#sw mode trunk
%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
为路由和交换设置暗文密码123
R1:
R1>en
R1#conf t
R1(config)#enable secret 123
SW1:
SW1>en
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#ena secr 123
SW2:
SW2>en
SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#ena secr 123
SW3:
SW3>en
SW3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW3(config)#ena secr 123
SW4:
SW4>en
SW4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW4(config)#ena secr 123
SW5:
SW5>en
SW5#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW5(config)#ena secr 123
五、项目测试
客户机PC0为总经理PC,PC1为副总经理PC,PC2和PC4为销售部用户PC,PC3和PC5为市场部用户PC。
IP地址:
PC0:192.168.11.162/27
PC1:192.168.11.163/27
PC2:192.168.10.11/25
PC3:192.168.10.130/25
PC4:192.168.10.12/25
PC5:192.168.10.131/25
测试PC0去ping PC2
PC>ping 192.168.10.11
Pinging 192.168.10.11 with 32 bytes of data:
Reply from 192.168.10.11: bytes=32 time=109ms TTL=127
Reply from 192.168.10.11: bytes=32 time=49ms TTL=127
Reply from 192.168.10.11: bytes=32 time=112ms TTL=127
Reply from 192.168.10.11: bytes=32 time=110ms TTL=127
Ping statistics for 192.168.10.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 49ms, Maximum = 112ms, Average = 95ms
实验成功!
测试PC4去ping PC5
PC>ping 192.168.10.131
Pinging 192.168.10.131 with 32 bytes of data:
Reply from 192.168.10.131: bytes=32 time=252ms TTL=127
Reply from 192.168.10.131: bytes=32 time=202ms TTL=127
Reply from 192.168.10.131: bytes=32 time=245ms TTL=127
Reply from 192.168.10.131: bytes=32 time=171ms TTL=127
Ping statistics for 192.168.10.131:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 171ms, Maximum = 252ms, Average = 217ms
实验成功!
六、项目总结
通过这次实验了解掌握了Vlan、Trunk和单臂路由的实际应用,明白了在实际组网过程中应先根据需求分析划分规划网段,然后根据设计方案组网,连接路由、交换,设计VLAN和路由,实现各个终端之间的互相连通。