dynamips 单臂路由实验

单臂路由是个很简单的实验,一直没有发现能支持单臂路由的ios,真是踏破铁鞋无觅处,得来全不费工夫,dynamips for 工大瑞普 的交换机版本就支持,ios文为 c3640-js-mz.124-10.bin(Enterprise and plus or Lan only),可以去网上找,或是工大瑞普论谈去下载。眼见为实,口说无凭。这下满足了自已的虚荣心,亲手做一下。
下边是实拓朴及net文件:

[file]attachment/200701/swlab.txt[/file]
实验配置如下(主机是用3620模拟的)
router 配置如下:
router(config)#interface FastEthernet0/0
router(config-if)#no ip address
router(config-if)#no shutdown
router(config)#interface FastEthernet0/0.1
router(config-if)#encapsulation dot1Q 1ip
router(config-if)#address 192.168.1.2 255.255.255.0

router(config)#interface FastEthernet0/0.2
router(config-if)#encapsulation dot1Q 2
router(config-if)#ip address 192.168.2.2 255.255.255.0

HOST配置如下:
HOST1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2
HOST1(config)#interface FastEthernet0/0
HOST1(config-if)#ip address 192.168.1.1 255.255.255.0

HOST2(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2
HOST2(config)#interface FastEthernet0/0
HOST2(config-if)#ip address 192.168.2.1 255.255.255.0

HOST3(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2
HOST3(config)#interface FastEthernet0/0
HOST3(config-if)#ip address 192.168.1.3 255.255.255.0
到此不在同一VLAN的计算机就可以通信了。

笔者在实验过程中还发现,如果去掉HOST1、2、3路由器上的路由功能即命令:no ip routing。则HOST1、2、3的配置可以改成:
HOST1(config)#interface FastEthernet0/0
HOST1(config-if)#ip address 192.168.1.1 255.255.255.0

HOST2(config)#interface FastEthernet0/0
HOST2(config-if)#ip address 192.168.2.1 255.255.255.0

HOST3(config)#interface FastEthernet0/0
HOST3(config-if)#ip address 192.168.1.3 255.255.255.0
此配置和上边的区别在于去掉了静态路由,因为路由器去掉了routing功能。原则上来说还应该配上ip default-gateway <address>。address 为路由器接口与HOST处于同一VLAN的子接口IP。此配置中没有这条命令就可以实现VLAN间的互仿,有待于继续研究。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据