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


上一篇:SQLMap入门

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

相关内容

热门资讯

小伙相亲2天后花33万闪婚,一... 极目新闻记者 邓波2025年4月,安徽安庆小伙何攀到贵州贵阳花果园相亲,并与相识两天的贵阳籍女子陆某...
丘成桐:王虹和邓煜都在MIT待... 当地时间7月23日,在美国费城举行的2026年国际数学家大会开幕式上,中国数学家邓煜、王虹获得菲尔兹...
欧盟对俄制裁列单中企,中国驻欧... 问:2026年7月23日,欧盟通过第21轮对俄罗斯制裁方案,新增列单制裁中国企业。中方对此有何评论?...
特朗普预警9月政府“停摆”,美... 一国总统公开预警自家联邦政府即将“停摆”,这种魔幻剧情又双叒叕要在华盛顿上演?当地时间7月22日,特...
视频丨2026年APEC数字和... 昨天(23日),2026年亚太经合组织数字和人工智能部长会议在四川成都举行。本届会议的主题为“数字和...
海南商发二期发射区土建完工,建... 7 月 24 日消息,海南商发今日宣布,海南商业航天发射场二期发射区建设项目土建工作完成,全面转入设...
菲律宾,没有以色列的命,得了以... 菲律宾,马尼拉。美国国务卿鲁比奥来了。菲律宾期盼已久的“救星”来了。菲律宾认为的“阳光”来了。从机场...
服务器盛会东莞启幕,松山湖软硬... 7月23日至24日,“智算筑基 融链共赢——2026年服务器产业供需对接活动”在东莞举行。作为系列配...
面向6G通信、高端安检、精准医... 太赫兹作为“电磁波段最后一块未开垦之地”,近年在超快光电子、低尺度半导体技术的推动下,逐步从实验室走...
获得全球最高奖项的中国数学家,... 一个喜欢玩梗的二次元大佬,竟然站上了数学界最高荣誉的领奖台。他就是今年的菲尔兹奖得主之一,邓煜。另一...