温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

网络设备配置与管理---VLAN间路由实现部门间通信

发布时间:2020-10-21 19:06:10 来源:网络 阅读:605 作者:lij123 栏目:网络安全




理论学习

问题1:三层交换机的路由共有几种实现方式?

1) 虚拟交换接口(svi

2) 路由接口routed port

3) 三层聚合链路(L3 Aggregate Link 接口

 

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

 

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

 

 

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

 

交换机虚拟接口(Switch Virtual InterfaceSVI)代表一个由交换端口构成的VLAN(其实就是通常所说的VLAN接口),以便于实现系统中路由和桥接的功能。一个交换机虚拟接口对应一个VLAN,当需要路由虚拟局域网之间的流量或桥接VLAN之间不可路由的协议,以及提供IP主机到交换机的连接的时候,就需要为相应的虚拟局域网配置相应的交换机虚拟接口,其实SVI就是指通常所说的VLAN接口,只不过它是虚拟的,用于连接整个VLAN,所以通常也把这种接口称为逻辑三层接口,也是三层接口。

三层可以划分vlanvlan设置一个地址当网关 ,实现vlan间的路由

也可以在二层创建vlan,三层通过虚拟子接口 创建单臂路由,实现vlan间的路由

问题4:路由接口和SVI接口实现路由什么不同

 

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

而路由接口,是直接在端口上设置ip实现路由

 

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

 

1) 业务vlan

2) 互联vlan

   3)  管理vlan

工作任务描述

某公司现有两个部门,每个部门各有100台左右的计算机,所有计算机位于同一子网,现在发现整个网络的通信质量很差,请问如何进行网络改造以提高网络通信质量。

工作任务实施

网络拓扑结构设计(粘贴PT的拓扑图)

网络设备配置与管理---VLAN间路由实现部门间通信

方案一:SW1连接A部门的计算机,SW2连接B部门计算机,两台二层交换机不做任何配置,仅用于网络接入,而这两台二层交换机上行线路分别连接到RS交换机的一个VLAN,为RS的两个VLAN配置IP地址即可实现VLAN间路由功能。这种网络的规划和配置适合于AB两部门的计算机相对独立的连接在各自的交换机上,仅需要解决的是两个部门之间的路由问题。

        方案一配置:

 

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

 

方案二:如果AB部门的计算机由于地理位置的原因,分别连接在SW1SW2交换机上,则需要将SW1SW2的两条上行线路设置为Trunk线路,RS交换机采用VTP域的模式实现扩展VLAN的功能,然后在RS三层交换机上通过配置各个VLANIP地址实现两个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间流量不必经过路由器,网络延时和抖动都很小,同时也极大程度的减轻上层接入路由器的负载。


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI