中小型网络项目建设案例[转51CTO]

   转眼间已经混入IT这行3年了,感觉没啥意思,但是要真是不干这行了,还没想好自己要做什么。为什么会没啥意思,从我的个人经历来说,我工作过私营企业、国有企业,加薪受重视的部门我们排在最后,没有哪家公司愿意培养IT网络管理人员。我们也不怎么受到用人单位的重视,网络正常的时候,没人会想到你;出了问题,有人说你工作没做到位,工资、福利也不是很好!!

           虽然有几家公司的工作经历,但是还是很少一进另外一家公司就让你搞网络工程的,很多思科的知识都忘记的差不多了,抽了几天时间把我的思考知识和一些资料进行了整理,写了一个网络案例。其中可能会有不足的地方,也可能有错误的地方,欢迎大家批评指正。

 

 

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
Switch>enable
Switch#config terminal
Switch(config)#hostname ASW1
2.将交换机设置加密口令123
ASW1(config)#enable secret 123
3.设置登录交换机时的口令cisco
ASW1(config)#line vty 0 15
ASW1(config-line)#login
ASW1(config-line)#password cisco
4.设置终端线超时时间
ASW1(config-line)#line vty 0 15
ASW1(config-line)#exec-timeout 5 30
ASW1(config-line)#line con 0
ASW1(config-line)#exec-timeout 5 30
5.设置禁用IP地址解析特性
ASW1(config-line)#no ip domain-lookup
6.设置启用消息同步特性
ASW1(config)#line con 0 
ASW1(config-line)#logging synchronous
ASW1(config-line)#exit
7.配置访问层交换机ASW1的管理IP和默认网关
ASW1(config)#interface vlan 1
ASW1(config-if)#ip address 192.168.0.5 255.255.255.0
ASW1(config-if)#no shutdown
ASW1(config)#ip default-gateway 192.168.0.254
8.配置访问层ASW1的VLAN及VTP
ASW1(config)#vtp mode client 
ASW1(config)#interface range fastethernet0/1 - 24
ASW1(config-if-range)#duplex full
ASW1(config-if-range)#speed 100
9.配置访问层交换机ASW1的访问端口1-10
ASW1(config-if-range)#interface range fastethernet0/1 - 10
ASW1(config-if-range)#switchport mode access
ASW1(config-if-range)#switchport access vlan 10
ASW1(config-if-range)#exit
10.配置访问层交换机ASW1的访问端口11-20
ASW1(config)#interface range fastethernet0/11 - 20
ASW1(config-if-range)#switchport mode access
ASW1(config-if-range)#switchport access vlan 20
ASW1(config-if-range)#exit
11.设置快速端口
ASW1(config)#interface range fastethernet0/1 - 20
ASW1(config-if-range)#spanning-tree portfast
12.设置主干道端口
ASW1(config-if-range)#interface range fastethernet 0/23 - 24
ASW1(config-if-range)#switchport mode trunk

13.访问层交换机ASW2为VLAN30和VLAN40的用户提供接入服务。分别通过F0/23、F0/24
上连到分布层交换机DSW1、DSW2的端口F0/24

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

1.DSW1的基本参数。(直接写出命令,不再写出说明)
Switch>en
Switch#config terminal 
Switch(config)#hostname DSW1
DSW1(config)#enable secret 456
DSW1(config)#line con
DSW1(config)#line console 0
DSW1(config-line)#logging synchronous
DSW1(config-line)#exec-timeout 5 30
DSW1(config-line)#line vty 0 15
DSW1(config-line)#password cisco
DSW1(config-line)#login
DSW1(config-line)#exec-timeout 5 30
DSW1(config-line)#exit
DSW1(config)#no ip domain-lookup
2.配置分布层交换机DSW1的管理IP、默认网关
DSW1(config)#interface vlan 1
DSW1(config-if)#ip address 192.168.0.3 255.255.255.0
DSW1(config-if)#no shutdown
DSW1(config-if)#exit
DSW1(config)#ip default-gateway 192.168.0.254
3.配置分布层交换机DSW1的VTP
(当网络中交换机数量很多时,需要分别在每台交换机上创建很多重复的VLAN。在实际工作中为了
避免出错,采用VLAN中继协议。在本次实验中,将分布层交换机DSW1设置为VTP服务器,其他交换机
为VTP客户端)
每一个vtp管理域都有个共同的VTP管理域域名,不同VTP管理域的交换机之间不交换VTP通告信息。
DSW1#config t
DSW1(config)#vtp domain 51cto--将vtp管理域名定义为“51cto”
DSW1(config)#vtp mode server
在一个vtp域下,只需要在VTP服务器上激活vtp裁剪功能。域下的所有其他交换机也将自动激活VTP裁剪功能。
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。

DSW1(config)#vlan 10 
DSW1(config-vlan)#name JWC
DSW1(config-vlan)#EXIT
DSW1(config)#vlan 20
DSW1(config-vlan)#name XSSS
DSW1(config-vlan)#exit
DSW1(config)#vlan 30
DSW1(config-vlan)#name CWC
DSW1(config-vlan)#EXIT
DSW1(config)#vlan 40
DSW1(config-vlan)#name JGSS
DSW1(config-vlan)#exit
DSW1(config)#vlan 50
DSW1(config-vlan)#name JZX
DSW1(config-vlan)#EXIT
DSW1(config)#vlan 60
DSW1(config-vlan)#name GLX
DSW1(config-vlan)#EXIT
DSW1(config)#VLAN 70
DSW1(config-vlan)#name JSJX
DSW1(config-vlan)#EXIT
DSW1(config)#VLAN 100
DSW1(config-vlan)#NAME FWQQ

DSW1(config)#interface range fastethernet 0/1 - 24
DSW1(config-if-range)#duplex full
DSW1(config-if-range)#speed 100
DSW1(config-if-range)#interface range fastethernet 0/1 - 10
DSW1(config-if-range)#switchport mode access
DSW1(config-if-range)#switchport access vlan 100
DSW1(config-if-range)#spanning-tree portfast
DSW1(config-if-range)#interface range fastethernet 0/23 - 24
DSW1(config-if-range)#switchport mode trunk
DSW1(config-if-range)#interface range gigaoEthernet 0/1 - 2
DSW1(config-if-range)#switchport mode trunk

4.配置分布层DSW1的三层交换功能。
为网络中的各个VLAN提供路由功能
DSW1(config)#ip routing
5.配置每个VLAN中的网关地址
DSW1#config t
DSW1(config)#interface vlan 10 
DSW1(config-if)#ip address 192.168.1.254 255.255.255.0
DSW1(config-if)#no shutdown
DSW1(config-if)#interface vlan 20
DSW1(config-if)#ip address 192.168.2.254 255.255.255.0
DSW1(config-if)#no shutdown
DSW1(config-if)#interface vlan 30
DSW1(config-if)#ip address 192.168.3.254 255.255.255.0
DSW1(config-if)#no shutdown
DSW1(config-if)#interface vlan 40
DSW1(config-if)#ip address 192.168.4.254 255.255.255.0
DSW1(config-if)#no shutdown
DSW1(config-if)#interface vlan 50
DSW1(config-if)#ip address 192.168.5.254 255.255.255.0
DSW1(config-if)#no shutdown
DSW1(config-if)#interface vlan 60
DSW1(config-if)#ip address 192.168.6.254 255.255.255.0
DSW1(config-if)#no shutdown
DSW1(config-if)#interface vlan 70
DSW1(config-if)#ip address 192.168.7.254 255.255.255.0
DSW1(config-if)#no shutdown
DSW1(config-if)#interface vlan 100
DSW1(config-if)#ip address 192.168.100.254 255.255.255.0
DSW1(config-if)#no shutdown

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

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.基本参数配置
Switch>en
Switch#config t
Switch(config)#hostname CSW1
CSW1(config)#enable secret 789
CSW1(config)#line con 0
CSW1(config-line)#logging synchronous
CSW1(config-line)#exec-timeout 0 15
CSW1(config-line)#password abc
CSW1(config-line)#login
CSW1(config-line)#exec-timeout 5 30
CSW1(config-line)#exit
CSW1(config)#no ip domain-lookup
2.管理IP和默认网关
CSW1(config)#interface vlan 1
CSW1(config-if)#ip address 192.168.0.1 255.255.255.0
CSW1(config-if)#no shutdown
CSW1(config)#ip default-gateway 192.168.0.254
3.配置核心层交换机CSW1的vlan及vtp
设置核心层交换机CSW1为VTP客户机
CSW1(config)#vtp mode client
4.配置核心层交换机CSW1的端口参数
核心层交换机CSW1通过自己的端口F4/3同广域网接入模块(路由器)相连。同时,CSW1的端口G3/1-G3/2
分别下连到分布层交换机DSW1和DSW2的端口GigbitEthernet 0/1
CSW1(config)#interface range fastethernet4/1 - 32
CSW1(config-if-range)#duplex full
CSW1(config-if-range)#speed 100
CSW1(config-if-range)#switchport mode access
CSW1(config-if-range)#switchport access vlan 1
CSW1(config-if-range)#spanning-tree portfast
CSW1(config-if-range)#interface range fastethernet4/1 - 2
CSW1(config-if-range)#switchport mode trunk

5将核心交换机CSW1的千兆端口G2/1 、G2/2捆绑在一起实现2000Mbps的千兆以太网信道,然后再连接
到另一台核心层交换机CSW2
CSW1(config)#interface port-channel 1
CSW1(config-if)#switchport
CSW1(config-if)#interface range gigabitethernet 2/1 - 2 
CSW1(config-if)#channel-group 1 mode desirable non-silent
CSW1(config-if)#no shutdowni
6.配置核心层交换机CSW1的路由功能
核心层交换机CSW1通过端口F4/3同广域网接入模块相连。需要启用核心层交换机的路由功能。
还要定义通往Internet的路由,这里使用了一条缺省路由命令。下一跳地址是internet 接入路由器的
快速以太网接口F0/0的IP地址。
CSW1(config)#ip routing 
CSW1(config)#ip route 0.0.0.0  0.0.0.0  192.168.0.254
7.核心交换机CSW2的配置
核心交换机CSW2的配置命令和CSW1的命令类似,不再做相关配置。
 


四、广域网接入模块设计

1.配置路由器基本参数
采用思科3640路由器,基本参数的配置步骤如下
Router>enable
Router#config t
Router(config)#hostname R
R(config)#enable secret cisco
R(config)#line con 0
R(config-line)#logging sys
R(config-line)#logging syn
R(config-line)#logging synchronous 
R(config-line)#exec-timeout 5 30
R(config-line)#line vty 0 4
R(config-line)#password cisco
R(config-line)#login
R(config-line)#exec
R(config-line)#exec-timeout 5 30
R(config-line)#exit
R(config)#no ip domain-lookup
2.配置接入路由器R的各接口参数
主要针对接口F0/0以及接口S0/0的IP地址、子网掩码配置。
R(config)#interface fastEthernet 0/0
R(config-if)#ip address 192.168.0.254 255.255.255.0
R(config-if)#no shutdown
R(config-if)#interface  serial 0/0
R(config-if)#ip address 193.1.1.1 255.255.255.252
R(config-if)#no shutdown
3.配置接入路由R的路由功能
对R路由器要定义两个方向上的路由:到校园网内部静态路由以及到外网上的
缺省路由。
到外网的缺省路由,下一跳从R路由器接口S0/0送出。
R(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0
到校园网内部的路由条目可以经过路由汇总形成2条路由条目。
R(config)#ip route 192.168.0.0 255.255.248.0 192.168.0.3
R(config)#ip route 192.168.100.0 255.255.255.0 192.168.0.3
4.配置接入路由器R上的NAT
本校园网向当地ISP申请了9个IP,其中一个IP为193.1.1.1 分配给外网口
接入路由器的串行接口。另外8个202.205.222.1-202.206.222.8做NAT。
4.1定义NAT内部、外部接口
R(config)#interface fastEthernet 0/0
R(config-if)#ip nat inside
R(config)#interface serial 0/0
R(config-if)#ip nat outside
4.2定义允许进行NAT的工作站的内部局部IP地址范围。
R(config)#ip access-list 1 permit 192.168.0.0 0.0.7.255
4.3为服务器定义静态地址转换 
R(config)#ip nat inside source static 192.168.100.1 202.206.222.1
R(config)#ip nat inside source static 192.168.100.2 202.206.222.2
R(config)#ip nat inside source static 192.168.100.3 202.206.222.3
R(config)#ip nat inside source static 192.168.100.4 202.206.222.4 
R(config)#ip nat inside source static 192.168.100.5 202.206.222.5
R(config)#ip nat inside source static 192.168.100.6 202.206.222.6
R(config)#ip nat inside source static 192.168.100.7 202.206.222.7
R(config)#ip nat inside source static 192.168.100.8 202.206.222.8
4.4为其他工作站定义复用地址转换
R(config)#ip nat inside source  list 1 interface serial 0/0 overload

5.配置接入路由器R上的ACL
5.1对外屏蔽简单网管协议,即SNMP(利用这个协议,远程主机可以监视、控制网络
上的其他网络设备,其服务类型:SNMP,SNMPTRAP)
R(config)#access-list 101 deny udp any any eq snmp
R(config)#access-list 101 deny udp any any eq snmptrap
R(config)#access-list 101 permit ip any any 
R(config)#interface serial 0/0
R(config-if)#ip access-group 101 in
5.2对外屏蔽远程登录协议telnet
R(config)#access-list 101 deny tcp any any eq telnet
R(config)#access-list 101 permit ip any any
R(config)#interface serial 0/0
R(config-if)#ip access-group 101 in
5.3对外屏蔽其他不安全协议
主要有SUN OS 的文件共享协议端口2049,远程执行(rsh)、远程登录
(rlogin)和远程命令(rcmd)端口512、513、514,远程过程调用(SUNRPC)
端口111。
R(config)#access-list 101 deny tcp any any range 512 514
R(config)#access-list 101 deny tcp any any eq 111
R(config)#access-list 101 deny udp any any eq 111
R(config)#access-list 101 deny tcp any any range 2049
R(config)#access-list 101 permit ip any any
R(config)#ip access-group 101 in

5.4 针对DOS攻击的设计。
R(config)#access-list 101 deny icmp any any eq echo-request
R(config)#access-list 101 deny  udp any any eq echo
R(config)#interface serial 0/0
R(config-if)#ip access-group 101 in
R(config-if)#interface fastethernet 0/0
R(config-if)#no ip directed-broadcast
5.5 保护路由器自身安全
只允许来自服务器群的IP地址访问并配置路由器,这时,可以使用ACCESS-CLASS
命令来进行VTY 访问控制。
R(config)#line vty 0 4
R(config-line)#access-class 2 in
R(config-line)#exit
R(config)#access -list 2 permit 192.168.100.0 0.0.0.255

6、远程访问模块设计
主要为家庭办公用户和出差在外的员工提供远程、移动接入服务。
远程访问有三种可选的服务类型:专线连接、电路交换和包交换。本例
采用异步拨号连接。
6.1对物理线路的配置包括线路速度(DTE、DCE之间的速率)、停止位数、流控
方式、允许呼入连接的协议类型、允许流量的方向等。
R(config)#line 97
R(config-line)#modem InOut
R(config-line)#transport input all
R(config-line)#stopbits 1
R(config-line)#speed 115200
R(config-line)#flowcontrol hardware
6.2 对接口配置包括:接口封装协议类型、接口异步模式、ip地址、为远程客户
分配IP地址的方式。
R(config)#interface async97
R(config-if)#ip address 192.168.200.100 255.255.255.0
R(config-if)#encapsulation ppp
R(config-if)#async mode dedicated
R(config-if)#peer default ip address pool rasclients
6.3建立一个本地的IP地址池,名为rasclients
R(config)#ip local pool rasclients 192.168.200.1 192.168.200.16
6.4配置身份认证
PPP提供了两种可选的身份认证方法:pap口令验证,chap质询握手协议。
本例中采用PAP
R(config)#username remoteuser password cisco
R(config)#interface a
R(config-if)#ppp authentication pap

 

   至于服务器的配置我有时间再贴出来,51cto不错哦!

posted @ 2010-12-20 08:44  野味@有点甜  阅读(332)  评论(0编辑  收藏  举报