首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • Dynamips@Edurainbow 2.72使用方法和学习项目4 [已结贴,结贴人:T5500]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • merryboy
    • 等级:
    • 可用分等级:
    • 总技术分:
    • 总技术分排名:
    • 揭贴率:
    发表于:2008-08-20 14:10:27 楼主
    试验3:测试在同一个Vlan中,不同网段计算机访问的功能(最后发现,只要开启SW1,那么PC1,PC2即使不在一个网段,只要在同一个Vlan中,就可以互通)

    第一种: 利用PC1,PC2,SW1,R1这些设备来互通(单臂路由)(后来发现,可以不用单臂路由,不用R1,也可以互通哈)(学到后面才知道,单臂路由是针对不同VLAN互连使用的方法)

    (你看启动的ccna_sw.net里面,描述了这些设备的哪些端口是怎么互相连接的)

    现在先启动 0.虚拟服务Dynamips-XP&2003.cmd,然后启动 5.控制台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)# speed 100
        PC1(config-if)# duplex full
        PC1(config-if)# no shut
        PC1(config-if)# exit
        PC1(config)#no ip routing    //一定要这行,不然不能通

    在==>下启动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.2.1 255.255.255.0
        PC2(config-if)# speed 100
        PC2(config-if)# duplex full
        PC2(config-if)# no shut
        PC2(config-if)# exit
        PC2(config)#no ip routing    //一定要这行,不然不能通

    在==>下启动SW1, 命令是start SW1,然后用SecureCRT登录到SW1上,(连接localhost,端口号3003,取名字为SW1),登录后在提示下
    Would you like to enter the initial configuration dialog? [yes/no]: 输入no
    SW1启动完毕就行。


    在==>下启动R1, 命令是start R1,然后用SecureCRT登录到R1上,(连接localhost,端口号3001,取名字为R1),登录后在提示下
    Would you like to enter the initial configuration dialog? [yes/no]: 输入no
    为R1的Fa0/0接口配置IP,并设为全双工模式:
        Router> enable
        Router# configure terminal
        Router(config)# hostname R1
        R1(config)# interface fastEthernet 0/0 //或者interface fastEthernet0/0 ,或者 int fa0/0
        R1(config-if)# ip add 192.168.1.2 255.255.255.0
        R1(config-if)# ip add 192.168.2.2 255.255.255.0 secondary
        R1(config-if)# speed 100
        R1(config-if)# duplex full
        R1(config-if)# no shutdown            //或者 no shut
        R1(config-if)# exit
        R1(config)# ip routing
    现在测试
    PC1>en
    PC1#ping 192.168.1.2  可以通
    PC1#ping 192.168.2.1  可以通
    PC1#ping 192.168.2.1  可以通

    PC2>en
    PC2#ping 192.168.1.1  可以通
    PC2#ping 192.168.1.2  可以通
    PC2#ping 192.168.2.2  可以通

    这里面SW1的作用是做为一个交换机,你看它show run,发现PC1,PC2,R1是在同一缺省(default)Vlan里面的。所以这里不用再配置Vlan了。如果你想配置可以用以下命令
    Router> en
    Router# conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    Router(config)# hostname SW1
    SW1(config)# exit
    SW1# vlan database
    SW1(vlan)# vlan 100 name blue
    SW1(vlan)# apply
    SW1(vlan)# exit
    SW1#configure t
    SW1(config)#int f1/5  //为什么是f1/5,看ccna_sw.net说得很清楚哈:f0/0 = SW1 f1/5
    SW1(config-if)#switchport access vlan 100

    现在测试
    PC1>en
    PC1#ping 192.168.1.2  可以通
    PC1#ping 192.168.2.1  可以通
    PC1#ping 192.168.2.1  可以通

    PC2>en
    PC2#ping 192.168.1.1  可以通
    PC2#ping 192.168.1.2  可以通
    PC2#ping 192.168.2.2  可以通

    第二种: 利用PC1,PC2,SW1这些设备来互通
    (你看启动的ccna_sw.net里面,描述了这些设备的哪些端口是怎么互相连接的)

    现在先启动 0.虚拟服务Dynamips-XP&2003.cmd,然后启动 5.控制台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)# speed 100
        PC1(config-if)# duplex full
        PC1(config-if)# no shut
        PC1(config-if)# exit
        PC1(config)# no ip routing    //一定要这行,不然不能通
        PC1(config)# exit
        PC1#
    在==>下启动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 172.17.40.1 255.0.0.0
        PC2(config-if)# speed 100
        PC2(config-if)# duplex full
        PC2(config-if)# no shut
        PC2(config-if)# exit
        PC2(config)#no ip routing    //一定要这行,不然不能通
        PC2(config)# exit
        PC2#
    在==>下启动SW1, 命令是start SW1,然后用SecureCRT登录到SW1上,(连接localhost,端口号3003,取名字为SW1),登录后在提示下
    Would you like to enter the initial configuration dialog? [yes/no]: 输入no
    SW1启动完毕就行。

    现在测试
    PC1>en
    PC1#ping 172.17.40.1  可以通

    PC2>en
    PC2#ping 192.168.1.1  可以通


    这里面SW1的作用是做为一个交换机,就看它show run,发现PC1,PC2是在同一缺省(default)Vlan里面的。所以这里不用再配置Vlan了。如果你想配置可以用以下命令
    Router> en
    Router# conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    Router(config)# hostname SW1
    SW1(config)# exit
    SW1# vlan database
    SW1(vlan)# vlan 100 name blue
    SW1(vlan)# apply
    SW1(vlan)# exit
    SW1#configure t
    SW1(config)# int f1/11 
    SW1(config-if)# switchport access vlan 100
    SW1(config-if)# exit
    如果这个时候ping,PC1,PC2就不能通了
    SW1(config)# int f1/12 
    SW1(config-if)# switchport access vlan 100
    SW1(config-if)# exit

    等一会,就通畅了。
    PC1>en
    PC1#ping 172.17.40.1  可以通

    PC2>en
    PC2#ping 192.168.1.1  可以通

    后来发现,可以不用R1就可以通畅了。

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

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