三层交换机实现不同vlan间的通信
我们知道不同的vlan之间要相互的通行必须要借用第三层,也就是网络层,可以路由器也可以是三层的交换机,在这里我主要是介绍用三层交换机来实现不同的vlan之间的的通信。
实验拓扑图结构:
实验描述:
pc0和pc1分属于不同的vlan中,在实际的生活中,它们之间存在相互通信的可能。
pc0
ip | 192 | 168 | 1 | 2 |
mask | 255 | 255 | 255 | 0 |
gataway | 192 | 168 | 1 | 1 |
pc1
ip | 192 | 168 | 2 | 2 |
mask | 255 | 255 | 255 | 0 |
gataway | 192 | 168 | 2 | 1 |
实验命令:
对于二层交换机
Switch>
Switch>en
Switch#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname switch0
switch0#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
switch0(vlan)#vlan 2 name 2
VLAN 2 modified:
Name: 2
switch0(vlan)#vlan 3 name 3
VLAN 3 added:
Name: 3
switch0(vlan)#exit
APPLY completed.
Exiting....
switch0#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
switch0(config)#int f0/1
switch0(config-if)#switchport mode access
switch0(config-if)#switchport access vlan 2
switch0(config-if)#exit
switch0(config)#int f0/3
switch0(config-if)#switchport mo
switch0(config-if)#switchport mode a
switch0(config-if)#switchport mode access
switch0(config-if)#switchport access vlan 3
switch0(config-if)#exit
switch0(config)#int f0/2
switch0(config-if)#switchport mode trunk
switch0(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
switch0#copy run star
Destination filename [startup-config]?
Building configuration...
[OK]
对于三层交换机
Switch>en
Switch#
Switch#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#interface f0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
Switch(vlan)#vlan 2 name 2
VLAN 2 added:
Name: 2
Switch(vlan)#vlan 3 name 3
VLAN 3 added:
Name: 3
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#configure t
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int
Switch(config)#interface vlan 2
%LINK-5-CHANGED: Interface Vlan2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to upSwitch(config-if)#ip add
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#int vlan 3
%LINK-5-CHANGED: Interface Vlan3, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to upSwitch(config-if)#ip add 192.168.2.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#copy run star
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#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
测试
Pinging 192.168.2.2with 32 bytes of data:
Reply from 192.168.2.1: bytes=32 time=63ms TTL=255
Reply from 192.168.2.1: bytes=32 time=63ms TTL=255
Reply from 192.168.2.1: bytes=32 time=63ms TTL=255
Reply from 192.168.2.1: bytes=32 time=62ms TTL=255
Ping statistics for 192.168.2.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 62ms, Maximum = 63ms, Average = 62ms
实验成功。。。
需要注意的问题
本次试验中对于三层交换机首先要启动它的路由功能ip routing,否则实验是不能成功的,通过show ip route 我们可以看见路由表是建立起来了的。例外,三层设备必须建立多个vlan,虽然建立的vlan没有划分给具体的某些端口,但是我们在建立vlan虚拟地址的先决条件是必须先有这些vlan的存在的,不知大家注意没有,电脑的网关就是它所属vlan的虚拟ip。
转载于:https://blog.51cto.com/netcisco/169919
三层交换机实现不同vlan间的通信相关推荐
- 三层交换机解决不同VLAN间的通信—Vecloud微云
交换机的转发过程 交换机工作于OSI参考模型的第二层,即数据链路层.交换机内部的CPU会在每个端口成功连接时,通过将MAC地址和端口对应,形成一张MAC表.交换机根据MAC地址表转发数据. 路由器的转 ...
- 锐捷(十八)锐捷三层交换机实现不同vlan间的通信
一 实验拓扑 二 实验需求 使用三层交换机,实现vlan10,vlan20,vlan30的主机通过三层通信,并将网关配置在三层交换机上. 三 需求分析 锐捷三层交换机的配置与思科设备配置相似,只需要在 ...
- 三层交换机如何配置?如何实现不同vlan间的通信?
一.什么是三层交换机? 在了解vlan之间,我们先来简单的了解下三层交换机. 要实现vlan间通信,就需要路由:解决的方法要么是二层交换机加路由器,要么就是直接使用三层交换机,为什么要使用三层交换机呢 ...
- 思科三层交换机不同vlan互通_cisco(三层交换和动态路由,不同vlan间的通信,静态路由实现全网互通)...
之前是同vlan的通信 现在是不同vlan间的通信,不同网络之间的通信,不同网段间的通信,要用到路由器. 路由器上一个接口只能配一个网关.路由器接口少,怎么办? 在一个接口上划分出多个子接口. 单肩路 ...
- 105、三层交换机如何配置?如何实现不同vlan间的通信?
前面我们曾提到关于vlan组网,有很多朋友反映有没有更详细.更简单的内容,这次我们用一个实例来讲解vlan的创建及组网过程,且所有的命令都有流释,我们一起来看下.在了解vlan之间,我们先来简单的了解 ...
- 思科模拟器-使用三层交换机实现vlan间的通信
由于三层交换机的路由功能,可实现vlan间的通信,即在不同vlan间的通信. 如图,实现pc0和pc1之间互通 首先,需要在switch0上创建vlan 11,在switch1上创建vlan 22,在 ...
- 华为三层交换机实现不同vlan间通信
实验名称:华为三层交换机实现不同vlan间通信 实验目的:pc1/pc2/pc3实现通信 实验拓扑: 实验步骤: 1.配置PC机 2.配置三层交换机 <huawei>syste-mview ...
- access下如何配置两个vlan_不同vlan间的通信如何简单配置(三种方式) ?
1.单臂路由(图) 环境:一台路由器,一台二层交换机,两台pc机 二层交换机的配置 一般模式: Switch> 输入enable进入特权模式: Switch>enable 输入config ...
- 用思科模拟器实现三层交换机下不同VLAN之间的通信
用思科模拟器实现三层交换机下不同VLAN之间的通信 实验目标:在三层交换机下实现不同VLAN的PC机之间的通信 工具: CisicoPacketTracer6 实验设备: 六台PC机,四台接入层交换机 ...
最新文章
- 【Redfin SDE intern】跪经
- Android vector标签 PathData 画图超详解
- 学习笔记(九)——JSON 和 AJAX
- 用java编写一个简单计算器
- SAP CRM Fiori应用Appointment startup parameters - 启动参数
- springMVC_数据的处理过程
- winfrom 点击按钮button弹框显示颜色集
- Linux 下 nginx反向代理与负载均衡
- python实例 99,100
- SpringBoot集成MongoDB
- 卡尔曼滤波simulink例子,位移和速度2变量估计
- 超级便宜的鸿蒙开发板环境搭建-编译-烧录
- java double的加法_java Double 进行加减乘除
- C#中的程序集和命名空间
- 【机器学习实战】垃圾分类快速理解机器学习中的朴素贝叶斯(Naive Bayes)
- Git命令提交代码步骤
- 星河互联刘玮玮:Echo卖疯了,为什么擅长制造爆款的中国人又没跟上?
- 微信无法定位 请打开定位服务器,微信定位开了还是无法定位(定位打开了无法获取位置)...
- AcrelEMS-BP生物制药工厂能效管理系统
- CERC2017 F-Faulty Factorial【数论】