2007年1月27日星期六

Remote Install WinXP from a FreeBSD box

1. Install tftp-hpa (/usr/ports/ftp/tftp-hpa)
Install samba3, perl, python

2. Set pxeboot environment
Ref: http://jnlin.org/2006/10/29/141/

3. Change tftpd server to tftp-hpa
/usr/local/libexec/in.tftpd in.tftpd -v -m /tftpboot/rules -s /tftpboot

4. Write rules
(Warning! If you apply my rule, all filenames in tftproot must be lowercase)
# cat > /tftpboot/rules
ri ^[a-z]: # Remove “drive letters”
rg \\ / # Convert backslashes to slashes
rg \# @ # Convert hash marks to @ signs
rg /../ /..no../ # Convert /../ to /..no../
rg A a
rg B b
rg C c
rg D d
rg E e
rg F f
rg G g
rg H h
rg I i
rg J j
rg K k
rg L l
rg M m
rg N n
rg O o
rg P p
rg Q q
rg R r
rg S s
rg T t
rg U u
rg V v
rg W w
rg X x
rg Y y
rg Z z
r ^/(.*) \1

5. extract I386 files from Windows XP installation CD

(Ref: http://oss.netfarm.it/guides/ris-linux.php)

- Copy i386 directory from the installation media to a subdir called winxp
in the ris working directory

- Extract the pxe loader:
cabextract /i386/STARTROM.N1_

- Modify the name of the loader from NTLDR to XPLDR:
sed -i -e ’s/NTLDR/XPLDR/gi’ startrom.n12

- Move the modified pxe loader to tftpd root, and call it winxp.0

- Extract the setuploader, using cabextract:
cabextract /i386/SETUPLDR.EX_

- Modify the name of the response file from winnt.sif to winxp.sif
sed -i -e ’s/winnt\.sif/winxp\.sif/gi’ setupldr.exe

- Modify the name of ntdetect from ntdetect.com to ntdetect.wxp
sed -i -e ’s/ntdetect\.com/ntdetect\.wxp/gi’ setupldr.exe

- Move the modified setuploader to tftpd root, and call it xpldr

- Copy /i386/NTDETECT.COM to tftpd root
and call it ntdetect.wxp

6. Create winxp.sif

(Ref: http://oss.netfarm.it/guides/ris-linux.php)

==
[data]
floppyless = “1″
msdosinitiated = “1″
; Needed for second stage
OriSrc = “\\YOUR_SERVER_NAME\YOUR_SHARE_NAME\winxp\i386″
OriTyp = “4″
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1

[SetupData]
OsLoadOptions = “/fastdetect”
; Needed for first stage
SetupSourceDevice = “\Device\LanmanRedirector\YOUR_SERVER_NAME\YOUR_SERVER_SHARE\winxp”

[UserData]
ComputerName = *
; if needed
;ProductID=
==

*** Remember to set the share folder in the samba server ***

Ref: http://oss.netfarm.it/guides/pxe.php

[REMINST]
path = /mnt/disk/ris
browsable = true
read only = No
guest ok = Yes

7. Install NIC drivers to i386/inf
cp nicdrivers/* i386/inf
ln i386/inf/* i386/*

8. Rename all files in winxp to lowercase
find ./ -depth | perl -ne ‘chomp;m;$d=$`;$_=$f=$&; \
s/([\x80-\xFF].)|(\w)/$1\l$2/g;system “/bin/mv”,$d.$f,$d.$_ if $f ne $_’

9. Get Binl Server and extract it
fetch http://oss.netfarm.it/guides/ris-linux-0.2.tar.gz
tar zxf http://oss.netfarm.it/guides/ris-linux-0.2.tar.gz
cd ris-linux-0.2

10. Run infparser.py
./infparser.py /where/is/winxp/i386/inf

11. Run ./binlsrv.py

12. Go to install Windows XP

** Useful Ref **
http://oss.netfarm.it/guides/pxe.php
http://oss.netfarm.it/guides/ris-linux.php
http://syslinux.zytor.com/pxe.php

利用portsnap管理你的BSD ports

以前曾说过,6.0以后的BSD可以使用portsnap来更好的管理你的ports,现在就把命令简单的写一下:

升级你的 Ports :

$ pkg_add -r portsnap

$ portsnap fetch extract

$ echo “0 4 * * * root /usr/sbin/portsnap -I cron update && pkg_version -vIL=” >> /etc/crontab

更新你的ports数据库 :

$ /usr/local/sbin/pkgdb -F

$ /usr/local/sbin/portupgrade -ra

这样就可以了,最近在国内有个网通的portsnap站点:

portsnap.hshh.org
portsnap2.hshh.org
portsnap3.hshh.org (网通)
portsnap4.hshh.org使用方法:

/etc/portsnap.conf 里面更改SERVERNAME=portsnap.hshh.org

SERVERNAME=portsnap2.hshh.org

SERVERNAME=portsnap3.hshh.org

SERVERNAME=portsnap4.hshh.org
portsnap简介:
portsnap从6.0开始引进系统,给与用户方便的更新系统ports
portsnap的命令比较少
fetch 获取数据
extract 释放全部ports
update 更新ports
第一次使用可以 portsnap fetch extract

Qemu 终于支持FreeBSD6下的Bridge模式了

We talked about switching over to Qemu from vmware. Now, we gonna talk about running Qemu on FreeBSD 6 with Bridge mode. But, why bridge mode ? This virtual box gonna be my testing box and i need to access from other machine. Unlike the virtual box inside my notebook, which only need to access from my notebook.

Again, we are gonna talk about. Installing qemu on FreeBSD (with ports) and network settings will be Bridge. This is unlike bridge mode for network monitoring. This is bridge for accessing internet.


First, needed modules, /boot/loader.conf :

kqemu_load=”YES” # needed for qemu
bridge_load=”YES” # needed for qemu
if_tap_load=”YES” # needed for qemu
aio_load=”YES” # needed for qemu

Configuration for /etc/sysctl.conf :

net.link.ether.bridge_cfg=rl0,tap9
net.link.ether.bridge.enable=1
net.link.tap.user_open=1

Configuration for /etc/devfs.conf :

own tap9 user:group

My qemu-ifup :

#!/bin/sh

echo “nothing here”

To start my openbsd :

$ /usr/local/bin/qemu -hda openbsd4.img -m 256 \

-net nic,vlan=0 -net tap,vlan=0,ifname=tap9,script=./qemu-ifup \

-boot c -no-kqemu

A quick and fast note. Please let me know if i miss out anything.

在 FreeBSD 上打開 Hyperthreading 的方法

太久沒設定都忘了… 紀錄起來:

如果 dmesg 有看到 HTT 這個 flag,但是沒有看到多顆 CPU,那麼除了加上一般多 CPU 會用的 options SMP 以外,還要加上下面這行,然後 recompile kernel:

options MPTABLE_FORCE_HTT

接下來到 /etc/sysctl.conf 加上:

machdep.hyperthreading_allowed=1

重開機後理論上打 top 就可以看到了。

2007年1月14日星期日

网络不稳定

今天看了很多关于思科的东西,突然想到个问题:我们跟移动同样做宽带,为什么他们没问题?难道真的是BSD的问题?

2007年1月7日星期日

cisco 学习第二日Vlan

下面是具体的配置过程:

  第1步:设置好超级终端,连接上1900交换机,通过超级终端配置交换机的VLAN,连接成功后出现如下所示的主配置界面(交换机在此之前已完成了基本信息的配置):

  1 user(s) now active on Management Console.
  User Interface Menu
  [M] Menus
  [K] Command Line
  [I] IP Configuration
  Enter Selection:

  【注】超级终端是利用Windows系统自带的"超级终端"(Hypertrm)程序进行的,具体参见有关资料。

  第2步:单击"K"按键,选择主界面菜单中"[K] Command Line"选项 ,进入如下命令行配置界面:
  CLI session with the switch is open.
  To end the CLI session,enter [Exit ].
  >

  此时我们进入了交换机的普通用户模式,就象路由器一样,这种模式只能查看现在的配置,不能更改配置,并且能够使用的命令很有限。所以我们必须进入"特权模式"。

  第3步:在上一步">"提示符下输入进入特权模式命令"enable",进入特权模式,命令格式为">enable",此时就进入了交换机配置的特权模式提示符:

  #c onfig t
  Enter configuration commands,one per line.End with CNTL/Z
  (config)#

  第4步:为了安全和方便起见,我们分别给这3个Catalyst 1900交换机起个名字,并且设置特权模式的登陆密码。下面仅以Switch1为例进行介绍。配置代码如下:

  (config)#hostname Switch1
  Switch1(config)# enable password level 15 XXXXXX
  Switch1(config)#

  【注】特权模式密码必须是4~8位字符这,要注意,这里所输入的密码是以明文形式直接显示的,要注意保密。交换机用 level 级别的大小来决定密码的权限。Level 1 是进入命令行界面的密码,也就是说,设置了 level 1 的密码后,你下次连上交换机,并输入 K 后,就会让你输入密码,这个密码就是 level 1 设置的密码。而 level 15 是你输入了"enable"命令后让你输入的特权模式密码。

  第5步:设置VLAN名称。因四个VLAN分属于不同的交换机,VLAN命名的命令为" vlan 'vlan号'name 'vlan名称',在Switch1、Switch2、Switch3、交换机上配置2、3、4、5号VLAN的代码为:

  Switch1 (config)#vlan 2 name Prod
  Switch2 (config)#vlan 3 name Fina
  Switch3 (config)#vlan 4 name Huma
  Switch3 (config)#vlan 5 name Info

  【注】以上配置是按表1规则进行的。

  第6步:上一步我们对各交换机配置了VLAN组,现在要把这些VLAN对应于表1所规定的交换机端口号。对应端口号的命令是"vlan-membership static/ dynamic' VLAN号'"。在这个命令中"static"(静态)和"dynamic"(动态)分配方式两者必须选择一个,不过通常都是选择"static"(静态)方式。VLAN端口号应用配置如下:

  (1). 名为"Switch1"的交换机的VLAN端口号配置如下:

  Switch1(config)#int e0/2
  Switch1(config-if)#vlan-membership static 2
  Switch1(config-if)#int e0/3
  Switch1(config-if)#vlan-membership static 2
  Switch1(config-if)#int e0/4
  Switch1(config-if)#vlan-membership static 2
  ……
  Switch1(config-if)#int e0/20
  Switch(config-if)#vlan-membership static 3
  Switch1(config-if)#int e0/21
  Switch1(config-if)#vlan-membership static 3
  Switch1(config-if)#

  【注】"int"是"nterface"命令缩写,是接口的意思。"e0/3"是"ethernet 0/2"的缩写,代表交换机的0号模块2号端口。

  (2). 名为"Switch2"的交换机的VLAN端口号配置如下:

  Switch2(config)#int e0/2
  Switch2(config-if)#vlan-membership static 3
  Switch2(config-if)#int e0/3
  Switch2(config-if)#vlan-membership static 3
  Switch2(config-if)#int e0/4
  Switch2(config-if)#vlan-membership static 3
  ……
  Switch2(config-if)#int e0/15
  Switch2(config-if)#vlan-membership static 3
  Switch2(config-if)#int e0/16
  Switch2(config-if)#vlan-membership static 3
  Switch2(config-if)#

  (3). 名为"Switch3"的交换机的VLAN端口号配置如下(它包括两个VLAN组的配置),先看VLAN 4(Huma)的配置代码:

  Switch3(config)#int e0/2
  Switch3(config-if)#vlan-membership static 4
  Switch3(config-if)#int e0/3
  Switch3(config-if)#vlan-membership static 4
  Switch3(config-if)#int e0/4
  Switch3(config-if)#vlan-membership static 4
  ……
  Switch3(config-if)#int e0/8
  Switch3(config-if)#vlan-membership static 4
  Switch3(config-if)#int e0/9
  Switch3(config-if)#vlan-membership static 4
  Switch3(config-if)#
  下面是VLAN5(Info)的配置代码:
  Switch3(config)#int e0/10
  Switch3(config-if)#vlan-membership static 5
  Switch3(config-if)#int e0/11
  Switch3(config-if)#vlan-membership static 5
  Switch3(config-if)#int e0/12
  Switch3(config-if)#vlan-membership static 5
  ……
  Switch3(config-if)#int e0/20
  Switch3(config-if)#vlan-membership static 5
  Switch3(config-if)#int e0/21
  Switch3(config-if)#vlan-membership static 5
  Switch3(config-if)#

  好了,我们已经按表1要求把VLAN都定义到了相应交换机的端口上了。为了验证我们的配置,可以在特权模式使用"show vlan"命令显示出刚才所做的配置,检查一下是否正确。

  以上是就Cisco Catalyst 1900交换机的VLAN配置进行介绍了,其它交换机的VLAN配置方法基本类似,参照有关交换机说明书即可。

  本篇介绍了交换机的常用应用技术VLAN技术及其配置方法,下一篇将正式介绍另一个常见网络设备--路由器。路由器在网络之间的通信中所起的作用是不可替代的,同样也是一种非常关键的网络设备,希望大家与我一起来认识它。

2007年1月6日星期六

CISCO路由配置语句汇总

http://bise1986.spaces.live.com/blog/cns!7B5953CE14019E72!199.entry#trackback


Cisco 路由配置语句汇总
//启动接口,分配IP地址:
router>
router> enable
router#
router# configure terminal
router(config)#
router(config)# interface Type Port
router(config-if)# no shutdown
router(config-if)# ip address IP-Address Subnet-Mask
router(config-if)# ^z

//配置RIP路由协议:30秒更新一次
router(config)# router rip
router(config-if)# network Network-Number //通告标准A,B,C类网
router(config-if)# ^z

//配置IGRP路由协议:90秒更新一次
router(config)# router igrp AS-Number //AS-Number范围1~65535
router(config-if)# network Network-Number //通告标准A,B,C类网
router(config-if)# ^z

//配置Novell IPX路由协议:Novell RIP 60秒更新一次
router(config)# ipx routing [node address]
router(config)# ipx maximum-paths Paths //设置负载平衡,范围1~512
router(config)# interface Type Port
router(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] //通告标准A,B,C类网
router(config-if)# ^z

//配置DDN:
router(config)# dialer-list Group-Number protocol
Protocol-Type permit [list ACL-Number]
router(config)# interface bri 0
router(config-if)# dialer-group Group-Number
router(config-if)# dialer map Protocol-Type
Next-Hop-Address name Hostname Telphone-Number
router(config-if)# ^z

//配置ISDN:
router(config)# isdn swith-type Swith-Type //配置ISDN交换机类型,中国使用basic-net3
router(config-if)# ^z

//配置Frame Relay:
router(config-if)# encapsulation frame-relay [cisco ietf ]
router(config-if)# frame-relay lmi-type [ansi cisco q933a ]
router(config-if)# bandwidth kilobits
router(config-if)# frame-relay invers-arp [ Protocol ] [dlci ]
router(config-if)# ^z

//配置标准ACL:
router(config)# access-list Access-List-Number [ permit deny ] source [ source-mask ] //Access-List-Number 范围:1~99标准ACL;100~199扩展ACL;800~899标准IPX ACL;//900~999扩展IPX ACL;1000~1099 IPX SAP ACL;600~699Apple Talk ACL
router(config)# interface Type Port
router(config-if)# ip access-group Access-List-Number [in out ]
router(config-if)# ^z

//配置扩展ACL:
router(config)# access-list Access-List-Number [permit deny] [Protocol Protocol-Number] source source-wildcard [ Source-Port ] destination destination-wildcard [Destination-Port] [ established ]
router(config)# interface Type Port
router(config-if)# ip access-group Access-List-Number [ in out ]
router(config-if)# ^z

//配置命名ACL:
router(config)# ip access-list [ standard extended ] ACL-Name
router(config [ std- ext- ] nacl)# [ permit deny ] [ IP-Access-List-Test-Conditions ]
router(config [ std- ext- ] nacl)# no [ permit deny ] [ IP-Access-List-Test-Conditions ]
router(config [ std- ext- ] nacl)# ^z
router(config)# interface Type Port
router(config-if)# ip access-group [ACL-Name 1~199 ] [ in out ]
router(config-if)# ^z

//配置DCE时钟:
router# show controllers Type Port //确定DCE接口
router(confin-if)# clock rate 64000 //进入DCE接口设置时钟速率
router(config-if)# ^z

//配置PPP协议:
router(config)# username Name password Set-Password-Here //验证方建立数据库
router(config)# interface Type Port
router(config-if)# encapsulation ppp //启动PPP协议
router(config-if)# ppp outhentication [ chap chap pap pap chap pap ] //选择PPP认证
router(config-if)# ppp pap sent-username Name password Password //发送验证信息
router(config-if)# ^z
//PAP单向认证配置实例:
//验证方:
router-server(config)# username Client password 12345 //验证方建立数据库
router-server(config)# interface serial 0
router-server(config-if)# encapsulation ppp
router-server(config-if)# ppp authentication pap //选择使用PAP实现PPP认证
router-server(config-if)# ^z
//被验证方:
router-client(config-if)# encapsulation ppp
router-client(config-if)# ppp pap sent-username Client password 12345 //发送验证信息
router-client(config-if)# ^z

//PAP双向认证配置实例:
//路由器 A:
routerA(config)# username B password 12345
routerA(config)# interface serial 0
routerA(config-if)# encapsulation ppp
routerA(config-if)# ppp authentication pap
routerA(config-if)# ppp pap sent-username A password 54321
routerA(config-if)# ^z
//路由器 B:
routerB(config)# username A password 54321
routerB(config)# interface serial 1
routerB(config-if)# encapsulation ppp
routerB(config-if)# ppp authentication pap
routerB(config-if)# ppp pap sent-username B password 12345
routerB(config-if)# ^z

//CHAP单向认证配置实例:
//验证方:
router-server(config)# username router-client password 12345
router-server(config)# interface serial 0
router-server(config-if)# encapsulation ppp
router-server(config-if)# ppp authentication chap
router-server(config-if)# ^z
//被验证方:
router-client(config-if)# encapsulation ppp
router-client(config-if)# ppp authentication chap
router-client(config-if)# ppp chap hostname router-client
router-client(config-if)# ppp chap password 12345
router-client(config-if)# ^z

//CHAP双向认证配置实例:
//路由器 A:
routerA(config)# username routerB password 12345
routerA(config)# interface serial 0
routerA(config-if)# encapsulation ppp
routerA(config-if)# ppp authentication chap
routerA(config-if)# ppp chap hostname routerA
routerA(config-if)# ppp chap password 54321
routerA(config-if)# ^z
//路由器 B:
routerB(config)# username routerA password 54321
routerB(config)# interface serial 1
routerB(config-if)# encapsulation ppp
routerB(config-if)# ppp authentication chap
routerB(config-if)# ppp chap hostname routerB
routerB(config-if)# ppp chap password 12345
routerB(config-if)# ^z

//Telnet使用:
routerA# terminal monitor //可以传回在远端主机执行Debug命令的结果
routerA# telnet IP-Address [ Router-Name ] //Telnet到指定的地址或名字的主机
routerB# [ exit logout ] ///退出Telnet
routerA# show sessions //显示当前所有Telnet的信息,包括Connect-Number
routerA# Connect-Number //返回指定的Telnet连接
routerA# disconnect IP-Address [ Router-Name ] //断开指定地址或名字的主机的连接
routerA# show user //显示Telnet到本机的连接信息
routerA# clear line [ 0 1 2 3 4 ] //断开指定Telnet到本机的连接

//禁止任何Telnet到本路由器:
router(config)# line vty 0 4
router(config-line)# access-class ACL-Number //通过ACL禁止任何Telnet到该路由器
router(config)# ^z

//设置主机名:
router(config)# hostname Set-Hostname
router(config)# ^z

//设置用户模式密码:
router(config)# line console 0
router(config-line)# login
router(config-line)# password Set-Password
router(config-line)# ^z

//设置Telnet密码:
router(config)# line vty 0 4
router(config-line)# login
router(config-line)# password Set-Password
router(config-line)# ^z

//设置特权模式密码:
router(config)# enable password Set-Password //不加密的密码,明码
router(config)# enable secret Set-Password //经过加密的密码
router(config)# ^z

//给所有密码加密:
router(config)# service password-ancryption
router(config)# no service password-ancryption //取消加密
router(config)# ^z

//设置登录Banner:
router(config)# banner motd 分隔符 Set-Banner-InFORMation-Here 分隔符 //前后分隔符一定要一致

//设置接口的描述信息:
router(config-if)# description Set-Port-InFORMation-Here
router(config)# ^z

//CDP的控制:
router(config-if)# cdp enable //在指定端口启用CDP,缺省
router(config-if)# no cdp enable //在指定端口关闭CDP
router(config)# cdp run //使所有端口启用CDP
router(config)# no cdp run //使所有端口关闭CDP

//Ping的使用:
router# ping IP-Address
router# ping //扩展Ping命令
Protocol [ip]:[ Protocol-Type ] //选择协议类型
Target IP address:IP-Address //输入测试地址
Repeat count [5]: //选择发送的ICMP包数量
Datagram size [100]: //选择每个包的大小
Timeout in seconds [2]: //设置每个包的超时时间
Extended commands [n]:y //使用扩展Ping命令
Sweep range of sizes [n]:

//Trace的使用:
router# trace IP-Address [ Host-Name ]

//为Cisco 4000路由器指定媒体类型:
router(config-if)# media-type 10baset //使AUI(默认)失效,改为使用RJ-45
router(config-if)# ^z
//更改路由器启动顺序:
router(config)# boot system flash IOS-FileName
router(config)# boot system tftp IOS-FileName TFTP-IP-Address
router(config)# boot system rom
router(config)# ^z

//修改寄存器数值:
router(config)# config-register value
//Cisco出厂默认value=0x2102,value范围:0x2100(进入ROM监视器),0x2101(使//系统从ROM启动),0x2102~0x210F(使系统从NVRAM启动)。0x1=0x2101,从
//最小位开始改变

//在ROM监视器中更改寄存器数值:
> o/r value

//路由器密码的恢复:
冷关机,然后再开机并在60秒内按<>+进入ROM监视器模式
> o/r 0x2142 //25xx型路由器
或 > confreg 0x2142 //26xx型路由器
router> I
router> n
router> enable
router# copy startup-config running-config //备份路由器的配置文件
router# configure terminal
router(config)# enable secret New-Password
router(config)# config-register 0x2102
router(config)# ^z
router# copy running-config startup-config
router# reload

//配置名称-主机入口:
router(config)# ip host Set-Name [ TCP-Port-Number ] IP-Address [ IP-Address 2 ]...
router(config)# ^z

//定义DNS主机:
router(config)# ip name-server Server-Address [ Server-Address 2 ]...
router(config)# ^z

//禁用DNS:
router(config)# no ip domain-lookup
router(config)# ^z

//配置水平分割:
router(config-if)# ip split-horizon
router(config-if)# no ip split-horizon
router(config-if)# ^z

//配置静态路由:
router(config)# ip route IP-Address Subnet-Mask [ Next-Hop-Address Local-Out-Port ] [Distace ] //Distance范围:1~255,相当于优先权,越小越好。RIP=120;DSPF=110;IGRP=100;//EIGRP=90
router(config)# ^z

//配置缺省路由:
router(config)# ip defoult-network IP-Address //动态缺省路由
router(config)# ip route 0.0.0.0 0.0.0.0 [ Next-Hop-Address Local-Out-Port ] [Distace ] //静态缺省路由
router(config)# ^z

//其它命令:
router# show version
router# show running-config
router# show startup-config
router# show flash
router# show interface [ Type Port ]
router# show buffers
router# show protocol
router# show mem
router# show stacks
router# show processes
router# show cdp entry [ Device-Name ] //显示指定邻居三层信息
router# show cdp neighbors
router# show cdp neighbors detail //显示所有邻居三层信息
router# show ip router
router# show ipx router
router# show host
router# show ip protocol
router# show ip interface Type Port
router# show ipx interface Type Port
router# show ipx servers
router# show ipx traffic
router# show access-lists [ ACL-Number ]
router# show isdn status
router# show dialer //查看ISDN拨号信息
router# show isdn active
router# show frame-relay pvc
router# show frame-relay map
router# show frame-relay lmi
router# erase startup-config
router# reload
router# setup
router# copy running-config startup-config
router# copy startup-config running-config
router# copy tftp running-config
router# copy running-config tftp
router# debug ipx routing activity
router# debug ipx sap
router# debug isdn q921
router# debug isdn q931
router# debug dialer
router# debug ip rip
router# clear interface bri

Cisco 4000学习第一日

今天被这个张相臃肿的家伙搞的我头大了,为了能在一周内过考核,为了能尽快签定合同,我开始了适应性学习.而首要的就是学习Cisco 4000

现在我的面前摆满了书----都是英文,而我的开始也都是靠自己摸索,于是,这5个小时我拼命的看书,但是到了实际应用的时候我卡住了.

出错的地方在于:
1 电脑如何跟Cisco 4000连接?

看了2本书,也看了网上的很多的参考资料居然没有说如何连接的.于是我开始自己摸索,最后终于找到了连接方法(汗啊,居然让我这种新手独立探索出来了).

方法:使用windows XP,打开"开始"->"程序"->"附件"->"通讯"->"超级终端".然后新建一个连接,名字随便就可以了,然后在接下来的对话框中选"com1",然后就是对"com1"进行配置了.

这里一定要注意哦,我就是卡在这里很久,把"每秒位数"设成"9600","奇偶校验"设"无","数据流控制"设为"无",这样就可以登陆Cisco 4000的CLI模式了.

2 如何进入3层模式?

普通的教材都是说的如何在2层下工作,但是怎么进入3层模式?在我摸索了一段时间后终于发现了进入途径.
consle>(enable) ?
console>(enable)

.......
....
....

session

...
....
..
注意看哦,就是用session命令,然后:
console>(enable)session ?


于是使用
console>(enalbe)session 2
就进入了Router模式
Router>

然后,仿照console下的enable 来切换的特权模式下
Router>enable
Router#
成功啦,哈哈