思科三层交换机不同vlan互通_实现网络中不同VLAN间通信,三层交换机,单臂路由,理论+实战...

VLAN 隔离广播的同时,也禁止了不同VLAN 之间的用户通信,VLAN 间的通信成为新的焦点,VLAN 路由( 三层路由功能) 成功地解决了VLAN 间的通信。

一、三层交换机VLAN路由功能解决不同VLAN间通信

二层交换机和路由器在功能上的集成构成了三层交换机,三层交换机在功能上实现了VLAN 的划分、VLAN 内部的二层交换和VLAN 间路由的功能。

b131a81f42979f051c9dbaa4309e3393.png

三层交换机

vlanif 接口up 条件:

1.必须存在该vlan

2.必须有接口属于该vlan中,并且该接口必须处于活动接口

3.如果接口是trunk接口,必须要允许相对应的vlan通过

2、单臂路由解决不同VLAN间通信

三层交换机:一次路由,多次交换

二、单臂路由解决方案:

2393d58bd6390ed29c8d073dea2830a6.png

传统的三层以太网接口不支持VLAN报文,当收到VLAN报文时,会将VLAN报文当成非法报文而丢弃。为了实现VLAN间互通,在三层以太网接口上可创建以太网子接口,通过在子接口上部署终结子接口功能将VLAN报文中的Tag剥掉

,从而实现VLAN间互通。

交换机SW1配置创建VLAN并接口划分VLAN:

c147dfbd7215bf4f7c5bebf28ca25772.png

interface Ethernet0/0/11

port link-type trunk

port trunk allow-pass vlan 10 20 上联路由器接口配置trunk

interface GigabitEthernet0/0/0 // 接口使能up

interface GigabitEthernet0/0/0.10 //配置子接口

dot1q termination vid 10 //dot1q 终结 vlan 10

arp broadcast enable //默认情况下,关闭ARP 广播,开启ARP广播功能

ip address 10.1.10.254 255.255.255.0 //配置子接口IP地址

interface GigabitEthernet0/0/0.20

dot1q termination vid 20

ip address 10.1.20.254 255.255.255.0

arp broadcast enable

PC1与PC2可以实现正常通信:

d7caaa3347d68fcca9897838d2b7ab6c.png
好的,下面我将为您介绍在思科模拟器如何通过单臂路由三层交换机SVI实现不同VLAN间的路由通信。 1. 路由器单臂路由实现不同VLAN间路由通信 单臂路由是指将路由器的一个接口与交换机的一个端口连接起来,用来实现不同VLAN之间的路由通信。在思科模拟器,可以使用以下步骤实现单臂路由: (1)创建VLAN和端口并将端口配置到相应的VLAN,例如: ``` Switch(config)# vlan 10 Switch(config-vlan)# name SALES Switch(config)# interface gigabitethernet 1/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10 Switch(config)# vlan 20 Switch(config-vlan)# name MARKETING Switch(config)# interface gigabitethernet 1/2 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 20 ``` (2)将路由器的一个接口配置为Trunk链路,并允许通过所有VLAN,例如: ``` Router(config)# interface gigabitethernet 0/0 Router(config-if)# ip address 192.168.1.1 255.255.255.0 Router(config-if)# no shutdown Router(config-if)# exit Router(config)# interface gigabitethernet 0/1 Router(config-if)# switchport mode trunk Router(config-if)# switchport trunk allowed vlan all Router(config-if)# no shutdown ``` (3)在路由器上创建子接口,并将子接口配置为不同VLAN,并分配IP地址,例如: ``` Router(config)# interface gigabitethernet 0/1.10 Router(config-if)# encapsulation dot1q 10 Router(config-if)# ip address 192.168.10.1 255.255.255.0 Router(config)# interface gigabitethernet 0/1.20 Router(config-if)# encapsulation dot1q 20 Router(config-if)# ip address 192.168.20.1 255.255.255.0 ``` (4)在交换机上配置默认网关,例如: ``` Switch(config)# ip default-gateway 192.168.1.1 ``` 配置完成后,不同VLAN之间的主机就可以通过路由器的单臂路由实现通信。 2. 三层交换机SVI实现不同VLAN间路由通信 三层交换机可以通过SVI(Switch Virtual Interface)实现不同VLAN之间的路由通信。在思科模拟器,可以使用以下步骤实现SVI: (1)创建VLAN并将端口配置到相应的VLAN,例如: ``` Switch(config)# vlan 10 Switch(config-vlan)# name SALES Switch(config)# interface gigabitethernet 1/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10 Switch(config)# vlan 20 Switch(config-vlan)# name MARKETING Switch(config)# interface gigabitethernet 1/2 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 20 ``` (2)在三层交换机上创建SVI,并将SVI配置为不同VLAN,并分配IP地址,例如: ``` Switch(config)# interface vlan 10 Switch(config-if)# ip address 192.168.10.1 255.255.255.0 Switch(config)# interface vlan 20 Switch(config-if)# ip address 192.168.20.1 255.255.255.0 ``` (3)在交换机上配置默认网关,例如: ``` Switch(config)# ip default-gateway 192.168.1.1 ``` 配置完成后,不同VLAN之间的主机就可以通过三层交换机的SVI实现通信。 以上就是在思科模拟器通过单臂路由三层交换机SVI实现不同VLAN间的路由通信的方法。希望对您有所帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值