当前位置:网站首页>VLAN 实验
VLAN 实验
2022-08-03 12:46:00 【橘子爱吃橘子】
一、实验要求
思路:
二、创建VLAN
lsw1:
[lsw1]vlan batch 2 to 6---批量创建VLAN
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw1]
lw2:
[lsw2]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw2]
lsw3:
[lsw3]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw3]
三、将接口划入VLAN
lsw1:
[lsw1]int g 0/0/1
[lsw1-GigabitEthernet0/0/1]port link-type access----接口类型为access类型
[lsw1-GigabitEthernet0/0/1]port default vlan 2----接口划入VLAN 2
[lsw1-GigabitEthernet0/0/1]
[lsw1-GigabitEthernet0/0/1]int g 0/0/2
[lsw1-GigabitEthernet0/0/2]port link-type hybrid ----使用混杂模式
[lsw1-GigabitEthernet0/0/2]port hybrid pvid vlan 3 ---将接口划入VLAN 3
[lsw1-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 5 6----3、4、5、6不带标签,
[lsw1-GigabitEthernet0/0/2]
[lsw1-GigabitEthernet0/0/2]int g 0/0/3
[lsw1-GigabitEthernet0/0/3]port link-type trunk ---使用trunk接口
[lsw1-GigabitEthernet0/0/3]port trunk allow-pass vlan all ---允许所有的VLAN通过
[lsw1-GigabitEthernet0/0/3]
[lsw1-GigabitEthernet0/0/3]int g 0/0/4
[lsw1-GigabitEthernet0/0/4]port link-type hybrid
[lsw1-GigabitEthernet0/0/4]port hybrid tagged vlan 2----VLAN 2 带上标签
[lsw1-GigabitEthernet0/0/4]port hybrid untagged vlan 3 4 5 6
[lsw1-GigabitEthernet0/0/4]
lsw2:
[lsw2]int g 0/0/1
[lsw2-GigabitEthernet0/0/1]port link-type access
[lsw2-GigabitEthernet0/0/1]port default vlan 2
[lsw2-GigabitEthernet0/0/1]
[lsw2]int g 0/0/1
[lsw2-GigabitEthernet0/0/1]port link-type access
[lsw2-GigabitEthernet0/0/1]port default vlan 2
[lsw2-GigabitEthernet0/0/1]int g 0/0/2
[lsw2-GigabitEthernet0/0/2]port link-type hybrid
[lsw2-GigabitEthernet0/0/2]port hybrid pvid vlan 4
[lsw2-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 5
[lsw2-GigabitEthernet0/0/2]int g 0/0/3
[lsw2-GigabitEthernet0/0/3]port link-type trunk
[lsw2-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[lsw2-GigabitEthernet0/0/3]
[lsw2]int g 0/0/4
[lsw2-GigabitEthernet0/0/4]port link-type trunk
[lsw2-GigabitEthernet0/0/4]port trunk allow-pass vlan all
[lsw2-GigabitEthernet0/0/4]
lsw3:
[lsw3]int g 0/0/1
[lsw3-GigabitEthernet0/0/1]port link-type hybrid
[lsw3-GigabitEthernet0/0/1]port hybrid pvid vlan 5
[lsw3-GigabitEthernet0/0/1]port hybrid untagged vlan 3 4 5
[lsw3-GigabitEthernet0/0/1]
[lsw3-GigabitEthernet0/0/1]int g 0/0/2
[lsw3-GigabitEthernet0/0/2]port link-type hybrid
[lsw3-GigabitEthernet0/0/2]port hybrid pvid vlan 6
[lsw3-GigabitEthernet0/0/2]port hybrid untagged vlan 3 6
[lsw3-GigabitEthernet0/0/2]
[lsw3-GigabitEthernet0/0/2]int g 0/0/3
[lsw3-GigabitEthernet0/0/3]port link-type trunk
[lsw3-GigabitEthernet0/0/3]port trunk allow-pass vlan all
R1:
[r1]int g 0/0/0.1----创建子接口
[r1-GigabitEthernet0/0/0.1]ip address 192.168.1.1 24
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2---划入VLAN 2 的范围
[r1-GigabitEthernet0/0/0.1]arp broadcast enable ----开启广播
[r1-GigabitEthernet0/0/0.1]
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.2.1 24
四、通过DHCP获取IP地址
[r1]dhcp enable ----开启DHCP
[r1]ip pool aa---创建aa的地址池
[r1-ip-pool-aa]network 192.168.1.0 mask 24
[r1-ip-pool-aa]gateway-list 192.168.1.1
[r1-ip-pool-aa]dns-list 114.114.114.114
[r1-ip-pool-aa]
[r1-ip-pool-aa]q
[r1]ip pool bb
[r1-ip-pool-bb]network 192.168.2.0 mask 24
[r1-ip-pool-bb]gateway-list 192.168.2.1
[r1-ip-pool-bb]dns-list 114.114.114.114
[r1]int g 0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global ----开启全局模式
[r1-GigabitEthernet0/0/0.1]q
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global
点击DHCP,选择应用
:
五、ping结果检测
PC1访问PC2/3/4/5/6
PC2访问PC4/5/6
PC3访问PC2/1/4/5/6
PC4可以访问PC5,但是不能访问PC6
PC5不能访问PC6
边栏推荐
猜你喜欢
随机推荐
setTimeout 、setInterval、requestAnimationFrame
In order to counteract the drop in sales and explore the low-end market, Weilai's new brand products are priced as low as 100,000?
An introduction to basic tools for selecting line tools (package church)
基于php志愿者服务平台管理系统获取(php毕业设计)
基于php旅游网站管理系统获取(php毕业设计)
How can I get a city's year-round weather data for free?Precipitation, temperature, humidity, solar radiation, etc.
7月份最后一篇博客
R language ggplot2 visualization: use the patchwork bag plot_layout function will be more visual image together, ncol parameter specifies the number of rows, specify byrow parameters configuration dia
秋招招工作
汉源高科G8032标准ERPS环网交换机千兆4光10电工业以太网交换机环网+WEB管理+SNMP划VLAN
Use %Status value
欧曼自动挡、银河大马力、行星新产品 欧曼全新产品以燎原之势赢领市场
2022 年 CISO 最关心的是什么?
层次分析法
Mysql重启后innodb和myisam插入的主键id变化总结
可视化图表设计Cookbook
Redis连接池工具类
Feature dimensionality reduction study notes (pca and lda) (1)
使用工作队列管理器(三)
什么是分布式锁?几种分布式锁分别是怎么实现的?