设为首页 收藏本站
查看: 1075|回复: 0

[经验分享] 网络设备配置与管理---VLAN间路由实现部门间通信

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-6-29 09:52:36 | 显示全部楼层 |阅读模式


理论学习
问题1:三层交换机的路由共有几种实现方式?
1) 虚拟交换接口(svi)
2) 路由接口(routed port)
3) 三层聚合链路(L3 Aggregate Link) 接口

问题2:描述单臂路由的实现原理?

单臂路由是在二层交换机上进行vlan 划分的,然后通过一条中继链路连接路由器的一个接口(通常路由需要使用至少两个接口来实现路由功能,而现在只需要一个接口,就像一条胳膊在发挥作用,所以 称之为单臂路由),在路由器上通过配置子接口和802.1Q 协议封装最终实现在vlan 信息和子网一一对应,即实现vlan 间的路由功能。


问题3:SVI的含义是什么?如何实现VLAN间路由?

交换机虚拟接口(Switch Virtual Interface,SVI)代表一个由交换端口构成的VLAN(其实就是通常所说的VLAN接口),以便于实现系统中路由和桥接的功能。一个交换机虚拟接口对应一个VLAN,当需要路由虚拟局域网之间的流量或桥接VLAN之间不可路由的协议,以及提供IP主机到交换机的连接的时候,就需要为相应的虚拟局域网配置相应的交换机虚拟接口,其实SVI就是指通常所说的VLAN接口,只不过它是虚拟的,用于连接整个VLAN,所以通常也把这种接口称为逻辑三层接口,也是三层接口。
三层可以划分vlan给vlan设置一个地址当网关 ,实现vlan间的路由
也可以在二层创建vlan,三层通过虚拟子接口 创建单臂路由,实现vlan间的路由
问题4:路由接口和SVI接口实现路由什么不同

svi接口说白了就是vlan接口,在上面配上ip,然后把二层端口加入进来,以前的设备不能直接在端口 上配ip,就用svi接口方式来配ip,实现三层连接。
而路由接口,是直接在端口上设置ip来实现路由

    问题5:交换机的VLAN有哪些类型?

1) 业务vlan
2) 互联vlan
   3)  管理vlan
工作任务描述
某公司现有两个部门,每个部门各有100台左右的计算机,所有计算机位于同一子网,现在发现整个网络的通信质量很差,请问如何进行网络改造以提高网络通信质量。
工作任务实施
网络拓扑结构设计(粘贴PT的拓扑图)
wKiom1WH6lqQbvt3AADLsGsvcgY042.jpg
方案一:SW1连接A部门的计算机,SW2连接B部门计算机,两台二层交换机不做任何配置,仅用于网络接入,而这两台二层交换机上行线路分别连接到RS交换机的一个VLAN,为RS的两个VLAN配置IP地址即可实现VLAN间路由功能。这种网络的规划和配置适合于A、B两部门的计算机相对独立的连接在各自的交换机上,仅需要解决的是两个部门之间的路由问题。
        方案一配置:

Rs

RS#show run
Building configuration...

Current configuration : 1307 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname RS
!
!
!
ip routing
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/1
!
(省略……)
!
interface FastEthernet0/23
switchport access vlan 2
switchport mode access
!
interface FastEthernet0/24
switchport access vlan 3
switchport mode access
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan2
ip address 192.168.1.254 255.255.255.0
!
interface Vlan3
ip address 192.168.2.254 255.255.255.0
!
ip classless
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end





试以及查看RS的路由

RS# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, Vlan2
C    192.168.2.0/24 is directly connected, Vlan3

方案二:如果A、B部门的计算机由于地理位置的原因,分别连接在SW1和SW2交换机上,则需要将SW1和SW2的两条上行线路设置为Trunk线路,RS交换机采用VTP域的模式实现扩展VLAN的功能,然后在RS三层交换机上通过配置各个VLAN的IP地址实现两个VLAN之间的路由功能。
方案二配置:
RS

RS#show run
Building configuration...

Current configuration : 1381 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname RS
!
!
ip routing
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/1
!
(省略……)
!
interface FastEthernet0/23
switchport access vlan 2
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/24
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan2
ip address 192.168.1.254 255.255.255.0
!
interface Vlan3
ip address 192.168.2.254 255.255.255.0
!
ip classless
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
end


Sw1


Sw1#show run
Building configuration...

Current configuration : 1091 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Sw1
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport access vlan 2
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 3
switchport mode access
!
interface FastEthernet0/3
!
(省略……)
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end


Sw2

Sw2#show run
Building configuration...

Current configuration : 1091 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Sw2
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport access vlan 2
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 3
switchport mode access
!
interface FastEthernet0/3
!
(省略……)
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
试以及查看RS的路由

RS#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, Vlan2
C    192.168.2.0/24 is directly connected, Vlan3

如果改为三层接口如何实现
RS

show run
Building configuration...

Current configuration : 1317 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname RS
!
!
ip routing
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/1
!
(省略……)
!
interface FastEthernet0/23
no switchport
ip address 192.168.1.254 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/24
no switchport
ip address 192.168.2.254 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan2
no ip address
!
interface Vlan3
no ip address
!
ip classless
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
end
工作扩展
扩展ACL的配置
由于购买三层交换机的投入较大,上述实验我们也可以采用一种较为省钱的方法来实现,就是采用单臂路由,这样只要加入一个路由器,就可以实现二层交换机各VLAN间的路由了。
     具体配置:
R1

R1#show run
Building configuration...

Current configuration : 594 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 2
ip address 192.168.1.254 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 3
ip address 192.168.2.254 255.255.255.0
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
ip classless
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
end

Switch


show run
Building configuration...

Current configuration : 1094 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport access vlan 2
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 3
switchport mode access
!
interface FastEthernet0/3
!
(省略……)
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
思考问题:
问题1:单臂路由和三层交换机的VLAN间路由有什么不同?

单臂路由在大流量的情况下,会给路由器带来很大的负荷。

而三层交换机的VLAN间路由由交换机的三层转发引擎完成,其性能取决于交换机的背板转发速率,注意,因为一般的三层交换机都可以在多个端口上(注意:不是全部端口同时线速转发)轻松实现线速转发,可以获得很好的性能,VLAN间流量不必经过路由器,网络延时和抖动都很小,同时也极大程度的减轻上层接入路由器的负载。


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-81422-1-1.html 上篇帖子: cisco模拟器 基本操作 下篇帖子: 网络设备配置与管理----调试Cisco Catalyst交换机 通信 网络
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表