博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
三层交换
阅读量:6966 次
发布时间:2019-06-27

本文共 2949 字,大约阅读时间需要 9 分钟。

sw1(config)#int f0/0 #进接口

sw1(config-if)#ip add 12.0.0.1 255.255.255.0 #配置IP地址子网掩码网段
sw1(config-if)#no shut #开启端口

sw1(config-if)#int f1/0

sw1(config-if)#sw mo t
sw1(config-if)#sw t en dot1q
sw1(config-if)#ex
三层交换技术就是:二层交换技术+三层转发技术。它解决了局域网中网段划分之后,网段中子网必须依赖路由器进行管理的局面,解决了传统路由器低速、复杂所造成的网络瓶颈问题。

sw1(config)#vlan 10,20 #添加VLAN 10,20

sw1(config)#int vlan 10 #进VLAN10 虚拟接口
sw1(config-if)#ip add 192.168.11.1 255.255.255.0 #给VLAN10配置IP地址子网掩码
sw1(config-if)#no shut #开启虚拟端口
sw1(config-if)#int vlan 20
sw1(config-if)#ip add 192.168.12.1 255.255.255.0
sw1(config-if)#no shut
sw1(config-if)#ex
sw1(config)#do show ip int b

sw1(config)#do show ip int b #查看 端口 详细

Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 12.0.0.1 YES manual up up

Vlan10 192.168.11.1 YES manual up up

Vlan20 192.168.12.1 YES manual up up

sw1(config)#vtp do abc #创一个vtp 名称为abc

sw1(config)#vtp mo ser #服务器模Server 学习,转发,添加,删除,修改
sw1(config)#vtp version 2 #配置VTP版本
sw1(config)#vtp vtp pruning #配置VTP修剪
sw1(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2 # 配置默认路由
sw1(config)#do show ip rout # 查看路由表
C 192.168.12.0/24 is directly connected, Vlan20
C 192.168.11.0/24 is directly connected, Vlan10
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 12.0.0.2


sw2(config)#no ip routing

sw2(config)#vtp do abc
sw2(config)#vtp version 2
sw2(config)#vtp pruning
sw2(config)#int f1/1
sw2(config-if)#sw mo acc
sw2(config-if)#sw acc vlan 10
sw2(config-if)#int f1/2
sw2(config-if)#sw mo acc
sw2(config-if)#sw acc vlan 20
sw2(config)#do show vlan-sw d
VLAN Name Status Ports


1 default active Fa1/3, Fa1/4, Fa1/5, Fa1/6

Fa1/7, Fa1/8, Fa1/9, Fa1/10
Fa1/11, Fa1/12, Fa1/13, Fa1/14
Fa1/15
10 VLAN0010 active Fa1/1
20 VLAN0020 active Fa1/2
1002 fddi-default act/unsup
1003 trcrf-default act/unsup
1004 fddinet-default act/unsup
1005 trbrf-default act/unsup


R3(config)#int f0/1

R3(config-if)#ip add 192.168.8.1 255.255.255.0
R3(config-if)#no shut
R3(config)#int f0/0
R3(config-if)#ip add 12.0.0.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#ip route 192.168.11.0 255.255.255.0 12.0.0.1 #实现互联互通 因为在非直连网网段上要配置目的地网段下一跳网段
R3(config)#ip route 192.168.12.0 255.255.255.0 12.0.0.1
R3(config)#do show ip rout
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

S 192.168.12.0/24 [1/0] via 12.0.0.1

C 192.168.8.0/24 is directly connected, FastEthernet0/1
S 192.168.11.0/24 [1/0] via 12.0.0.1
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet0/0三层交换

转载于:https://blog.51cto.com/13660858/2113258

你可能感兴趣的文章
我的友情链接
查看>>
用css3制作旋转加载动画的几种方法
查看>>
应用系统中常见报表类型解析
查看>>
SpringBoot初级教程
查看>>
用tarball实现liferay自动安装部署7-根据dnsdomainname判断节点环境
查看>>
WebDriver的全局隐式等待
查看>>
JPDA 架构研究8 - Agent利用环境指针访问VM(堆栈管理篇)
查看>>
干货|可视化设计:百度地图路线
查看>>
cdh5 HA涉及的JournalNodes介绍
查看>>
ShaderLab开发实战——Cg语言简介
查看>>
Zookeeper安装
查看>>
学习计划
查看>>
linux中在当前目录下找出占用空间最大的前10大文件
查看>>
ssl免费证书(未测试)
查看>>
使用postman调试接口时发现的session问题
查看>>
vue高级组件之路由权限组件
查看>>
mysql数据结构与算法(二分查找法及二叉查找树)
查看>>
vue 刷新或者加载闪烁
查看>>
代码签名证书过期,Mozilla数百万Firefox用户遭遇扩展禁用
查看>>
spring batch +boot
查看>>