注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 [业内传闻]今天,7月25日..
 帮助

单臂路由


2007-06-01 18:53:13
 标签:单臂路由   [推送到技术圈]

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://loveme23.blog.51cto.com/7891/28795
试验工具:dynamips,IOS:3640
实验拓扑:如图


配置清单:
ROUTER1:
Router#show run
Building configuration...

Current configuration : 577 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!        
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.1
 encapsulation dot1Q 10
 ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.2
 encapsulation dot1Q 20
 ip address 192.168.2.1 255.255.255.0
!
ip http server
!
!
!
!
!
control-plane
!
!        
line con 0
line aux 0
line vty 0 4
!
end
-----------------------------------------------------------------------------------
SWITCH:
Router#show run
Building configuration...

Current configuration : 937 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!        
!
interface FastEthernet0/0
 switchport mode trunk
!
interface FastEthernet0/1
 switchport access vlan 10
 duplex full
 speed 100
!
interface FastEthernet0/2
 switchport access vlan 20
 duplex full
 speed 100
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
ip http server
!
!        
!
!
!
control-plane
!
!
line con 0
line aux 0
line vty 0 4
!
end
-----------------------------------------------------------------------
PC1:
Router#show run

interface FastEthernet0/0
 ip address 192.168.1.10 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
ip default-gateway 192.168.1.1
ip http server
-----------------------------------------------------------------------
PC2:
Router#show run

interface FastEthernet0/0
 ip address 192.168.2.10 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
ip default-gateway 192.168.2.1
ip http server
----------------------------------------------------------------------
测试:
PC1 ping PC2
Router#ping 192.168.2.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 204/290/372 ms

PC2 ping PC1
Router#ping 192.168.1.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 104/233/360 ms

成功。
-----------------------------------------------------------------------
实验中遇到的问题:
刚开始交换机和路由器还有PC都配置好后,PC只能ping通自己的网关,但是ping不到另外一个vlan,后来检查了一下配置,发现没什么问题,又到网上找了点资料,发现在这个虚拟环境下面,替代PC机的路由器要用no ip routing命令关闭路由功能。使用该命令后后一切正常,不太理解其中奥秘。。。

本文出自 “★Beckham~23” 博客,请务必保留此出处http://loveme23.blog.51cto.com/7891/28795





    文章评论
 
2007-06-01 20:37:02
呵,那个模拟PC是用路由器模拟的吧?
如果是的话,不禁路由功能,间接转发,它会先查路由表,路由表中有条目才会转发,没有就会丢弃,
你把路由功能禁了,那么它就不查路由表了,间接转发交给网关

2007-06-01 22:14:11
多谢夕阳老师指点~!嘿嘿!

2007-07-02 20:36:07
我看到这里面的配置都是用路由器做的,有没有真正switch、router、pc的配置呢?

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: