VLAN实验

一、实验拓扑

二、实验需求

1、全网可达

2、使用DHCP获取IP地址

三、实验思路

1、划分地址、进行地址配置

2、vlan配置:

划分vlan;

更改接口的链路类型,将相应的接口加入vlan;

在trunk链路上放行网络中的vlan

3、配置子接口

4、DHCP配置

四、实验步骤

1、创建vlan

SW1\]vlan 2 \[SW1-vlan2\]vlan 3 \[SW2\]vlan 2 \[SW2-vlan2\]vlan 3 \[SW3\]vlan 2 \[SW3-vlan2\]vlan 3 2、接口加入相应vlan,配置trunk链路,精确放行相应VLAN \[SW1\]int e0/0/2 \[SW1-Ethernet0/0/2\]port link-type access \[SW1-Ethernet0/0/2\]port default vlan 2 \[SW1-Ethernet0/0/2\]int e0/0/3 \[SW1-Ethernet0/0/3\]port link-type access \[SW1-Ethernet0/0/3\]port default vlan 3 \[SW1-Ethernet0/0/3\]int e0/0/1 \[SW1-Ethernet0/0/1\]port link-type trunk \[SW1-Ethernet0/0/1\]port trunk allow-pass vlan 2 3 \[SW2\]int e0/0/3 \[SW2-Ethernet0/0/3\]port link-type access \[SW2-Ethernet0/0/3\]port default vlan 2 \[SW2-Ethernet0/0/3\]int e0/0/4 \[SW2-Ethernet0/0/4\]port link-type access \[SW2-Ethernet0/0/4\]port default vlan 3 \[SW2-Ethernet0/0/4\]int e0/0/2 \[SW2-Ethernet0/0/2\]port link-type trunk \[SW2-Ethernet0/0/2\]port trunk allow-pass vlan 2 3 \[SW2\]int e0/0/1 \[SW2-Ethernet0/0/1\]port link-type trunk \[SW2-Ethernet0/0/1\]port trunk allow-pass vlan 2 3 \[SW3\]int e0/0/2 \[SW3-Ethernet0/0/2\]port link-type access \[SW3-Ethernet0/0/2\]port default vlan 2 \[SW3-Ethernet0/0/2\]int e0/0/3 \[SW3-Ethernet0/0/3\]port link-type access \[SW3-Ethernet0/0/3\]port default vlan 3 \[SW3-Ethernet0/0/3\]int e0/0/1 \[SW3-Ethernet0/0/1\]port link-type trunk \[SW3-Ethernet0/0/1\]port trunk allow-pass vlan 2 3 ![](https://i-blog.csdnimg.cn/direct/1ee1420ae0634602804aff5cabb964cb.png) ![](https://i-blog.csdnimg.cn/direct/f746817e43d84a10b89be53ec2a340a7.png) ![](https://i-blog.csdnimg.cn/direct/a31ef7577ac74b709aca7b179486b7c2.png) 3、在路由器上配置路由信息或者子接口信息,实现全网通 \[R1\]int g0/0/0.2 \[R1-GigabitEthernet0/0/0.2\]ip a 192.168.1.254 24 \[R1-GigabitEthernet0/0/0.2\]dot1q termination vid 2 \[R1-GigabitEthernet0/0/0.2\]arp broadcast enable \[R1\]int g0/0/0.3 \[R1-GigabitEthernet0/0/0.3\]ip a 192.168.2.254 24 \[R1-GigabitEthernet0/0/0.3\]dot1q termination vid 3 \[R1-GigabitEthernet0/0/0.3\]arp broadcast enable \[R1\]int g0/0/1.2 \[R1-GigabitEthernet0/0/1.2\]ip a 192.168.3.254 24 \[R1-GigabitEthernet0/0/1.2\]dot1q termination vid 2 \[R1-GigabitEthernet0/0/1.2\]arp broadcast enable \[R1\]int g0/0/1.3 \[R1-GigabitEthernet0/0/1.3\]ip a 192.168.4.254 24 \[R1-GigabitEthernet0/0/1.3\]dot1q termination vid 3 \[R1-GigabitEthernet0/0/1.3\]arp broadcast enable ![](https://i-blog.csdnimg.cn/direct/85f4aa5c8fa24193aa77dde030d00f56.png) 4、DHCP配置 \[R1\]dhcp enable \[R1\]ip pool aa \[R1-ip-pool-aa\]net 192.168.1.0 mask 24 \[R1-ip-pool-aa\]gateway-list 192.168.1.254 \[R1-ip-pool-aa\]dns-list 114.114.114.114 8.8.8.8 \[R1\]int g0/0/0.2 \[R1-GigabitEthernet0/0/0.2\]dhcp select global \[R1\]ip pool bb \[R1-ip-pool-bb\]net 192.168.2.0 mask 24 \[R1-ip-pool-bb\]gateway-list 192.168.2.254 \[R1-ip-pool-bb\]dns-list 114.114.114.114 8.8.8.8 \[R1\]int g0/0/0.3 \[R1-GigabitEthernet0/0/0.3\]dhcp select global \[R1\]ip pool cc \[R1-ip-pool-cc\]net 192.168.3.0 mask 24 \[R1-ip-pool-cc\]gateway-list 192.168.3.254 \[R1-ip-pool-cc\]dns-list 114.114.114.114 8.8.8.8 \[R1\]int g0/0/1.2 \[R1-GigabitEthernet0/0/1.2\]dhcp select global \[R1\]ip pool dd \[R1-ip-pool-dd\]net 192.168.4.0 mask 24 \[R1-ip-pool-dd\]gateway-list 192.168.4.254 \[R1-ip-pool-dd\]dns-list 114.114.114.114 8.8.8.8 \[R1\]int g0/0/1.3 \[R1-GigabitEthernet0/0/1.3\]dhcp select global ![](https://i-blog.csdnimg.cn/direct/4fdb2eb7f2af4effa5da2215c735022d.png) ![](https://i-blog.csdnimg.cn/direct/fda1bddc382e47e59662e62a07d1662a.png) ![](https://i-blog.csdnimg.cn/direct/d8b2662c30c44bf195eb50f298d148f9.png) ![](https://i-blog.csdnimg.cn/direct/c48d66dc52454d31bf6dfd8deb1a6823.png) 实现全网通 ![](https://i-blog.csdnimg.cn/direct/5c4ca66da0a24769be64b29d87ffa096.png) ![](https://i-blog.csdnimg.cn/direct/bcda4aa006f843fba8a9f580850e1fdc.png) ![](https://i-blog.csdnimg.cn/direct/5b92e2d6af284e8797d2c5e7f478949a.png) ![](https://i-blog.csdnimg.cn/direct/16a099778197432ab3e84d6de2e040af.png) ![](https://i-blog.csdnimg.cn/direct/164353ced1114606bc466ec5ab552418.png)

相关推荐
技术净胜2 分钟前
MATLAB数据清洗流程包含:缺失值处理/异常值检测/重复值删除
开发语言·matlab
SmoothSailingT3 分钟前
C#——textBox控件(1)
开发语言·c#
TG:@yunlaoda360 云老大5 分钟前
华为云国际站代理商DSS的跨区域备份与恢复具体是如何实现的?
运维·服务器·华为云
Ccjf酷儿11 分钟前
计算机网络 (郑烇) 2 应用层
运维·服务器·计算机网络
云老大TG:@yunlaoda36012 分钟前
如何通过华为云国际站代理商OBS实现数据跨境传输与分发加速?
数据库·华为云·php
悦悦子a啊15 分钟前
使用 Java 集合类中的 LinkedList 模拟栈以此判断字符串是否是回文
java·开发语言
寰天柚子15 分钟前
服务器性能优化实战:从资源瓶颈定位到极致调优(附租赁服务器适配指南)
运维·服务器·udp
Lucky小小吴17 分钟前
java代码审计入门篇——Hello-Java-Sec(完结)
java·开发语言
未来之窗软件服务21 分钟前
服务器运维(十九)web服务管理Nginx UI介绍——东方仙盟炼气期
运维·服务器·服务器运维·东方仙盟
csbysj202024 分钟前
XML 技术
开发语言