
网络配置
-
2023年3月17日发(作者:常务理事)第1页
湖南软件职业技术学院中小型园区网设
计与配置
设
计
说
明
第2页
目录
一项目要求....................................................................3
(一):背景描述....................................................3
(二):项目情况....................................................3
二、项目需求分析........................................................4
(一):项目需求概括............................................4
(二):项目建设拓补............................................5
三、项目方案的具体设计............................................6
(一):IP地址的规划...........................................6
(二):三层交换机基础配置................................7
(三):路由器相关配置........................................9
(四):各部门访问权限设置..............................11
(五):各硬件的相关配置文件附录..................12
(六):基于linux环境下的服务器配置............28
三、项目总结..............................................................30
第3页
一项目要求
(一):背景描述
某企业计划建设自己的企业园区网络,希望通过这个新建的网络,提供一个安全、可靠、可
扩展、高效的网络环境,将两个办公地点连接到一起,使企业内能够方便快捷的实现网络资
源共享、全网接入Internet等目标,同时实现公司内部的信息保密隔离,以及对于公网的安
全访问。为了确保这些关键应用系统的正常运行、安全和发展,网络必须具备如下的特性:
1、采用先进的网络通信技术完成企业网络的建设,连接2个相距较远的办公地点
2、为了提高数据的传输效率,在整个企业网络内控制广播域的范围
3、在整个企业集团内实现资源共享,并保证骨干网络的高可靠性
4、企业内部网络中实现高效的路由选择
5、在企业网络出口对数据流量进行一定的控制
6、能够使用一个公网IP接入Internet
(二):项目情况
该企业的具体环境如下:
1、企业具有2个办公地点,且相距较远,公司总共大约有200台主机。
2、A办公地点具有的部门较多,例如业务部、财务部、综合部等,为主要的办公场所,因
此这部分的交换网络对可用性和可靠性要求较高
3、B办公地点只有较少办公人员,但是Internet的接入点在这里
4、公司只申请到了一个公网IP地址,供企业内网接入使用
5、公司内部使用私网地址
第4页
二、项目需求分析
(一):项目需求概括
需求1:在接入层采用三层交换机,并且要采取一定方式分隔广播域
分析1:在接入层交换机上划分VLAN可以实现对广播域的分隔
划分业务部VLAN10、财务部VLAN20、综合部VLAN30,并分配接口
需求二:核心交换机采用高性能的三层交换机,且采用双核心互为备份的形势,接
入层交换机分别通过2条上行链路连接到2台核心交换机,由三层交换机实现VLAN
之间的路由
分析二
交换机之间的链路配置为Trunk链路
三层交换机上采用SVI方式(switchvirtualinterface)实现VLAN之间的路
由
需求三:2台核心交换机之间也采用双链路连接,并提高核心交换机之间的链路带
宽
分析三
在2台三层交换机之间配置端口聚合,以提高带宽
需求四:接入交换机的access端口上实现对允许的连接数量的控制,以提高网络的
安全性
分析四
采用端口安全的方式实现
需求五:三层交换机配置路由接口,与RA、RB之间实现全网互通
分析五
两台三层交换机上配置路由接口,连接A办公地点的路由器RA
RA和RB分别配置接口IP地址
在三层交换机的路由接口和RA,以及RB的内网接口上启用RIP路由协议,
实现全网互通
需求六:RA和B办公地点的路由器RB之间通过广域网链路连接,并提供一定的
安全性
分析六
RA和RB的广域网接口上配置PPP(点到点)协议,并用PAP认证提高安
全性
第5页
需求七:RB配置静态路由连接到Internet
分析七
两台三层交换上配置缺省路由,指向RA
RA上配置缺省路由指向RB
RB上配置缺省路由指向连接到互联网的下一跳地址
需求八:在RB上用一个公网IP地址实现企业内网到互联网的访问
分析八
用NAT(网络地址转换)方式,实现企业内网仅用一个公网IP地址到互联
网的访问
需求九:在S1上对内网到外网的访问进行一定控制,要求不允许财务部访问互联网,
业务部只能访问WWW和FTP服务,而综合部只能访问WWW服务,其余访问不
受控制
分析九
通过ACL(访问控制列表)实现
需求十:在R1配置PPP拨号协议,要求通过拨号才能接入internet。
需求十一:将交换机SWA设为服务器模式,SWB为客户机模式
通过VTP实现
(二):项目建设拓补
第6页
三、项目方案的具体设计
(一):IP地址的规划
设置名称配置接口IP地址
服务器
201.1.1.1
路由器R1
Fa0/0201.1.1.254
S0/0/013.1.1.254
S0/0/123.1.1.254
路由器RA
S0/0/013.1.1.1
F0/0
F0/1
192.168.1.254
192.168.2.254
路由器RB
S0/0/123.1.1.1
F0/0192.168.2.254
交换机S1
F0/24192.168.1.1
Vlan10192.168.10.254
Vlan20192.168.20.254
Vlan30192.168.30.254
交换机S2
F0/24192.168.2.2
Vlan10192.168.10.254
Vlan20192.168.20.254
第7页
Vlan30192.168.30.254
计算机P1业务部1
192.168.10.1
P2
财务部1
192.168.20.1
P3
综合部1
192.168.30.1
P4
业务部2
192.168.10.2
P5
财务部2
192.168.20.2
P6
P0
P7
P8
综合部2192.168.30.2
192.168.3.1
192.168.3.2
192.168.3.3
【试验设备】
路由器28113台
三层交换机3560-24PS2台
PC机9台
直连/交叉线若干
DCE串口线2条
(二):三层交换机基础配置
第一步:将S1交换机VTP模式设置为服务器,口令为123456,域
为s602112,并创建vnal10vlan20vlan30,将端口1-2划分到vlan
10,3-4划分到vlan205-6划分到vlan30
第二步:把两台交换机SW-A、SW-B之间的F0/24、F0/23端口配置
为聚合端口AggregatePort1,并把AggregatePort1配置为Trunk模式。
此时对前期的VLAN、Trunk、聚合端口等的配置进行验证。
第8页
第三步:在交换机的access链路上实现端口安全,最大连接数量为4个,当违例产生时,
讲关闭端口炳发送一个Trap通知。
SA:
SA(config)#interfacerangef0/1-3
SA(config-if-range)#switchportport-securitymaximum4
SW-A(config-if-range)
#SB:
SB(config)
#SB(config)#interfacerangefastEthernet0/1-3
SB(config-if-range)#switchportport-securitymaximum4
SB(config-if-range)
#第四步:在三层交换机上开启路由功能,并对各网段进行宣告,关闭
自动汇总,启用版本2
S1:
s1(config)#iprouting
s1(config)#routerrip
s1(config-router)#version2
s1(config-router)#noauto-summary
s1(config-router)#network192.168.1.0
s1(config-router)#network192.168.20.0
s1(config-router)#network192.168.30.0
S2:
S2(config)#iprouting
S2(config)#routerrip
S2(config-router)#version2
S2(config-router)#noauto-summary
第9页
S2(config-router)#network192.168.2.0
S2(config-router)#network192.168.20.0
S2(config-router)#network192.168.30.0
第五步:配置三层交换机上的路由器端口IP地址
(三):路由器相关配置
第一步:为三台路由器各相应端口配置IP地址。
第二步:分别为路由器RA的s0/0/0及RB的s0/0/1配置时钟频率
为64000
RA:
ra(config)#ints0/0/0
ra(config-if)#clockrate64000
RB:
rb(config)#ints0/0/1
ra(config-if)#clockrate64000
第三步:根据需求配置各路由器上的静态路由或动态路由
RA:
ra(config)#iproute0.0.0.00.0.0.0s0/0/0
ra(config)#routerrip
ra(config-router)#version2
ra(config-router)#noauto-summary
第10页
ra(config-router)#network13.0.0.0
ra(config-router)#network192.168.1.0
RB:
rb(config)#iproute0.0.0.00.0.0.0s0/0/1
rb(config)#routerrip
rb(config-router)#version2
rb(config-router)#noauto-summary
rb(config-router)#network23.0.0.0
rb(config-router)#network192.168.2.0
第四步:在R1上创建三个上网帐户,分别为gs1、gs2、密码为2013,
2014并开启R1RARB三台路由器的PPP协议PAP认证。
R1:
r1(config)#usernamegs1password2013
r1(config)#usernamegs2password2014
r1(config)#ints0/0/0
r1(config-if)#encapsulationppp
r1(config-if)#pppauthenticationpap
r1(config-if)#exit
r1(config)#ints0/0/1
r1(config-if)#encapsulationppp
r1(config-if)#pppauthenticationpap
第11页
r1(config-if)#exit
RA:
ra(config)#ints0/0/0
ra(config-if)#encapsulationppp
ra(config-if)#ppppapsent-usernamegs1password2013
ra(config-if)#exit
RB:
rb(config)#ints0/0/1
rb(config-if)#encapsulationppp
ra(config-if)#ppppapsent-usernamegs2password2014
ra(config-if)#exit
第五步:利用NAT地址转换,使内网地址转换成公网址址访问服务
器。
rb(config)#ints0/0/1
rb(config-if)#ipnatoutside
rb(config-if)#exit
rb(config)#intf0/0
rb(config-if)#ipnatinside
(四):各部门访问权限设置
在交换机S1上通过ACL控制不允许财务部访问互联网,业务部
只能访问WWW和FTP服务,而综合部只能访问WWW服务,
第12页
其余访问不受控制
rb(config)#access-list100denytcphost192.168.3.2host201.1.1.1eq80
rb(config)#access-list100permitiphost192.168.3.2any
rb(config)#access-list100permitipanyany
rb(config)#intf0/0
rb(config-if)#ipaccess-group100in
rb(config-if)#exit
(五):各硬件的相关配置文件附录
R1:
r1#shrunning-config
Buildingconfiguration...
Currentconfiguration:875bytes
!
version12.4
noservicetimestampslogdatetimemsec
noservicetimestampsdebugdatetimemsec
noservicepassword-encryption
!
hostnamer1
!
!
!
!
!
!
!
!
usernamegs1password02013
usernamegs2password02014
!
!
!
!
!
!
!
spanning-treemodepvst
!
第13页
!
!
!
interfaceFastEthernet0/0
ipaddress201.1.1.254255.255.255.0
duplexauto
speedauto
!
interfaceFastEthernet0/1
noipaddress
duplexauto
speedauto
shutdown
!
interfaceSerial0/0/0
ipaddress13.1.1.254255.255.255.0
encapsulationppp
pppauthenticationpap
!
interfaceSerial0/0/1
ipaddress23.1.1.254255.255.255.0
encapsulationppp
pppauthenticationpap
!
interfaceVlan1
noipaddress
shutdown
!
routerrip
version2
network13.0.0.0
network23.0.0.0
network201.1.1.0
noauto-summary
!
ipclassless
!
!
!
nocdprun
!
!
!
!
第14页
!
linecon0
!
lineaux0
!
linevty04
login
!
!
!
end
RA:
ra#shrunning-config
Buildingconfiguration...
Currentconfiguration:855bytes
!
version12.4
noservicetimestampslogdatetimemsec
noservicetimestampsdebugdatetimemsec
noservicepassword-encryption
!
hostnamera
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-treemodepvst
!
!
!
!
第15页
interfaceFastEthernet0/0
ipaddress192.168.1.254255.255.255.0
duplexauto
speedauto
!
interfaceFastEthernet0/1
ipaddress192.168.2.254255.255.255.0
duplexauto
speedauto
!
interfaceSerial0/0/0
ipaddress13.1.1.1255.255.255.0
encapsulationppp
ppppapsent-usernamegs1password02013
clockrate64000
!
interfaceSerial0/0/1
noipaddress
shutdown
!
interfaceVlan1
noipaddress
shutdown
!
routerrip
version2
network13.0.0.0
network192.168.1.0
network192.168.2.0
noauto-summary
!
ipclassless
iproute0.0.0.00.0.0.0Serial0/0/0
!
!
!
nocdprun
!
!
!
!
!
linecon0
!
第16页
lineaux0
!
linevty04
login
!
!
!
end
RB:
rb#shrunning-config
Buildingconfiguration...
Currentconfiguration:1284bytes
!
version12.4
noservicetimestampslogdatetimemsec
noservicetimestampsdebugdatetimemsec
noservicepassword-encryption
!
hostnamerb
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-treemodepvst
!
!
!
!
interfaceFastEthernet0/0
ipaddress192.168.3.254255.255.255.0
ipaccess-group100in
ipnatinside
第17页
duplexauto
speedauto
!
interfaceFastEthernet0/1
noipaddress
duplexauto
speedauto
!
interfaceSerial0/0/0
noipaddress
ipaccess-group101out
shutdown
!
interfaceSerial0/0/1
ipaddress23.1.1.1255.255.255.0
encapsulationppp
ppppapsent-usernamegs2password02014
ipnatoutside
clockrate64000
!
interfaceVlan1
noipaddress
shutdown
!
routerrip
version2
network23.0.0.0
network192.168.2.0
network192.168.3.0
noauto-summary
!
ipnatinsidesourcelist1interfaceSerial0/0/1overload
ipclassless
iproute0.0.0.00.0.0.0Serial0/0/1
!
!
access-list1permitany
access-list100denytcphost192.168.3.2host201.1.1.1eqwww
access-list100permitiphost192.168.3.2any
access-list100permitipanyany
access-list101denytcphost192.168.3.3host201.1.1.1eqftp
access-list101permitiphost192.168.3.3any
access-list101permitipanyany
!
第18页
nocdprun
!
!
!
!
!
linecon0
!
lineaux0
!
linevty04
login
!
!
!
end
S1
s1#shrunning-config
Buildingconfiguration...
Currentconfiguration:1829bytes
!
version12.2
noservicetimestampslogdatetimemsec
noservicetimestampsdebugdatetimemsec
noservicepassword-encryption
!
hostnames1
!
!
!
!
!
iprouting
!
!
!
!
!
!
!
!
第19页
!
!
spanning-treemodepvst
!
!
!
!
interfaceFastEthernet0/1
switchportaccessvlan10
switchportmodeaccess
!
interfaceFastEthernet0/2
switchportaccessvlan10
switchportmodeaccess
!
interfaceFastEthernet0/3
switchportaccessvlan20
switchportmodeaccess
!
interfaceFastEthernet0/4
switchportaccessvlan20
switchportmodeaccess
!
interfaceFastEthernet0/5
switchportaccessvlan30
switchportmodeaccess
!
interfaceFastEthernet0/6
switchportaccessvlan30
switchportmodeaccess
!
interfaceFastEthernet0/7
!
interfaceFastEthernet0/8
!
interfaceFastEthernet0/9
!
interfaceFastEthernet0/10
!
interfaceFastEthernet0/11
!
interfaceFastEthernet0/12
!
interfaceFastEthernet0/13
第20页
!
interfaceFastEthernet0/14
!
interfaceFastEthernet0/15
!
interfaceFastEthernet0/16
!
interfaceFastEthernet0/17
!
interfaceFastEthernet0/18
!
interfaceFastEthernet0/19
!
interfaceFastEthernet0/20
!
interfaceFastEthernet0/21
!
interfaceFastEthernet0/22
switchportmodetrunk
!
interfaceFastEthernet0/23
switchportmodetrunk
!
interfaceFastEthernet0/24
noswitchport
ipaddress192.168.1.1255.255.255.0
duplexauto
speedauto
!
interfaceGigabitEthernet0/1
!
interfaceGigabitEthernet0/2
!
interfaceVlan1
noipaddress
shutdown
!
interfaceVlan10
ipaddress192.168.10.254255.255.255.0
!
interfaceVlan20
ipaddress192.168.20.254255.255.255.0
!
interfaceVlan30
第21页
ipaddress192.168.30.254255.255.255.0
!
routerrip
version2
network192.168.1.0
network192.168.10.0
network192.168.20.0
network192.168.30.0
noauto-summary
!
ipclassless
!
!
!
!
!
!
!
linecon0
!
lineaux0
!
linevty04
login
!
!
!
End
S2
s2#shrunning-config
Buildingconfiguration...
Currentconfiguration:1783bytes
!
version12.2
noservicetimestampslogdatetimemsec
第22页
noservicetimestampsdebugdatetimemsec
noservicepassword-encryption
!
hostnames2
!
!
!
!
!
iprouting
!
!
!
!
!
!
!
!
!
!
spanning-treemodepvst
!
第23页
!
!
!
interfaceFastEthernet0/1
switchportaccessvlan10
switchportmodeaccess
!
interfaceFastEthernet0/2
switchportaccessvlan10
switchportmodeaccess
!
interfaceFastEthernet0/3
switchportaccessvlan20
switchportmodeaccess
!
interfaceFastEthernet0/4
switchportaccessvlan20
switchportmodeaccess
!
interfaceFastEthernet0/5
switchportaccessvlan30
switchportmodeaccess
第24页
!
interfaceFastEthernet0/6
switchportaccessvlan30
switchportmodeaccess
!
interfaceFastEthernet0/7
!
interfaceFastEthernet0/8
!
interfaceFastEthernet0/9
!
interfaceFastEthernet0/10
!
interfaceFastEthernet0/11
!
interfaceFastEthernet0/12
!
interfaceFastEthernet0/13
!
interfaceFastEthernet0/14
!
interfaceFastEthernet0/15
第25页
!
interfaceFastEthernet0/16
!
interfaceFastEthernet0/17
!
interfaceFastEthernet0/18
!
interfaceFastEthernet0/19
!
interfaceFastEthernet0/20
!
interfaceFastEthernet0/21
!
interfaceFastEthernet0/22
!
interfaceFastEthernet0/23
!
interfaceFastEthernet0/24
noswitchport
ipaddress192.168.2.2255.255.255.0
duplexauto
speedauto
第26页
!
interfaceGigabitEthernet0/1
!
interfaceGigabitEthernet0/2
!
interfaceVlan1
noipaddress
shutdown
!
interfaceVlan10
ipaddress192.168.10.254255.255.255.0
!
interfaceVlan20
ipaddress192.168.20.254255.255.255.0
!
interfaceVlan30
ipaddress192.168.30.254255.255.255.0
!
routerrip
version2
network192.168.2.0
network192.168.10.0
第27页
network192.168.20.0
network192.168.30.0
noauto-summary
!
ipclassless
!
!
!
!
!
!
!
linecon0
!
lineaux0
!
linevty04
login
!
!
!
end
第28页
(六):基于linux环境下的服务器配置
(一)Linux系统的安装(以CentOS6.4企业版为例)。
VirtualBox一款开源虚拟机软件,VirtualBox号称是最强的免费虚拟机软件,它不仅具
有丰富的特色,而且性能也很优异!它简单易用,可虚拟的系统包括Windows,MacOSX、
Linux、OpenBSD、Solaris、IBMOS2甚至Android4.0系统等操作系统!使用者可以在
VirtualBox上安装并且运行上述的这些操作系统!
CentOS(CommunityEnterpriseOperatingSystem)是Linux发行版之一,它是来自
于RedHatEnterpriseLinux依照开放源代码规定释出的源代码所编译而成。由于出自同样
的源代码,因此有些要求高度稳定性的服务器以CentOS替代商业版的RedHatEnterprise
Linux使用。两者的不同,在于CentOS并不包含封闭源代码软件。
(二)DNS服务器的配置与管理。
在DNS服务器主配置文件中,配置方案如下:
options{
…………
}
zone""IN{
typemaster;
file"";
allow-update{none;};
};
zone""IN{
typemaster;
file"(84.20.10).arpa";
allow-update{none;};
};
在正向解析文件中,配置方案如下:
$TTL1D
@INSOA@.(
0;serial
1D;refresh
1H;retry
1W;expire
3H);minimum
@.
dnsINA10.20.84.45
第29页
cwINA10.20.84.136
xsINA10.20.84.136
ftpINA10.20.84.33
在反向解析文件中,配置方案如下:
$TTL1D
@INSOA@.(
0;serial
1D;refresh
1H;retry
1W;expire
3H);minimum
@.
本机ip地址.
.
.
.
(三)Web服务器的配置与管理。
在Web服务器主配置文件中,配置方案如下:
NameVirtualHost(10.20.84.136)
ServerAdminroot@
DocumentRoot/var/www/html/cw
ErrorLoglogs/-error_log
CustomLoglogs/-access_logcommon
ServerAdminroot@
DocumentRoot/var/www/html/xs
ErrorLoglogs/-error_log
CustomLoglogs/-access_logcommon
第30页
(四)FTP服务器的配置与管理。
1、建立维护网站内容的FTP账号test1和test2并禁止本地登录,然后为其设
置密码。
[root@localhost~]#useradd-s/sbin/nologintest1
[root@localhost~]#useradd-s/sbin/nologintest2
[root@localhost~]#passwdtest1
[root@localhost~]#passwdtest2
2、在FTP服务器主配置文件中,配置方案如下:
anonymous_enable=NO
local_enable=YES
local_root=/var/www/html
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
3、建立/etc/vsftpd/chroot_list文件,并向文件中添加test1和test2用户
三、项目总结
本次项目制作综合本学期公共课程、实训课程,初步掌握了解中小型局域网的搭建及上网的
过程,并做ACL、PPP拨号上网拓展练习。通过配置方案增强自身技能素质,并针对网络
中易出现的一些故障能够找到原因排除能力。能够在linux环境下配置DHCP、WEB、FTP、
DNS服务器相关配置。本次实训项目中,在配置内网与外网地址转换过程中RA路由器上
还存在着NAT应用问题。/QIQn9RtX6Fwrn