当前位置:网站首页>单臂路由和三层交换的简单配置
单臂路由和三层交换的简单配置
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 的网关
以上给基本命令配置完成。
边栏推荐
- Datasimba launched wechat applet, and datanuza accepted the test of the whole scene| StartDT Hackathon
- [principles and technologies of network attack and Defense] Chapter 3: network reconnaissance technology
- Summary of debian10 system problems
- 同消费互联网的较为短暂的产业链不同,产业互联网的产业链是相当漫长的
- The report of the state of world food security and nutrition was released: the number of hungry people in the world increased to 828million in 2021
- List selection JS effect with animation
- 3分钟学会制作动态折线图!
- Wireshark analyzes packet capture data * cap
- Chapter 3 business function development (to remember account and password)
- 【C语言】字符串函数
猜你喜欢
[deep learning] 3 minutes introduction
debian10系统问题总结
[paper sharing] where's crypto?
AI defeated mankind and designed a better economic mechanism
Skills of embedded C language program debugging and macro use
低代码助力企业数字化转型会让程序员失业?
Idea completely uninstalls installation and configuration notes
小程序中实现付款功能
Improve application security through nonce field of play integrity API
[4500 word summary] a complete set of skills that a software testing engineer needs to master
随机推荐
海量数据去重的hash,bitmap与布隆过滤器Bloom Filter
What is the general yield of financial products in 2022?
String type, constant type and container type of go language
Interviewer: why is the page too laggy and how to solve it? [test interview question sharing]
清华、剑桥、UIC联合推出首个中文事实核查数据集:基于证据、涵盖医疗社会等多个领域
Backup Alibaba cloud instance OSS browser
4种常见的缓存模式,你都知道吗?
Understanding of 12 methods of enterprise management
Improve application security through nonce field of play integrity API
Test for 3 months, successful entry "byte", my interview experience summary
Run Yolo v5-5.0 and report an error. If the sppf error cannot be found, solve it
Tips of this week 141: pay attention to implicit conversion to bool
五种网络IO模型
备份阿里云实例-oss-browser
体总:安全有序恢复线下体育赛事,力争做到国内赛事应办尽办
[tpm2.0 principle and Application guide] Chapter 5, 7 and 8
Tips of this week 135: test the contract instead of implementation
Chapter 3 business function development (user access project)
Easy to understand [linear regression of machine learning]
物联网OTA技术介绍