当前位置:网站首页>单臂路由和三层交换的简单配置
单臂路由和三层交换的简单配置
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 的网关
以上给基本命令配置完成。
边栏推荐
- 数学分析_笔记_第11章:Fourier级数
- SD_DATA_SEND_SHIFT_REGISTER
- < code random recording two brushes> linked list
- 万字保姆级长文——Linkedin元数据管理平台Datahub离线安装指南
- Idea completely uninstalls installation and configuration notes
- Discuss | frankly, why is it difficult to implement industrial AR applications?
- Learn to make dynamic line chart in 3 minutes!
- 嵌入式C语言程序调试和宏使用的技巧
- AI 击败了人类,设计了更好的经济机制
- go语言的字符串类型、常量类型和容器类型
猜你喜欢
科学家首次观察到“电子漩涡” 有助于设计出更高效的电子产品
Introduction de l'API commune de programmation de socket et mise en œuvre de socket, select, Poll et epoll
Easy to understand [linear regression of machine learning]
用存储过程、定时器、触发器来解决数据分析问题
Mobile app takeout ordering personal center page
Chapter 2 building CRM project development environment (building development environment)
备份阿里云实例-oss-browser
C语言中匿名的最高境界
[deep learning] 3 minutes introduction
[principle and technology of network attack and Defense] Chapter 6: Trojan horse
随机推荐
低代码助力企业数字化转型会让程序员失业?
SD_DATA_RECEIVE_SHIFT_REGISTER
Tips for this week 131: special member functions and ` = Default`
Chapter 2 build CRM project development environment (database design)
Native JS verification code
Ten thousand words nanny level long article -- offline installation guide for datahub of LinkedIn metadata management platform
Afghan interim government security forces launched military operations against a hideout of the extremist organization "Islamic state"
Discuss | frankly, why is it difficult to implement industrial AR applications?
云景网络科技面试题【杭州多测师】【杭州多测师_王sir】
Classification of regression tests
Introduction de l'API commune de programmation de socket et mise en œuvre de socket, select, Poll et epoll
强化学习-学习笔记8 | Q-learning
清华、剑桥、UIC联合推出首个中文事实核查数据集:基于证据、涵盖医疗社会等多个领域
[principles and technologies of network attack and Defense] Chapter 3: network reconnaissance technology
[tpm2.0 principle and Application guide] Chapter 5, 7 and 8
Is it safe to open an online futures account now? How many regular futures companies are there in China?
直播软件搭建,canvas文字加粗
Machine vision (1) - Overview
Sanxian Guidong JS game source code
嵌入式C语言程序调试和宏使用的技巧