网络设备配置与管理---VLAN间路由实现部门间通信
admin
2023-02-18 23:00:07
0次




理论学习

问题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的拓扑图)

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

方案一: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间流量不必经过路由器,网络延时和抖动都很小,同时也极大程度的减轻上层接入路由器的负载。


上一篇:SQLMap入门

下一篇:SQL注入绕过登录验证

相关内容

热门资讯

空调连续工作多久需要停机休息 空调连续工作的时间取决于多个因素,包括空调的型号、功率、使用环境和维护情况等。一般来说,空调可以连续...
空调哪个符号是除湿的 空调除湿功能通常用一个水滴形状的符号表示。不同品牌和型号的空调遥控器可能会有所差异,但一般来说,除湿...
格力空调多长时间加一次氟利昂 1、一般情况下,空调对氟利昂的使用量是非常小的,所以在空调使用了四年左右的时候再考虑加也没问题。2、...
空调用多长时间需要加氟一次 一般情况下是五年。当出现以下这几种情况时,空调才需要加氟。1、空调的室内机和室外机各有两个接口,当接...
格调生活·C标思享荟:卡萨帝在... 9月12日的郑州龙湖金融岛,夜风轻拂,灯光璀璨。“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑...
品牌价值破千亿、高端份额持续领... 9月12日,“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑州站”在郑州龙湖金融岛举办。2026...
空调主板坏了修800还是换新的 空调主板坏了是修还是换新,需要考虑多个因素,以下是一些建议:1. 维修成本:如果维修费用较低,比如 ...
空调开多久需要休息多长时间 问题:空调开多久需要休息多长时间回答:1、在使用空调的过程中,一般空调开7~8个小时左右需要休息2~...
中央空调多长时间清洗一次 1、一般空调开机前清洗一次即可,空调开机中间时段再清洗一次,空调关机时清洗一次,这样比较合理。2、空...
中央空调氟利昂多久加一次 看空调制热和制冷程度,很多人的观点认为氟利昂必须一年放一次,其实这个观点是错误的,理解上面有点偏差,...