中小型网络项目建设案例

网络
接入层交换机配置,本次实验中接入层只有2台,本文只配置AWS1,像AWS2、AWS3、AWS4等就不写成操作命令。

VLAN及IP地址规划

vlan1   无(vlan名称)    192.168.0.0/24 (ip网段)  192.168.0.254(默认网关)  管理VLAN
vlan10   JWC              192.168.1.0/24             192.168.1.254
vlan20   XSSS             192.168.2.0/24             192.168.2.254
vlan30   CWC              192.168.3.0/24             192.168.3.254
vlan40   JGSS             192.168.4.0/24             192.168.4.254
vlan50   JZX              192.168.5.0/24             192.168.5.254
vlan60   GLX              192.168.6.0/24             192.168.6.254
vlan70   JSJX             192.168.7.0/24             192.168.7.254
vlan100  FWQQ             192.168.100.0/24           192.168.100.254           服务器群VLAN

一、接入层交换机配置

本次实验中接入层只有2台,本文只配置AWS1,像AWS2、AWS3、AWS4等就不写成操作命令。

1.为访问层交换机命名为ASW1

  1. Switch>enable  
  2. Switch#config terminal  
  3. Switch(config)#hostname ASW1  

2.将交换机设置加密口令123

  1. ASW1(config)#enable secret 123 

3.设置登录交换机时的口令cisco

  1. ASW1(config)#line vty 0 15  
  2. ASW1(config-line)#login  
  3. ASW1(config-line)#password cisco  

4.设置终端线超时时间

  1. ASW1(config-line)#line vty 0 15  
  2. ASW1(config-line)#exec-timeout 5 30  
  3. ASW1(config-line)#line con 0  
  4. ASW1(config-line)#exec-timeout 5 30  

5.设置禁用IP地址解析特性

  1. ASW1(config-line)#no ip domain-lookup 

6.设置启用消息同步特性

  1. ASW1(config)#line con 0  
  2. ASW1(config-line)#logging synchronous  
  3. ASW1(config-line)#exit  

7.配置访问层交换机ASW1的管理IP和默认网关

  1. ASW1(config)#interface vlan 1  
  2. ASW1(config-if)#ip address 192.168.0.5 255.255.255.0  
  3. ASW1(config-if)#no shutdown  
  4. ASW1(config)#ip default-gateway 192.168.0.254  

8.配置访问层ASW1的VLAN及VTP

  1. ASW1(config)#vtp mode client  
  2. ASW1(config)#interface range fastethernet0/1 - 24  
  3. ASW1(config-if-range)#duplex full  
  4. ASW1(config-if-range)#speed 100  

9.配置访问层交换机ASW1的访问端口1-10

  1. ASW1(config-if-range)#interface range fastethernet0/1 - 10  
  2. ASW1(config-if-range)#switchport mode access  
  3. ASW1(config-if-range)#switchport access vlan 10  
  4. ASW1(config-if-range)#exit  

10.配置访问层交换机ASW1的访问端口11-20

  1. ASW1(config)#interface range fastethernet0/11 - 20  
  2. ASW1(config-if-range)#switchport mode access  
  3. ASW1(config-if-range)#switchport access vlan 20  
  4. ASW1(config-if-range)#exit  

11.设置快速端口

  1. ASW1(config)#interface range fastethernet0/1 - 20  
  2. ASW1(config-if-range)#spanning-tree portfast  

12.设置主干道端口

  1. ASW1(config-if-range)#interface range fastethernet 0/23 - 24  
  2. ASW1(config-if-range)#switchport mode trunk  

13.访问层交换机ASW2为VLAN30和VLAN40的用户提供接入服务。

分别通过F0/23、F0/24上连到分布层交换机DSW1、DSW2的端口F0/24#p#

二、配置分布层交换机DSW1的基本参数。(直接写出命令,不再写出说明)

1.DSW1的基本参数。(直接写出命令,不再写出说明)

  1. Switch>en  
  2. Switch#config terminal  
  3. Switch(config)#hostname DSW1  
  4. DSW1(config)#enable secret 456  
  5. DSW1(config)#line con  
  6. DSW1(config)#line console 0  
  7. DSW1(config-line)#logging synchronous  
  8. DSW1(config-line)#exec-timeout 5 30  
  9. DSW1(config-line)#line vty 0 15  
  10. DSW1(config-line)#password cisco  
  11. DSW1(config-line)#login  
  12. DSW1(config-line)#exec-timeout 5 30  
  13. DSW1(config-line)#exit  
  14. DSW1(config)#no ip domain-lookup  

2.配置分布层交换机DSW1的管理IP、默认网关

  1. DSW1(config)#interface vlan 1  
  2. DSW1(config-if)#ip address 192.168.0.3 255.255.255.0  
  3. DSW1(config-if)#no shutdown  
  4. DSW1(config-if)#exit  
  5. DSW1(config)#ip default-gateway 192.168.0.254  

3.配置分布层交换机DSW1的VTP

(当网络中交换机数量很多时,需要分别在每台交换机上创建很多重复的VLAN。在实际工作中为了避免出错,采用VLAN中继协议。在本次实验中,将分布层交换机DSW1设置为VTP服务器,其他交换机为VTP客户端)每一个vtp管理域都有个共同的VTP管理域域名,不同VTP管理域的交换机之间不交换VTP通告信息。

  1. DSW1#config t  
  2. DSW1(config)#vtp domain 51cto//将vtp管理域名定义为“51cto”  
  3. DSW1(config)#vtp mode server  

在一个vtp域下,只需要在VTP服务器上激活vtp裁剪功能。域下的所有其他交换机也将自动激活VTP裁剪功能。

  1. DSW1(config)#vtp pruning 

4.在分布层交换机DSW1上定义VLAN

(除了默认VLAN外又加了8个VLAN,使用VTP技术,所有VLAN信息都只需要在VTP服务器-DSW1上进行,分布层交换机DSW1的端口F0/1-F0/10为服务器提供接入服务。而F0/23、F0/24分别下连到访问层交换机。ASW1的端口F0/23以及ASW2的端口F0/23。分布层交换机DSW1还通过自己的千兆端口G0/1上连到核心交换机CSW1的G3/1。为了实现冗余设计,分布层交换机DSW1还通过自己的千兆端口G0/2连接另一台到分布层交换机DSW2的G0/2。

  1. DSW1(config)#vlan 10  
  2. DSW1(config-vlan)#name JWC  
  3. DSW1(config-vlan)#EXIT  
  4. DSW1(config)#vlan 20  
  5. DSW1(config-vlan)#name XSSS  
  6. DSW1(config-vlan)#exit  
  7. DSW1(config)#vlan 30  
  8. DSW1(config-vlan)#name CWC  
  9. DSW1(config-vlan)#EXIT  
  10. DSW1(config)#vlan 40  
  11. DSW1(config-vlan)#name JGSS  
  12. DSW1(config-vlan)#exit  
  13. DSW1(config)#vlan 50  
  14. DSW1(config-vlan)#name JZX  
  15. DSW1(config-vlan)#EXIT  
  16. DSW1(config)#vlan 60  
  17. DSW1(config-vlan)#name GLX  
  18. DSW1(config-vlan)#EXIT  
  19. DSW1(config)#VLAN 70  
  20. DSW1(config-vlan)#name JSJX  
  21. DSW1(config-vlan)#EXIT  
  22. DSW1(config)#VLAN 100  
  23. DSW1(config-vlan)#NAME FWQQ  
  24. DSW1(config)#interface range fastethernet 0/1 - 24  
  25. DSW1(config-if-range)#duplex full  
  26. DSW1(config-if-range)#speed 100  
  27. DSW1(config-if-range)#interface range fastethernet 0/1 - 10  
  28. DSW1(config-if-range)#switchport mode access  
  29. DSW1(config-if-range)#switchport access vlan 100  
  30. DSW1(config-if-range)#spanning-tree portfast  
  31. DSW1(config-if-range)#interface range fastethernet 0/23 - 24  
  32. DSW1(config-if-range)#switchport mode trunk  
  33. DSW1(config-if-range)#interface range gigaoEthernet 0/1 - 2  
  34. DSW1(config-if-range)#switchport mode trunk  

#p#4.配置分布层DSW1的三层交换功能。

为网络中的各个VLAN提供路由功能

  1. DSW1(config)#ip routing 

5.配置每个VLAN中的网关地址

  1. DSW1#config t  
  2. DSW1(config)#interface vlan 10  
  3. DSW1(config-if)#ip address 192.168.1.254 255.255.255.0  
  4. DSW1(config-if)#no shutdown  
  5. DSW1(config-if)#interface vlan 20  
  6. DSW1(config-if)#ip address 192.168.2.254 255.255.255.0  
  7. DSW1(config-if)#no shutdown  
  8. DSW1(config-if)#interface vlan 30  
  9. DSW1(config-if)#ip address 192.168.3.254 255.255.255.0  
  10. DSW1(config-if)#no shutdown  
  11. DSW1(config-if)#interface vlan 40  
  12. DSW1(config-if)#ip address 192.168.4.254 255.255.255.0  
  13. DSW1(config-if)#no shutdown  
  14. DSW1(config-if)#interface vlan 50  
  15. DSW1(config-if)#ip address 192.168.5.254 255.255.255.0  
  16. DSW1(config-if)#no shutdown  
  17. DSW1(config-if)#interface vlan 60  
  18. DSW1(config-if)#ip address 192.168.6.254 255.255.255.0  
  19. DSW1(config-if)#no shutdown  
  20. DSW1(config-if)#interface vlan 70  
  21. DSW1(config-if)#ip address 192.168.7.254 255.255.255.0  
  22. DSW1(config-if)#no shutdown  
  23. DSW1(config-if)#interface vlan 100  
  24. DSW1(config-if)#ip address 192.168.100.254 255.255.255.0  
  25. DSW1(config-if)#no shutdown  

6.定义通往INTERNET路由器,这里使用一条缺省路由命令。

  1. DSW1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.254 

7.配置分布层交换机DSW2

交换机DSW2的端口F0/23 、F0/24分别下连到访问层交换机ASW1的端口F0/24以及访问层交换机ASW2的端口F0/24。分布层交换机DSW2还通过自己的千兆端口 G0/1 上连接到核心交换机CSW1的G3/2。为了实现冗余设计,分布层交换机DSW2还通过自己的千兆端口G0/2连接到分布层DSW1的G0/2

三、配置核心层交换机

1.基本参数配置

  1. Switch>en  
  2. Switch#config t  
  3. Switch(config)#hostname CSW1  
  4. CSW1(config)#enable secret 789  
  5. CSW1(config)#line con 0  
  6. CSW1(config-line)#logging synchronous  
  7. CSW1(config-line)#exec-timeout 0 15  
  8. CSW1(config-line)#password abc  
  9. CSW1(config-line)#login  
  10. CSW1(config-line)#exec-timeout 5 30  
  11. CSW1(config-line)#exit  
  12. CSW1(config)#no ip domain-lookup  

2.管理IP和默认网关

  1. CSW1(config)#interface vlan 1  
  2. CSW1(config-if)#ip address 192.168.0.1 255.255.255.0  
  3. CSW1(config-if)#no shutdown  
  4. CSW1(config)#ip default-gateway 192.168.0.254  

3.配置核心层交换机CSW1的vlan及vtp

设置核心层交换机CSW1为VTP客户机

  1. CSW1(config)#vtp mode client 

4.配置核心层交换机CSW1的端口参数

核心层交换机CSW1通过自己的端口F4/3同广域网接入模块(路由器)相连。同时,CSW1的端口G3/1-G3/2。分别下连到分布层交换机DSW1和DSW2的端口GigbitEthernet 0/1#p#

  1. CSW1(config)#interface range fastethernet4/1 - 32  
  2. CSW1(config-if-range)#duplex full  
  3. CSW1(config-if-range)#speed 100  
  4. CSW1(config-if-range)#switchport mode access  
  5. CSW1(config-if-range)#switchport access vlan 1  
  6. CSW1(config-if-range)#spanning-tree portfast  
  7. CSW1(config-if-range)#interface range fastethernet4/1 - 2  
  8. CSW1(config-if-range)#switchport mode trunk  

5将核心交换机CSW1的千兆端口G2/1 、G2/2捆绑在一起实现2000Mbps的千兆以太网信道,然后再连接到另一台核心层交换机CSW2

  1. CSW1(config)#interface port-channel 1  
  2. CSW1(config-if)#switchport  
  3. CSW1(config-if)#interface range gigabitethernet 2/1 - 2  
  4. CSW1(config-if)#channel-group 1 mode desirable non-silent  
  5. CSW1(config-if)#no shutdowni  

6.配置核心层交换机CSW1的路由功能

核心层交换机CSW1通过端口F4/3同广域网接入模块相连。需要启用核心层交换机的路由功能。还要定义通往Internet的路由,这里使用了一条缺省路由命令。下一跳地址是internet 接入路由器的快速以太网接口F0/0的IP地址。

7.核心交换机CSW2的配置

核心交换机CSW2的配置命令和CSW1的命令类似,不再做相关配置。

  1. CSW1(config)#ip routing  
  2. CSW1(config)#ip route 0.0.0.0  0.0.0.0  192.168.0.254  

 

四、广域网接入模块设计

1.配置路由器基本参数

采用思科3640路由器,基本参数的配置步骤如下

  1. Router>enable  
  2. Router#config t  
  3. Router(config)#hostname R  
  4. R(config)#enable secret cisco  
  5. R(config)#line con 0  
  6. R(config-line)#logging sys  
  7. R(config-line)#logging syn  
  8. R(config-line)#logging synchronous  
  9. R(config-line)#exec-timeout 5 30  
  10. R(config-line)#line vty 0 4  
  11. R(config-line)#password cisco  
  12. R(config-line)#login  
  13. R(config-line)#exec  
  14. R(config-line)#exec-timeout 5 30  
  15. R(config-line)#exit  
  16. R(config)#no ip domain-lookup  

2.配置接入路由器R的各接口参数

主要针对接口F0/0以及接口S0/0的IP地址、子网掩码配置。

  1. R(config)#interface fastEthernet 0/0  
  2. R(config-if)#ip address 192.168.0.254 255.255.255.0  
  3. R(config-if)#no shutdown  
  4. R(config-if)#interface  serial 0/0  
  5. R(config-if)#ip address 193.1.1.1 255.255.255.252  
  6. R(config-if)#no shutdown  

3.配置接入路由R的路由功能

对R路由器要定义两个方向上的路由:到校园网内部静态路由以及到外网上的缺省路由。到外网的缺省路由,下一跳从R路由器接口S0/0送出。

  1. R(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0 

到校园网内部的路由条目可以经过路由汇总形成2条路由条目。

  1. R(config)#ip route 192.168.0.0 255.255.248.0 192.168.0.3  
  2. R(config)#ip route 192.168.100.0 255.255.255.0 192.168.0.3  

#p#4.配置接入路由器R上的NAT

本校园网向当地ISP申请了9个IP,其中一个IP为193.1.1.1 分配给外网口接入路由器的串行接口。另外8个202.205.222.1-202.206.222.8做NAT。

4.1定义NAT内部、外部接口

  1. R(config)#interface fastEthernet 0/0  
  2. R(config-if)#ip nat inside  
  3. R(config)#interface serial 0/0  
  4. R(config-if)#ip nat outside  

4.2定义允许进行NAT的工作站的内部局部IP地址范围。

  1. R(config)#ip access-list 1 permit 192.168.0.0 0.0.7.255  

4.3为服务器定义静态地址转换

  1. R(config)#ip nat inside source static 192.168.100.1 202.206.222.1  
  2. R(config)#ip nat inside source static 192.168.100.2 202.206.222.2  
  3. R(config)#ip nat inside source static 192.168.100.3 202.206.222.3  
  4. R(config)#ip nat inside source static 192.168.100.4 202.206.222.4  
  5. R(config)#ip nat inside source static 192.168.100.5 202.206.222.5  
  6. R(config)#ip nat inside source static 192.168.100.6 202.206.222.6  
  7. R(config)#ip nat inside source static 192.168.100.7 202.206.222.7  
  8. R(config)#ip nat inside source static 192.168.100.8 202.206.222.8  

4.4为其他工作站定义复用地址转换

  1. R(config)#ip nat inside source  list 1 interface serial 0/0 overload   

5.配置接入路由器R上的ACL

5.1对外屏蔽简单网管协议,即SNMP(利用这个协议,远程主机可以监视、控制网络上的其他网络设备,其服务类型:SNMP,SNMPTRAP)

  1. R(config)#access-list 101 deny udp any any eq snmp  
  2. R(config)#access-list 101 deny udp any any eq snmptrap  
  3. R(config)#access-list 101 permit ip any any  
  4. R(config)#interface serial 0/0  
  5. R(config-if)#ip access-group 101 in  

5.2对外屏蔽远程登录协议telnet

  1. R(config)#access-list 101 deny tcp any any eq telnet  
  2. R(config)#access-list 101 permit ip any any  
  3. R(config)#interface serial 0/0  
  4. R(config-if)#ip access-group 101 in  

5.3对外屏蔽其他不安全协议

主要有SUN OS 的文件共享协议端口2049,远程执行(rsh)、远程登录(rlogin)和远程命令(rcmd)端口512、513、514,远程过程调用(SUNRPC)端口111。

  1. R(config)#access-list 101 deny tcp any any range 512 514  
  2. R(config)#access-list 101 deny tcp any any eq 111  
  3. R(config)#access-list 101 deny udp any any eq 111  
  4. R(config)#access-list 101 deny tcp any any range 2049  
  5. R(config)#access-list 101 permit ip any any  
  6. R(config)#ip access-group 101 in  

5.4 针对DOS攻击的设计。

  1. R(config)#access-list 101 deny icmp any any eq echo-request  
  2. R(config)#access-list 101 deny  udp any any eq echo  
  3. R(config)#interface serial 0/0  
  4. R(config-if)#ip access-group 101 in  
  5. R(config-if)#interface fastethernet 0/0  
  6. R(config-if)#no ip directed-broadcast  

5.5 保护路由器自身安全

只允许来自服务器群的IP地址访问并配置路由器,这时,可以使用ACCESS-CLASS命令来进行VTY 访问控制。

  1. R(config)#line vty 0 4  
  2. R(config-line)#access-class 2 in  
  3. R(config-line)#exit  
  4. R(config)#access -list 2 permit 192.168.100.0 0.0.0.255  

6、远程访问模块设计

主要为家庭办公用户和出差在外的员工提供远程、移动接入服务。远程访问有三种可选的服务类型:专线连接、电路交换和包交换。本例采用异步拨号连接。

6.1对物理线路的配置包括线路速度(DTE、DCE之间的速率)、停止位数、流控方式、允许呼入连接的协议类型、允许流量的方向等。

  1. R(config)#line 97  
  2. R(config-line)#modem InOut  
  3. R(config-line)#transport input all  
  4. R(config-line)#stopbits 1  
  5. R(config-line)#speed 115200  
  6. R(config-line)#flowcontrol hardware 

6.2 对接口配置包括:接口封装协议类型、接口异步模式、ip地址、为远程客户分配IP地址的方式。

  1. R(config)#interface async97  
  2. R(config-if)#ip address 192.168.200.100 255.255.255.0  
  3. R(config-if)#encapsulation ppp  
  4. R(config-if)#async mode dedicated  
  5. R(config-if)#peer default ip address pool rasclients 

6.3建立一个本地的IP地址池,名为rasclients

  1. R(config)#ip local pool rasclients 192.168.200.1 192.168.200.16 

6.4配置身份认证

PPP提供了两种可选的身份认证方法:pap口令验证,chap质询握手协议。本例中采用PAP

  1. R(config)#username remoteuser password cisco  
  2. R(config)#interface a  
  3. R(config-if)#ppp authentication pap 

原文来自:http://aoteman.blog.51cto.com

 

责任编辑:佟健 来源: 51CTO博客
相关推荐

2011-04-06 09:01:59

2011-04-06 09:14:13

2015-06-11 17:10:49

局域网布线技术

2010-04-15 04:03:20

华硕服务器

2010-08-25 17:45:21

2019-12-10 08:50:27

网络攻击网络安全漏洞

2009-07-16 10:18:17

多模光缆布线

2015-11-26 10:11:05

2011-02-24 09:56:26

组网网络

2018-11-08 09:10:18

组网光纤网络

2009-12-21 16:10:28

2020-05-14 10:16:04

网络安全病毒技术

2009-12-30 14:28:01

2018-05-08 14:35:03

大数据数据处理存储

2010-08-23 12:12:58

2012-02-29 18:34:33

S2126T以太网交换机

2022-06-03 23:30:26

应用安全数据财务预算

2012-03-01 19:56:39

S2126T交换机

2022-07-06 00:07:39

网络安全企业误区

2013-08-13 10:27:15

点赞
收藏

51CTO技术栈公众号