当前位置:网站首页>单臂路由配置
单臂路由配置
2022-07-17 05:06:00 【dafeng2773】
单臂路由使用场景:
默认情况下,不同的vlan用户之间是不允许相互访问,但是在某些特殊情况下,需要实现不同用户之间的相互,此时就需要用到单臂路由技术;原理是将一个物理接口,划分成多个虚拟子接口,每一个虚拟子接口都可以配置一个地址作为网关。
模拟PC机组网
实验设备:一台交换机,一台路由器,两台主机,搭建一个简单拓扑
1.配置交换机,划分vlan,将F0/1端口属于vlan10,F0/2属于vlan20
//交换机设置access口,并划分子网
Switch(config)#interface f0/1 //进入f0/1端口
Switch(config-if)#switchport mode access //设置端口为access模式
Switch(config-if)#switchport access vlan 10 //将f0/1端口划给vlan10
Switch(config-if)#do show vlan b //查看是否配置成功

可以看到,交换机的F0/1端口划分给了vlan 10,F0/2端口划分给了vlan 20
2.配置PC0和PC1的IP,注意网关



3.配置路由器,配置网口,
打开路由器的接口
Router(config)#interface f0/0
Router(config-if)#no shutdown
单臂路由配置:
1.打开路由器的接口
Router(config)#interface f0/0
Router(config-if)#no shutdown
2。创建虚拟子接口
Router(config-if)#int f0/0.10 //进入f0/0的虚拟子接口
Router(config-subif)#encapsulation dot1Q 10 //给虚拟子接口封装并打上vlan10的标签
Router(config-subif)#ip add 192.168.10.254 255.255.255.0 //配置IP地址
Router(config-subif)#int f0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip add 192.168.20.254 255.255.255.0
3.将交换机连接路由器的端口设置为TRUNK模式。
Switch(config)#int f0/3
Switch(config-if)#switchport mode trunk
4.配置已经完成,测试PC1与PC2的通信是否成功

参考链接:
欢迎转载、收藏、有所收获点赞支持一下!
边栏推荐
- 学习C语言的第6天
- PCA feature dimensionality reduction of machine learning + case practice
- 学习C语言第7天
- 小程序editor富文本编辑使用及rich-text解析富文本
- es6新增-对象部分
- IDL 读取葵花8(Himawari-8)HSD数据
- Class object automatic injection attribute operation tool
- 学习C语言第8天
- Feature extraction of machine learning (digitization and discretization of category features and digitization of text features)
- 【C语言—零基础_学习_复习_第四课】数据类型及其运算
猜你喜欢

Internship project 3- change owner

手把手教你复现Log4j2核弹级漏洞

Pygame:外星人入侵

【LeetCode——编程能力入门第一天】基本数据类型[在区间范围内统计奇数数目/去掉最低工资和最高工资后的工资平均值)

UML(用例图,类图,对象图,包图)

The code of yolov5 model for pest identification in Title A of the 10th Teddy cup data mining challenge (has been run through, original works, continuously updated)

Feature extraction of machine learning (digitization and discretization of category features and digitization of text features)

Use echars to realize water drop, ring, segmentation, stacking, organization chart, map outline and other charts

小程序云开发 上传图片到云存储

PCA feature dimensionality reduction of machine learning + case practice
随机推荐
实习项目3-更改所有者
【Es6】详细解说Set ,Array的常用对象及其他方法(完整版)
获取URL参数的两种方法及location对象的各项获取方式
es6新增-Symbol数据类型
使用js中的(offset,page)实现登录效果
Base64 and file conversion
Pat class B 1002: write this number
STL容器——map的基本操作
Convolutional neural network
IDL调用6S大气校正
Use of flask
Logic of image uploading
Infinite classification
关于New_Online_Judge_1081_哥德巴赫猜想的思考
【C语言—零基础第七课】顺序结构与选择结构
How to upload qiniu cloud
实习项目2-主页配置-我的数据模块
C语言 带你 手撕 通讯录
多功能(实现)封装函数
Three high concurrency methods to realize I++