首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • Dynamips@Edurainbow 2.72使用方法和学习项目3 [已结帖,结帖人:T5500]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • merryboy
    • 等级:
    • 可用分等级:
    • 总技术分:
    • 总技术分排名:
    • 结帖率:
    发表于:2008-08-20 14:03:56 楼主
    试验2:测试Vlan的功能,(这里就不能启动控制台NA 交换版,因为SW1上没有连接PC3,PC4,你可以看ccna_sw.net,那里面的配置写得很清楚),这里需要修改一下 5.控制台NA交换版.cmd,才能试验,配置SW1,PC1,PC2,PC3,PC4
    PC1(192.168.1.1)
    PC2(192.168.1.2)
    PC3(192.168.1.3)
    PC4(192.168.1.4)
    首先,把 5.控制台NA交换版.cmd 文件拷贝一份,取名字叫 5_1.控制台NA交换版.cmd
    里面的内容修改(用记事本打开编辑哈,不能双击,要右击,选择记事本方式打开) 
    从"..\bin\dynagen\dynagen.exe" ..\net\ccna_sw.net
    到"..\bin\dynagen\dynagen.exe" ..\net\ccna_sw1.net
    在net文件夹下,拷贝ccna_sw.net ,取名字叫 ccna_sw1.net
    里面的内容修改(用记事本打开编辑哈,不能双击,要右击,选择记事本方式打开) 
    把   
            [[router SW1]]
            model = 3725
            console = 3003
            f1/1 = SW2 f1/2
            f1/2 = SW2 f1/1
            f1/3 = SW3 f1/1
            f1/11 = PC1 f0/0
            f1/12 = PC2 f0/0
    改成   
            [[router SW1]]
            model = 3725
            console = 3003
            f1/1 = SW2 f1/2
            f1/2 = SW2 f1/1
            f1/3 = SW3 f1/1
            f1/11 = PC1 f0/0
            f1/12 = PC2 f0/0
            f1/10 = PC3 f0/1
            f1/9 = PC4 f0/1
    主要是添加了 f1/10,f1/9这两行,到这里,我才明白,设备连网线的地方是这里,以前很迷惑,设备之间是怎么联系在一起的。
    为什么 PC3 f0/1要这个呢?因为PC3 f0/0被用作连接SW2了,PC4 f0/1也是同理

    现在先启动 0.虚拟服务Dynamips-XP&2003.cmd,然后启动 5_1.控制台NA交换版.cmd
    在==>下启动PC1, 命令是start PC1,然后用SecureCRT登录到PC1上,(连接localhost,端口号3006,取名字为PC1),登录后在提示下
    Would you like to enter the initial configuration dialog? [yes/no]: 输入no
    PC1配置清单:
        Router> en
        Router# configure terminal
        Enter configuration commands, one per line.  End with CNTL/Z.
        Router(config)# hostname PC1
        PC1(config)# int fa0/0
        PC1(config-if)# ip add 192.168.1.1 255.255.255.0
        PC1(config-if)# no shut
        PC1(config-if)# speed 100
        PC1(config-if)# duplex full
        PC1(config-if)# exit

    在==>下启动PC2, 命令是start PC2,然后用SecureCRT登录到PC2上,(连接localhost,端口号3007,取名字为PC2),登录后在提示下
    Would you like to enter the initial configuration dialog? [yes/no]: 输入no
    PC2配置清单:
        Router> en
        Router# configure terminal
        Enter configuration commands, one per line.  End with CNTL/Z.
        Router(config)# hostname PC2
        PC2(config)# int fa0/0
        PC2(config-if)# ip add 192.168.1.2 255.255.255.0
        PC2(config-if)# no shut
        PC2(config-if)# speed 100
        PC2(config-if)# duplex full
        PC2(config-if)# exit

    在==>下启动PC3, 命令是start PC3,然后用SecureCRT登录到PC3上,(连接localhost,端口号3008,取名字为PC3),登录后在提示下
    Would you like to enter the initial configuration dialog? [yes/no]: 输入no
    PC3配置清单:
        Router> en
        Router# configure terminal
        Enter configuration commands, one per line.  End with CNTL/Z.
        Router(config)# hostname PC3
        PC3(config)# int fa0/1
        PC3(config-if)# ip add 192.168.1.3 255.255.255.0
        PC3(config-if)# no shut
        PC3(config-if)# speed 100
        PC3(config-if)# duplex full
        PC3(config-if)# exit

    在==>下启动PC4, 命令是start PC4,然后用SecureCRT登录到PC4上,(连接localhost,端口号3009,取名字为PC4),登录后在提示下
    Would you like to enter the initial configuration dialog? [yes/no]: 输入no
    PC4配置清单:
        Router> en
        Router# configure terminal
        Enter configuration commands, one per line.  End with CNTL/Z.
        Router(config)# hostname PC4
        PC4(config)# int fa0/1
        PC4(config-if)# ip add 192.168.1.4 255.255.255.0
        PC4(config-if)# no shut
        PC4(config-if)# speed 100
        PC4(config-if)# duplex full
        PC4(config-if)# exit

    在==>下启动SW1, 命令是start SW1,然后用SecureCRT登录到SW1上,(连接localhost,端口号3003,取名字为SW1),登录后在提示下
    Would you like to enter the initial configuration dialog? [yes/no]: 输入no
    SW1启动完毕以后,就可以测试PC1,PC2,PC3,PC4是否是相互的ping通
    PC1>en
    PC1#ping 192.168.1.2  可以通
    PC1#ping 192.168.1.3  可以通
    PC1#ping 192.168.1.4  可以通

    PC2>en
    PC2#ping 192.168.1.1  可以通
    PC2#ping 192.168.1.3  可以通
    PC2#ping 192.168.1.4  可以通

    PC3>en
    PC3#ping 192.168.1.1  可以通
    PC3#ping 192.168.1.2  可以通
    PC3#ping 192.168.1.4  可以通

    PC4>en
    PC4#ping 192.168.1.1  可以通
    PC4#ping 192.168.1.2  可以通
    PC4#ping 192.168.1.3  可以通

    SW1配置清单:
        Router> en
        Router# configure terminal
        Enter configuration commands, one per line.  End with CNTL/Z.
        Router(config)# hostname SW1
        SW1(config)# exit
        SW1# show vlan-switch        //或者 sh vlan-sw  也是一样的
        SW1# vlan database
        SW1(vlan)# vlan 10 name red
        SW1(vlan)# vlan 20 name green
        SW1(vlan)# apply
        SW1(vlan)# exit
        SW1# configure terminal
        Enter configuration commands, one per line.  End with CNTL/Z.
        SW1(config)# interface f1/11
        SW1(config-if)#switchport access vlan 10
        SW1(config-if)#
        SW1(config-if)#exit
        SW1(config)#interface f1/12
        SW1(config-if)#switchport access vlan 10
        SW1(config-if)#exit
        SW1(config)#interface f1/9
        SW1(config-if)#switchport access vlan 20
        SW1(config-if)#exit
        SW1(config)#interface f1/10
        SW1(config-if)#switchport access vlan 20
        SW1(config-if)#exit
        SW1(config)# exit
        SW1#show vlan-switch

        VLAN Name                            Status    Ports
        ---- -------------------------------- --------- -------------------------------
        1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                        Fa1/4, Fa1/5, Fa1/6, Fa1/7
                                                        Fa1/8, Fa1/13, Fa1/14, Fa1/15
        10  red                              active    Fa1/11, Fa1/12
        20  green                            active    Fa1/9, Fa1/10
        1002 fddi-default                    act/unsup
        1003 token-ring-default              act/unsup
        1004 fddinet-default                  act/unsup
        1005 trnet-default                    act/unsup     
    再测试一下:

    PC1>en
    PC1#ping 192.168.1.2  可以通
    PC1#ping 192.168.1.3  不可以通
    PC1#ping 192.168.1.4  不可以通

    PC2>en
    PC2#ping 192.168.1.1  可以通
    PC2#ping 192.168.1.3  不可以通
    PC2#ping 192.168.1.4  不可以通

    PC3>en
    PC3#ping 192.168.1.1  不可以通
    PC3#ping 192.168.1.2  不可以通
    PC3#ping 192.168.1.4  可以通

    PC4>en
    PC4#ping 192.168.1.1  不可以通
    PC4#ping 192.168.1.2  不可以通
    PC4#ping 192.168.1.3  可以通

    那怎么能都能ping通呢?
    方法如下:
        SW1# configure terminal
        Enter configuration commands, one per line.  End with CNTL/Z.
        SW1(config)# interface f1/10
        SW1(config-if)#switchport access vlan 10
        SW1(config-if)#
        SW1(config-if)#exit
        SW1(config)#interface f1/9
        SW1(config-if)#switchport access vlan 10
        SW1(config-if)#exit
    这样,所有的PC1,PC2,PC3,PC4都通畅了。

    来源于网络,回归于网络。
    我的邮箱:happy.every.day@126.com QQ:48399956
    快乐!
    2008年8月17日
    0  修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved