Archive for the '计算机\网络' Category

Cicso Catalyst 3750-E交换机enable密码忘记后的恢复

一台Cicso Catalyst 3750-E交换机忘记enable密码后无法进入调试,只能想办法将密码去除,但需保留原来交换机的配置。

步骤如下:

1、将交换机console口与电脑相连,再按住交换机面板前的“mode”键,然后重启交换机,直到面板的”STAT”灯亮,放手。如下图。

2、此时会出现如下菜单,依次输入flash_init,load_helper,然后重命名配置文件名称,最后输入boot重启交换机,操作如下:

The system has been interrupted prior to initializing the
flash filesystem.  The following commands will initialize
the flash filesystem, and finish loading the operating
system software:

    flash_init
    load_helper
    boot

switch: flash_init
Initializing Flash…
flashfs[0]: 4 files, 1 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 15998976
flashfs[0]: Bytes used: 8282624
flashfs[0]: Bytes available: 7716352
flashfs[0]: flashfs fsck took 11 seconds.
…done Initializing Flash.
Boot Sector Filesystem (bs) installed, fsid: 3
Setting console baud rate to 9600…

switch: load_helper

switch: dir flash:
Directory of flash:/

2    -rwx  8276561  <date>  c3750-ipservices-mz.122-37.SE.bin
3    -rwx  616       <date>     vlan.dat
4    -rwx  5         <date>       private-config.text
6    -rwx  3027      <date>     config.text

7716352 bytes available (8282624 bytes used)

switch: rename flash:config.text flash:config.text.old
switch: boot
Loading “flash:/c3750-ipservices-mz.122-37.SE.bin”…@@@@

3、重启后进入系统进行如下操作

Would you like to enter the initial configuration dialog? [yes/no]: no   //选择no
 
Would you like to terminate autoinstall? [yes]:     //选择yes

还原配置文件名称,并复制配置文件至running中
Switch>en
Switch#rename flash:config.text.old flash:config.text
Switch#copy flash:config.text system:running-config

进入配置模式,去除enable密码,并保存至start-config中
c3750#configure terminal
c3750(config)#no enable password
c3750(config)#exit
c3750#wr memory
00:04:04: %SYS-5-CONFIG_I: Configured from console by console
Building configuration…
[OK]

这样,交换机的enable密码就去除完成了。

天融信防火墙NGFW4000-UF防火墙启用PPTP笔记

by funpower,2010年3月24日20:33,funpower#gmail.com,转载请注明出处。水平有限,文中难免有错误,望指正。

之前在软路由RouterOS上启用过PPTP,这次是在天融信防火墙上启用PPTP服务,使外网用户可以拨入企业的内网网络来访问相关资料。

网络说明:
1、防火墙外网口IP:218.50.80.xxx/248,内网口IP:192.168.2.253/24
2、连接企业内网服务器资源网络:192.168.2.0/04
3、内网服务器网络IP:192.168.28.0/24
4、远端用户端入后的IP地址范围:192.168.2.50-192.168.2.60
5、本例中建立一个pptp用户:用户名pptpuser,密码000000

配置步骤:

1、启用PPTP服务
默认防火墙是关闭PPTP服务的,所以需要先开启。通过https://192.168.2.253登陆防火墙后,点击左边菜单栏的“系统管理”->“配置”->“开放服务”,点击“添加”按扭,服务名称选择“PPTP”,控制区域选择防火墙的外网口,这里为“area_eth11”,控制地址选择“ANY”,即为任何人都可以连接,设置完后点击“确定”。

2、设置PPTP服务
左边菜单栏选择“虚拟专网”->“PPTP”,对右边栏进行设置,PPTP端口一般默认,使用1723,本地地址使用规划好的分配IP范围中的一个,这里使用192.168.2.50,剩下的都作为外网用户拨入后的地址,如下图。

另外,在“防火墙”->“访问控制”栏中,确保没有将1723端口阻止的规则。

这样,PPTP基本的设置就完成了。下来就可以新建网络链接来测试PPTP。连接成功后,就获取到了192.168.2段的地址。在防火墙上也可以看到连接过来的链接,如下图。

命令行操作:

pf service add name pptp area area_eth11 addressname any
network pptp set ip-pool local 192.168.2.50 min_ip 192.168.2.51 max_ip 192.168.2.60
network pptp start

CISCO 4507R根据IP地址查找端口,并使用4/46口来镜像此端口

首先找出10.0.0.9的IP地址所在的端口,然后制作10.0.0.9服务器的镜像口->fastethernet4/46,使之可以查看10.0.0.9上的具体数据包信息。

操作步骤:

1、找出10.0.0.9的MAC地址

Switch#ping 10.0.0.9

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.9, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Switch#sh arp | in 10.0.0.9
Internet  10.0.0.9                4   0014.5e19.8345  ARPA   Vlan1
Internet  10.0.0.92               0   0019.bbdc.1d1f  ARPA   Vlan1
Internet  10.0.0.93               0   001e.4f98.0934  ARPA   Vlan1

2、查看MAC地址0014.5e19.8345的相应端口,显示为在fast4/23端口上

Switch#show mac-address-table address 0014.5e19.8345
Unicast Entries
 vlan   mac address     type        protocols               port
——-+—————+——–+———————+——————–
   1    0014.5e19.8345   dynamic ip                     FastEthernet4/23

3、制作fast4/23的镜像端口->fast4/46

Switch(config)#monitor session 1 source interface fastEthernet 4/23
Switch(config)#monitor session 1 destination interface fastEthernet 5/46

这样,就完成了从查找端口到制作镜像口的操作。

利用NBU6.5备份AIX5.3下的ORACLE 10G数据库

声明:此文档仅作参考,如出现任何问题,文档编写者不承担任何责任!水平有限,文中定有错误之处,见谅!编写:老管,email:funpower#gmail.com

NBU服务器端由一台IBM 226服务器及一台昆腾虚拟带库组成,需备份的客户端为安装AIX5.3的IBM小机,备份的对象为ORACLE 10G数据库。

整个备份的拓扑图如下:

环境说明:
1、NBU备份主服务器与昆腾虚拟带库已配置完成
2、次只为增加的一台Oracle数据库服务器安装NBU客户端相关软件并调试,然后在NBU备份主服务器上添加此客户端并建立备份策略等相关调试
3、IP地址(化名):
NBU备份主服务器:10.31.111.111
Oracle数据库服务器:10.31.111.100

操作步骤:

1、配置Oracle数据库服务器的hosts文件

#cd /etc
#vi hosts

添加一行:
10.31.111.111 nbuserver
保存退出。

2、安装NBU clients软件
通过FTP将NBU客户端软件上传至小机的TMP目录下,然后运行:

#cd /tmp
#chmod –R 777 unixclients
#cd unixclients
#./install

Symantec Installation Script
Copyright 1993 – 2007 Symantec Corporation, All Rights Reserved.

        Installing NetBackup Client Software

 NOTE:  To install NetBackup Server software, insert the appropriate
        NetBackup Server cdrom.

Do you wish to continue? [y,n] (y)   //输入y
Do you want to install the NetBackup client software for this client? [y,n] (y)      //输入y
This package will install RS6000/AIX5 client.
This package will install NetBackup client 6.5.
Enter the name of the NetBackup server : nbuserver       //输入NBU备份主服务器hostname
Would you like to use “oracle1″ as the configured
name of the NetBackup client? [y,n] (y)       //输入y,使用原小机的hostsname:oracle1

确认后,就开始安装NBU客户端软件,安装的默认路径为/usr/openv/netbackup。

3、配置和查看bp.conf

#cd /usr/openv/netbackup
#cat bp.conf

SERVER = nbuserver
CLIENT_NAME = oracle1

4、安装database agent
将database agent安装文件上传至上机的/tmp文件夹中,然后:

#cd /tmp
#chmod –R 777 /agents
#./install

Symantec Installation Script
Copyright 1993 – 2007 Symantec Corporation, All Rights Reserved.

        Installation Options

        1 NetBackup Add-On Product Software
        2 NetBackup Database Agent Software

        q To quit from this script
Choose an option [default: q]: 2   //选择2,安装database agent

**********

There are two ways to install database agent software.

1.  Remote Installation:  Loads the software on a server with
    the intent of pushing database software out to affected clients.

2.  Local Installation:   Loads and installs the software only to this
    local machine.

**********

Do you want to do a local installation? [y,n] (n) y     //进行本地安装
**********

        NetBackup Database Agent Installation

Choose the Database Agents you wish to install
one at a time or select Install All Database Agents.

        1)  NetBackup for DB2
        2)  NetBackup for Informix
        3)  NetBackup for Lotus Notes
        4)  NetBackup for Oracle
        5)  NetBackup for SAP
        6)  NetBackup for Sybase

        7)  Install All Database Agents

        q)  Done Selecting Agents
        x)  Exit from this Script

Choose an option: 4      //选择oracle

Choose an option: q       //完成选择操作

You have chosen to install these Database Agents:
        NetBackup for Oracle
Is this list correct? [y,n] (y)        //确定安装oracle agents

5、编辑sh备份脚本
Database agent安装完后,会在/usr/openv/netbackup/ext/db_ext/oracle/samples/rman中有一些例子文件,利用其中的一个,运行:

#cd /usr/openv/netbackup/ext/db_ext/oracle/samples/rman
#cp hot_database_backup.sh hot_database_backup.10.31.111.100.sh

然后使用vi编辑该sh,只需修改如下参数:
ORACLE_HOME=/oracle/product/10G
export ORACLE_HOME
ORACLE_SID=orcl2
export ORACLE_SID
ORACLE_USER=oracle
TARGET_CONNECT_STR=/

完成设置后,保存退出。

6、链接NetBackup for Oracle 和RMAN

#su – oracle
#cd /usr/openv/netbackup/bin
#./oracle_link

Mon Mar 15 11:29:34 BEIST 2010
All Oracle instances should be shutdown before running this script.

Please log into the Unix system as the Oracle owner for running this script

Do you want to continue? (y/n) [n] y     //输入y,开始安装

LIBOBK path: /usr/openv/netbackup/bin
ORACLE_HOME: /oracle/product/10G
Oracle version: 10.2.0.3.0
Linking LIBOBK:
ln -s /usr/openv/netbackup/bin/libobk.a64 /oracle/product/10G/lib/libobk.a
Done

Please check the trace file located in /tmp/make_trace.856304
to make sure the linking process was successful.

出现上面文字后,说明动态链接库已链接成功。

7、NBU备份主服务器设置

首先设置主服务器的hosts文件,将IBM小机的hostname:oracle1添加至hosts中,用记事本打开c:\windows\system32\drivers\etc\hosts,添加如下:
10.31.111.100 oracle1

打开NBU主界面,开始为10.31.111.100创建一个备份策略

在policies上点右键选择new policy,输入相应策略名称后点击确定

设置attributes选项卡,policy类型选择oracle,policy storage unix选择有效的存储单元

设置Schedules选项卡,点击选项卡下面的New…按扭,新建一个备份日程,选择automatic full backup,全备,frequency选择每星期一次备份,retention选择保留两个星期

备份开始时间为星期日晚上9点开始

设置完后,schedules有两个备份策略,全备和增量备份

设置clients,输入IBM小机的hostname:oracle1,操作系统选择RS6000/AIX5

设置backup selections,将上面新建并编辑好的.sh备份脚本输入至对话框中,点击确定后,完成策略的新建

开始测试备份,在新建的policies的10.31.111.100上点右键选择Manual Backup…,手动启动备份
 

转至Activity Monitor,查看备份情况

至此,IBM小机上的ORACLE已经可以定期的备份至昆腾虚拟磁带库中。

第三方远程桌面控制软件—WinVNC

WinVNC是一款远程控制软件,文件只有几百K,安装包中包含了Server和Viewer,在需被控的机器上安装Server,在主控的机器上安装Viewer,如下图。

它可以实时的控制电脑,特别是像Windows2000一些操作系统上,安装这个小软件,方便快捷。网上这款软件的相关介绍及设置很多,就不多介绍了。

控制效果图:

软件下载链接(vnc-4.1.2)、备用下载链接(vnc-4.1.2)

相关资源:

官方主页WinVNC主控端安装过程WinVNC被控端安装过程维基百科-VNC

ED-IN 5540S存储简单配置过程

一台ED-IN 5540S的存储,一个2U的机柜,双电源,使用光纤链路配置两个光纤模块,配置两块500G的SATA硬盘做RAID1。

管理方式有两路,一种为通过串口来管理,另一种为接存储背后的LAN口通过WEB方式来管理。通过普通用户只需通过WEB方式管理即可。

ED-IN 5540S出厂设置(用户名:admin、密码:0000):

1、串口管理连接参数

2、WEB方式

默认管理地址为10.0.0.1/24,使用一根双绞线与管理笔记本连接,配置10.0.0.100/24,在浏览器中打开https://10.0.0.1,输入用户名密码即可登陆。

WEB方式部分截图:

IBM DS4300忘记串口密码及管理IP的处理。及介绍一款简单DHCP服务器架设软件-HaneWin.DHCP.Server

一台IBM DS4300存储,串口密码忘记不能登陆,Storage Manager管理IP也没有,不能进入管理。

查找资料后发现,DS4300的管理IP是先寻找网络中是否有DHCP服务器,如果没有再使用配置的静态IP地址。所有只需临时架设一台DHCP,设置好IP段,让DS4300获取到,就可以知道管理地址了。

这里使用了HaneWin.DHCP.Server这么一款DHCP傻瓜型DHCP服务器架设软件,安装运行后,选择options -> manager profile,在弹出的对话框中选择edit,编辑自动获取IP的网段范围等相关信息,保存后选择file -> service -> activate,如下图。

软件下载备用下载

aix上添加或删除默认路由

在服务器上PING其它网段的地址,发现是丢一个包通一个包,原因是服务器上设置了两个默认网关造成的,如下。

[P550]/ >#netstat -rn
Routing tables
Destination Gateway Flags Refs Use If Exp Groups

Route Tree for Protocol Family 2 (Internet):
default 192.0.0.253 UG 0 3858210 en0 – -
default 192.168.1.254 UG 0 23564 en2 – -
127/8 127.0.0.1 U 14 14363 lo0 – -
192.0.0.0 192.0.0.15 UHSb 0 0 en0 – - =
>
192.0.0/24 192.0.0.15 U 5 9129174 en0 – -
192.0.0.15 127.0.0.1 UGHS 2 7 lo0 – -
192.0.0.255 192.0.0.15 UHSb 0 4 en0 – -
192.168.1.0 192.168.1.8 UHSb 0 0 en2 – - =
>
192.168.1/24 192.168.1.8 U 0 4 en2 – -
192.168.1.8 127.0.0.1 UGHS 19 11138 lo0 – -
192.168.1.255 192.168.1.8 UHSb 0 4 en2 – -

只需删除其中一条无用的就可以,操作如下:

使用lsattr -EI inet0命令来查看服务器上的网络信息:

[P550]/ >#lsattr -El inet0
authm 65536 Authentication Methods
True
bootup_option no Use BSD-style Network Configurati
on True
gateway Gateway
True
hostname P550 Host Name
True
rout6 IPv6 Route
True
route net,-hopcount,0,,0,192.0.0.253 Route
True
route net,-hopcount,0,,0,192.168.1.254 Route
True

有两条默认路由(net,-hopcount开头),通过chdev命令来删除其中一条,使服务器网络正常:

[P550]/ >#chdev -l inet0 -a delroute=”net,-hopcount,0,,0,192.168.1.254″
inet0 changed

再使用netstat -rn来查看网络信息:

[P550]/ >#netstat -rn
Routing tables
Destination Gateway Flags Refs Use If Exp Groups

Route Tree for Protocol Family 2 (Internet):
default 192.0.0.253 UG 0 3858210 en0 – -
127/8 127.0.0.1 U 14 14363 lo0 – -
192.0.0.0 192.0.0.15 UHSb 0 0 en0 – - =
>
192.0.0/24 192.0.0.15 U 5 9129174 en0 – -
192.0.0.15 127.0.0.1 UGHS 2 7 lo0 – -
192.0.0.255 192.0.0.15 UHSb 0 4 en0 – -
192.168.1.0 192.168.1.8 UHSb 0 0 en2 – - =
>
192.168.1/24 192.168.1.8 U 0 4 en2 – -
192.168.1.8 127.0.0.1 UGHS 19 11138 lo0 – -
192.168.1.255 192.168.1.8 UHSb 0 4 en2 – -

可以看出,只剩下了一条到192.0.0.253的默认网关,再去PING其它网段的服务器地址就正常了。如果想把下一跳地址改为192.0.0.254,则需要先将253的这条先删除:

[P550]/ >#chdev -l inet0 -a delroute=”net,-hopcount,0,,0,192.0.0.253″
inet0 changed

再添加一条至192.0.0.254的默认路由:

[P550]/ >#chdev -l inet0 -a route=”net,-hopcount,0,,0,192.0.0.254″
inet0 changed

HP StorageWorks EVA Simulation v2.0(EVA8000模拟器)

HP StorageWorks EVA8000模拟器,使用它,可以进行相关的实验,能够比较形象的了解HP存储的相关操作过程及原理。

模拟程序下载(备份下载)、相关学习文档下载(备份下载)

程序部分界面:

Cisco3845路由器登陆问题

cisco3845

Cisco3845路由器,一般使用在大中型分支机构中,路由器出厂默认安装了Cisco SDM模块(路由器及安全配置工具),这样,在登陆时就会出现如下提示:

———————————————————————–
Cisco Router and Security Device Manager (SDM) is installed on this device.
This feature requires the one-time use of the username “cisco”
with the password “cisco”. The default username and password have a privilege level of 15.

Please change these publicly known initial credentials using SDM or the IOS CLI.
Here are the Cisco IOS commands.

username <myuser> privilege 15 secret 0 <mypassword>
no username cisco

Replace <myuser> and <mypassword> with the username and password you want to use.

For more information about SDM please follow the instructions in the QUICK START
GUIDE for your router or go to http://www.cisco.com/go/sdm
———————————————————————–
User Access Verification

Username:

使用用户名和密码都为cisco来登陆路由器,然后再添加用户,再使用no username cisco命令将默认用户cisco删除,如果你没有创建用户,而直接将cisco用户删除再保存了配置,下次进入后使用cisco路由器就不能登陆了。

经过查看路由器配置,con和vty口的配置如下:

line con 0
login local
line aux 0
line vty 0 4
access-class 23 in
privilege level 15
login local
transport input telnet
line vty 5 15
access-class 23 in
privilege level 15
login local
transport input telnet

发现是在con和vty口上使用了login local认证,这样就会使用cisco sdm来认证,所以,这里只需将login local修改为login,就可以跳过cisco sdm的认证,如下:

enable password 15 cisco
!
line con 0
password cisco
login
line aux 0
line vty 0 4
password cisco
login
transport input telnet
line vty 5 15
password cisco
login
transport input telnet

现在进不去路由器,只能通过修改enable密码的方法来进入路由器,再进行以下的修改:

1、将电脑与路由器的console口相连,启动路由器,按下[ctrl]+[break],如下,出现rommon命令提示符:

System Bootstrap, Version 12.4(13r)T, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2006 by cisco Systems, Inc.

System Bootstrap, Version 12.4(13r)T11, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2008 by cisco Systems, Inc.

Total memory size = 256 MB – DIMM0 = 256 MB, DIMM1 = 0 MB
c3845 platform with 262144 Kbytes of main memory
Main memory is configured to 72/0(dimm 0/1) bit mode with ECC enabled
Upgrade ROMMON initialized

monitor: command “boot” aborted d
monitor: command “boot” aborted due to user interrupt
rommon 1 >

2、输入confreg,如下,记录下0×2102,do you wish处选择no

rommon 1 > confreg
Configuration Summary
(Virtual Configuration Register: 0×2102)
enabled are:
load rom after netboot fails
console baud: 9600
boot: image specified by the boot system commands
or default to: cisco2-c3845

do you wish to change the configuration? y/n [n]:

3、通过confreg命令来修改配置寄存器的值,使路由器忽略NVRAM中的启动配置文件。输入confreg 0×2142来修改寄存器值,再输入i重启路同器,如下:

rommon 2 > confreg 0×2142
rommon 3 > i

4、启动后会进入用户exec模式,出现系统配置对话柜时输入no跳过,如下:

— System Configuration Dialog —

Would you like to enter the initial configuration dialog? [yes/no]: no
Press RETURN to get started!

5、使用enable命令进入配置模式,再使用sh run命令查看,这时会发现配置全部消失,因为这里是跳过NVRAM来启动路由器的,使用copy命令将NVRAM中的配置文件复制到现在的启动(running-config)配置文件中,

Router>en
Router#copy startup-config running-config

6、接下来对running-config配置文件进行修改,按照上面分析的,修改为:

enable password 15 cisco
!
line con 0
password cisco
login
line aux 0
line vty 0 4
password cisco
login
transport input telnet
line vty 5 15
password cisco
login
transport input telnet

这样,下次就可以直接使用cisco密码来进行认证了。

7、接下来做配置的保存工作,首先恢复配置寄存器的值0×2102,再保存配置,这里需使用write memory,完成后重启路由器,就可以使用cisco来登陆了。

Router#copy running-config startup-config
Router#configure terminal
Router(config)#config-register 0×2102
Router(config)#end
Router#write memory
Router#reload