注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 校园网重规划
 帮助

vlan_vlan通信


2008-05-25 01:47:43
 标签:vlan 通信   [推送到技术圈]

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://5116888.blog.51cto.com/268891/78627
一、说明
利用Boson软件设计好拓扑图然后进行相应的配置,关键配置就是在子接口封装802.1q协议,实现简单的不同vlan之间的通信。
二、拓扑图
f0/0
f0/12
f0/10
f0/10
f0/2
f0/2
f0/1
f0/1
三、pc及接口地址的划分
[pc]
IP地址
子网掩码
网关
pc1
192.168.1.10
255.255.255.0
192.168.1.1
pc2
192.168.2.10
255.255.255.0
192.168.2.1
pc3
192.168.1.20
255.255.255.0
192.168.1.1
pc4
192.168.2.10
255.255.255.0
192.168.2.1
 
 
[switch1]
所属vlan
模式
 f0/1
2
access
f0/2
3
access
f0/10
(默认)1
trunk
 
 
[switch2]
所属vlan
模式
f0/1
2
access
f0/2
3
access
f0/10
(默认)1
trunk
f0/12
-------
trunk
 
 
路由器接口地址
router
IP地址
子网掩码
 f0/0
------------
-------------
f0/0.1
192.168.1.1
255.255.255.0
f0/0.2
192.168.2.1
255.255.255.0
 
四、相应的配置命令代码(注:这是用show running-config得到的)
Switch:
2950A:
         2950A#show running-config
!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname 2950A
!
!
!
ip subnet-zero
spanning-tree extend system-id
!
!
!
!
!
!
!
!
interface FastEthernet0/1
 switchport mode access
 switchport access vlan 2
!
interface FastEthernet0/2
 switchport mode access
 switchport access vlan 3
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
 switchport mode trunk
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
 vtp Server
 vtp domain stone
!
interface Vlan 1
 no ip address
 no ip route-cache
!
vlan 2 name vlan2
vlan 3 name vlan3
!
ip classless
no ip http server
!
!
!
!
line con 0
 transport input none
line aux 0
line vty 0 15
!
no scheduler allocate
end
 
2950B:
         2950B#show running-config
!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname 2950B
!
!
!
ip subnet-zero
spanning-tree extend system-id
!
!
!
!
!
!
!
!
interface FastEthernet0/1
 switchport mode access
 switchport access vlan 2
!
interface FastEthernet0/2
 switchport mode access
 switchport access vlan 3
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
 switchport mode trunk
!
interface FastEthernet0/11
!
interface FastEthernet0/12
 switchport mode trunk
!
 vtp Server
 vtp domain stone
!
interface Vlan 1
 no ip address
 no ip route-cache
!
vlan 2 name vlan2
vlan 3 name vlan3
!
ip classless
no ip http server
!
!
!
!
line con 0
 transport input none
line aux 0
line vty 0 15
!
no scheduler allocate
end
 
 
router:
     R2620:
              R2620#show running-config
Building configuration...
 
!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R2620
!
!
!
ip subnet-zero
!
!
!
!
!
!
!
!
interface Serial0/0
 no ip address
 no ip directed-broadcast
 shutdown
!
interface FastEthernet0/0
 no ip address
 no ip directed-broadcast
!
interface FastEthernet0/0.1
 encapsulation dot1q 2
 ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.2
 encapsulation dot1q 3
 ip address 192.168.2.1 255.255.255.0
!
!
ip classless
no ip http server
!
!
!
!
line con 0
 transport input none
line aux 0
line vty 0 4
!
no scheduler allocate
end
五、结果与小结
 
学习是要有耐心的,持之以恒才能成功.

本文出自 “Strive_for_ever!” 博客,请务必保留此出处http://5116888.blog.51cto.com/268891/78627


附件下载:
  word文档


上一篇 单臂路由  下一篇 静态路由的配置



    文章评论
 
 

发表评论

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