ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

三层交换机

2022-09-13 00:31:01  阅读:185  来源: 互联网

标签:g0 int vlan 192.168 交换机 三层 type port


一、单臂路由

1.1概念

单臂路由实现不同vlan之间通信

1.2链路类型

access链路:交换机连接主机的端口

trunk链路:交换机连接路由器的端口

hybrid链路:华为

1.3子接口

路由的物理接口可以被划分为多个逻辑接口

每个子接口对应一个vlan网段的网关

 1.4单臂路由的配置

(1)配置链路类型

(2)配置vlan标签的封装结构

(3)配置子接口地址

1.5例题

例题1:

实验结果:

代码:

例题2:

实验结果:

实验代码:

SW1:

vlan batch 10 20

port-group 1

group-member g0/0/1 to g0/0/2

port link-type access

port default vlan 10

q

port-group 2

group-member g0/0/3 to g0/0/4

port link-type access

port default vlan 20

q

port-group 3

group-member g0/0/5 to g0/0/6

port link-type trunk

port trunk allow-pass vlan all

SW2:

vlan batch 10 20

int g0/0/1

port link-type trunk

port trunk allow-pass vlan all

int g0/0/2

port link-type access

port default vlan 10

int g0/0/3

port link-type access

port default vlan 20

AR1:

int g0/0/0.10

dotlq termination vid 10

ip add 192.168.10.1 24

arp broadcast enable

int g0/0/0.20

dotlq termination vid 120

ip add 192.168.20.1 24

arp broadcast enable

二、三层交换(选型失败使用)

2.1三层交换技术

使用三层交换技术实现vlan间通讯

三层交换=二层交换+三层转发

2.2三层交换机实现vlan间通信

2.3例子

实验结果:

实验代码:

SW1:

vlan batch 10 20 30

int e0/0/1

port link-type access

port default vlan 10

int e0/0/2

port link-type access

port default vlan 20

int e0/0/3

port link-type access

port default vlan 30

int e0/0/4

port link-type trunk

port trunk allow-pass vlan all

SW2:

vlan batch 10 20 30

int Vlanif 10

ip add 192.168.1.254 24

int Vlanif 20

ip add 192.168.2.254 24

int Vlanif 30

ip add 192.168.3.254 24

int Vlanif 100

ip add 192.168.4.1 24

int g0/0/1

port link-type trunk

port trunk allow-pass vlan all

int g0/0/2

port link-type access

port default vlan 100

q

ip route-static 192.168.5.0 24 192.168.4.2

AR1:

int g0/0/0

ip add 192.168.4.2 24

int g0/0/1

ip add 192.168.5.254

q

ip route-static 192.168.1.0 24 192.168.4.1

ip route-static 192.168.2.0 24 192.168.4.1

ip route-static 192.168.3.0 24 192.168.4.1  

 

标签:g0,int,vlan,192.168,交换机,三层,type,port
来源: https://www.cnblogs.com/feizirui/p/16687811.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有