路由器配置——单臂路由实现VLAN间通信
一、实验目的:用路由器使同和不同vlan可以通信
二、拓扑图如下:
三、具体步骤:
(1)R1路由器配置:
Router>en --进入特权模式
Router#conf t --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1 --修改路由器名为R1
R1(config)#interface f0/0 --进入端口
R1(config-if)#no shutdown --开启端口
R1(config-if)#interface f0/0.1 --进入子端口
R1(config-subif)#encapsulation dot1q 10
R1(config-subif)#ip address 192.168.1.254 255.255.255.0 --给子端口设置ip地址
R1(config-subif)#interface f0/0.2 --进入子端口
R1(config-subif)#encapsulation dot1q 20 --封装端口
R1(config-subif)#ip address 192.168.2.254 255.255.255.0 --给子端口设置ip地址
R1(config-subif)#interface f0/0.3 --进入子端口
R1(config-subif)#encapsulation dot1q 30 --封装端口
R1(config-subif)#ip address 192.168.3.254 255.255.255.0 --给子端口设置ip地址
R1(config-subif)#interface f0/0.4 --进入子端口
R1(config-subif)#encapsulation dot1q 40 --封装端口
R1(config-subif)#ip address 192.168.4.254 255.255.255.0 --给子端口设置ip地址
R1(config-subif)#end --返回特权模式
R1#copy running-config startup-config --保存配置
[OK] --保存成功
(2)S1交换机配置
Switch>en --进入全局配置模式
Switch#conf t --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S1 --修改交换机名为S1
S1(config)#vtp domain abc --创建vtp域
Domain name already set to abc.
S1(config)#vtp mode server 设置当前交换机在vtp中为server模式
Device mode already VTP SERVER.
S1(config)#vlan 10 --创建vlan 10
S1(config-vlan)#vlan 20 --创建vlan 20
S1(config-vlan)#vlan 30 --创建vlan 30
S1(config-vlan)#vlan 40 --创建vlan 40
S1(config-vlan)#interface range f0/1-4 --进入f0/1,f0/2,f0/3,f0/4端口
S1(config-if-range)#switchport mode trunk --设置f0/1-f0/4之间所有端口为trunk模式
S1(config-if-range)#interface range f0/10-11 --进入f0/10和f0/11端口
S1(config-if-range)#switchport mode access --设置f0/10,f0/11端口为access模式
S1(config-if-range)#switchport access vlan 40 --将f0/10,f0/11端口划入vlan 40
S1(config-if-range)#end --返回特权模式
S1#copy running-config startup-config --保存配置
[OK] --保存成功
(3)S2交换机配置
Switch>en --进入特权模式
Switch#conf t --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S2 --修改交换机名为S2
S2(config)#vtp mode client --设置当前交换机在vtp中为客户模式
Device mode already VTP CLIENT.
S2(config)#interface f0/1 --进入f0/1端口
S2(config-if)#switchport mode access --设置f0/1端口为access模式
S2(config-if)#switchport access vlan 10 --将f0/1端口划入vlan 10
S2(config-if)#interface f0/2 --进入f0/2端口
S2(config-if)#switchport mode access --设置f0/2端口为access模式
S2(config-if)#switchport access vlan 20 --将f0/2划入vlan2
S2(config-if)#interface f0/3 --进入f0/3端口
S2(config-if)#switchport mode access --设置f0/3端口为access模式
S2(config-if)#switchport access vlan 30 --将f0/3端口划入vlan 30
S2(config-if)#interface f0/4 --进入f0/4端口
S2(config-if)#switchport mode trunk --设置f0/4端口为trunk模式
S2(config-if)#end --返回特权模式
S2#copy running-config startup-config --保存配置
[OK] --保存成功
(4)S3交换机配置
Switch>en --进入特权模式
Switch#conf t --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S3 --修改交换机名为S3
S3(config)#vtp mode client --设置当前交换机在vtp中为客户模式
Device mode already VTP CLIENT.
S3(config)#interface f0/1 --进入f0/1端口
S3(config-if)#switchport mode access --设置f0/1端口为access模式
S3(config-if)#switchport access vlan 10 --将f0/1端口划入vlan 10
S3(config-if)#interface f0/2 --进入f0/2端口
S3(config-if)#switchport mode access --设置f0/2端口为access模式
S3(config-if)#switchport access vlan 20 --将f0/2端口划入vlan 20
S3(config-if)#interface f0/3 --进入f0/3端口
S3(config-if)#switchport mode access --设置f0/3端口为access模式
S3(config-if)#switchport access vlan 30 --将f0/3端口划入vlan 30
S3(config-if)#interface f0/4 --进入f0/4端口
S3(config-if)#switchport mode trunk --设置f0/4端口为trunk模式
S3(config-if)#end --返回特权模式
S3#copy running-config startup-config --保存配置
[OK] --保存成功
(5)S4交换机配置
Switch>en --进入特权模式
Switch#conf t --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S4 --修改交换机名为S4
S4(config)#vtp mode client --设置当前交换机在VTP中为客户模式
Device mode already VTP CLIENT.
S4(config)#interface f0/1 --进入f0/1端口
S4(config-if)#switchport mode access --设置f0/1端口为access模式
S4(config-if)#switchport access vlan 10 --将f0/1划分到vlan 10
S4(config-if)#interface f0/2 --进入f0/2端口
S4(config-if)#switchport mode access --设置f0/2端口为access模式
S4(config-if)#switchport access vlan 20 --将f0/2划分到vlan 20
S4(config-if)#interface f0/3 --进入f0/3端口
S4(config-if)#switchport mode access --设置f0/3端口为access模式
S4(config-if)#switchport access vlan 30 --将f0/3划分到vlan 30
S4(config-if)#interface f0/4 --进入f0/4端口
S4(config-if)#switchport mode trunk --将f0/4端口设置为trunk模式
S4(config-if)#end --返回特权模式
S4#copy running-config startup-config --保存配置
[OK] --保存成功
四、验证不同vlan是否能通讯
(1)PC11与PC22
vlan 10和vlan 20可以通信
(2)PC33与WEB
vlan 30 与vlan 40 可以通信
路由器配置——单臂路由实现VLAN间通信的更多相关文章
- 路由器基础配置之单臂路由实现vlan间通信
我们将以上面的拓扑图开始进行配置,目的为设置单臂路由实现vlan间通信,设置4个vlan,pc0,1,2为vlan10 pc3,4,5为vlan20:pc6,7,8为vlan30:server0,1为 ...
- 单臂路由实现VLAN间通信
实验要求:利用路由器完成同vlan能通信,不同vlan也能通信 拓扑如下: 涉及内容有: 1.VTP的创建和配置 2.VLAN的创建和划分 3.路由器的单臂路由配置 配置如下: route1 enab ...
- 利用单臂路由实现VLAN间的路由
实验4:利用单臂路由实现VLAN间的路由. 实验原理: 实验内容: 本实验模拟公司网络场景,路由器R1是公司的出口网关,员工PC通过接入层交换机(如S2和S3)接入公司网络,接入层交换机又通过汇聚交 ...
- eNSP仿真软件之利用单臂路由实现VLAN间路由
1. 实验原理 以太网中,通常会使用VLAN技术隔离二层广播域来减少广播的影响,并增强网络的安全性和可管理性.其缺点是同时也严格地隔离了不同VLAN之间的任何二层流量,使分属于不同VLAN的用户不能直 ...
- VLAN实验4(在eNSP上利用单臂路由实现VLAN间路由)
原理概述: 以太网中,通常会使用VLAN技术隔离二层广播域来减少广播的影响*并增强 网络的安全性和可管理性.其缺点足同时也严格地隔离了不同VLAN之间的任何二层流量,使分属于不同VLAN的用户 不能直 ...
- VLAN实验4:利用单臂路由实现VLAN间路由
单臂路由: 实验环境: 实验拓扑图: 实验编址: 实验步骤:1.创建VLAN并配置Access.Trunk接口. 我们在S2上创建VLAN10和VLAN20,并且吧链接PC1的E0/0/1和链接PC2 ...
- 在ensp上利用单臂路由实验VLAN间路由
我们为什么要设置单臂路由? 因为我们要解决不同vlan,不同网络的PC机间的通信问题~ 那它为啥叫单臂路由嘞? 单臂路由的原理时通过一台路由器,使vlan间互通数据通过路由器进行三层转发,如果在路由器 ...
- eNSP——利用单臂路由实现VLAN间路由
原理: 以太网中,通常会使用VLAN技术隔离二层广播域来减少广播的影响,并增强网络的安全性和可管理性.其缺点是同时也严格地隔离了不同VLAN之间的任何二层流量,使分属于不同VLAN的用户不能直接互相通 ...
- 利用单臂路由实现VLAN间路由(有1个疑问)
配置PC机: PC1:IP 192.168.1.1 :掩码:255.255.255.0:网关:192.168.1.254 VLAN 10 PC2:IP 192.168.2.1 :掩码:255.255 ...
随机推荐
- tp5支付宝和微信支付
一.生成二维码给用户进行扫码支付 1.先在vendor目录下加入支付宝和微信支付的引用 2.付款处调用 /** * 订单支付接口 * * @api {post} {:url('order/pay')} ...
- django进阶版1
目录 字段中choice参数 MTV与MVC模型 AJAX(*********) Ajax普通请求 Ajax传json格式化数据 Ajax传文件 序列化组件 Ajax+sweetalert 字段中ch ...
- python 类(3) property
class PetCat(): """ 家猫类""" def __init__(self, name, age): self.name = ...
- springboot打包的jar项目,不需要安装jdk环境启动
因为服务器上是JDK7,而springboot至少用JDK8才行,但是又因为是很老的项目,不是很清楚能不能换JDK8,有风险,因此选择以前项目用JDK7,而新的springboot用JDK8.步骤一: ...
- Dom编程-左侧菜单栏设计模型实现
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Codeforces 1236A. Stones
传送门 注意到两种操作都要消耗中间的石头,并且两种操作每次都会得到 $3$ 个石头 那么显然优先做操作二是最优的,因为操作二只会消耗中间堆的一个石头 如果有剩下再进行操作 $1$ ,那么可以保证总操作 ...
- vue和react区别
vue和react区别
- C 中 char、signed char 和 unsigned char 的区别
C 中 char.signed char 和 unsigned char 的区别 来源:http://bbs.chinaunix.net/thread-889260-1-1.html 参考:https ...
- Python的argparse模块的使用
Python的argparse模块的使用 最近看到一份Pytorch代码有以下内容: # Training settings parser = argparse.ArgumentParser(desc ...
- python 访问权限
访问权限 权限: 公有的:类中的普通属性和方法,默认都是公有的,可以在类的内部.外部.子类中使用 私有的:定义是在前面加两个'_',只能在本类的内部使用,不能再外部及子类中使用 示例: class P ...