现在先启动 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 可以通
这里面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
现在先启动 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