当前位置:网站首页>单臂路由和三层交换的简单配置
单臂路由和三层交换的简单配置
2022-07-07 16:36:00 【陈叉叉__】

首先对交换机进行配置
将f0/1端口只允许vlan 10,f0/11端口只允许vlan 20,将f0/24端口设为truck模式
int f0/1
switchport mode access
switchport access vlan 10
exi
int f0/11
switchport mode access
switchport access vlan 20
exit
int f0/24
switchport mode trunk
switchport trunk allowed vlan all
在路由器上进行单臂路由配置
int f0/0
int f0/0.10 #进入子接口
encapsulation dot1Q 10 #进行封装802.1q协议,打上vlan 10的标签
ip add 192.168.10.254 255.255.255.0 #配置valn 10的网关
int f0/0.20
encapsulation dot1Q 20 #进行封装802.1q协议,打上vlan 20的标签
ip add 192.168.20.254 255.255.255.0 #配置vlan 20的网关
这时两台主机成功通信。
配置三层交换

首先配置二层交换机
将f0/1端口只允许vlan 10,f0/11端口只允许vlan 20,将f0/24端口启用trunk模式
int f0/1
switchport mode access
switch access vlan 10
int f0/11
switchport mode access
switch access vlan 20
int f0/24
switchport mode trunk
switch trunk allowed vlan all
接着配置三层交换机
ip routing #开启路由功能
int f0/1
switchport trunk encapsulation dot1q #封装dot1q协议,这里不指定vlan号
switchport trunk allowed vlan all #允许所有vlan通过
exit
int vlan 10
ip add 192.168.10.254 255.255.255.0 #设置vlan 10的网关
int vlan 20
ip add 192.168.20.254 255.255.255.0 #设置vlan 20 的网关
以上给基本命令配置完成。
边栏推荐
- 清华、剑桥、UIC联合推出首个中文事实核查数据集:基于证据、涵盖医疗社会等多个领域
- 4种常见的缓存模式,你都知道吗?
- How to clean when win11 C disk is full? Win11 method of cleaning C disk
- C语言中匿名的最高境界
- Main work of digital transformation
- Chapter 3 business function development (user login)
- Mobile pixel bird game JS play code
- Backup Alibaba cloud instance OSS browser
- Tips of this week 141: pay attention to implicit conversion to bool
- 数学分析_笔记_第11章:Fourier级数
猜你喜欢

Understanding of 12 methods of enterprise management

回归问题的评价指标和重要知识点总结

Improve application security through nonce field of play integrity API

Backup Alibaba cloud instance OSS browser

Chapter 2 building CRM project development environment (building development environment)

zdog. JS rocket turn animation JS special effects

讨论| 坦白局,工业 AR 应用为什么难落地?
![Easy to understand [linear regression of machine learning]](/img/db/f300457165de7ab12aefac8842330f.jpg)
Easy to understand [linear regression of machine learning]

ICer知识点杂烩(后附大量题目,持续更新中)

4种常见的缓存模式,你都知道吗?
随机推荐
【C语言】字符串函数
财富证券证券怎么开户?通过链接办理股票开户安全吗
持续测试(CT)实战经验分享
Run Yolo v5-5.0 and report an error. If the sppf error cannot be found, solve it
用存储过程、定时器、触发器来解决数据分析问题
SQLite SQL exception near "with": syntax error
go语言的字符串类型、常量类型和容器类型
What skills can you master to be a "master tester" when doing software testing?
行业案例|数字化经营底座助力寿险行业转型
socket編程之常用api介紹與socket、select、poll、epoll高並發服務器模型代碼實現
Chapter 3 business function development (safe exit)
Afghan interim government security forces launched military operations against a hideout of the extremist organization "Islamic state"
Kirk Borne的本周学习资源精选【点击标题直接下载】
云安全日报220707:思科Expressway系列和网真视频通信服务器发现远程攻击漏洞,需要尽快升级
『HarmonyOS』DevEco的下载安装与开发环境搭建
[PaddleSeg源码阅读] PaddleSeg Validation 中添加 Boundary IoU的计算(1)——val.py文件细节提示
PIP related commands
【蓝桥杯集训100题】scratch从小到大排序 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第17题
[论文分享] Where’s Crypto?
Mui side navigation anchor positioning JS special effect