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)

相关推荐
lly2024068 分钟前
C++ 文件和流
开发语言
m0_7066532313 分钟前
分布式系统安全通信
开发语言·c++·算法
Zach_yuan29 分钟前
深入浅出 JSONCpp
linux·服务器·网络·c++
寻寻觅觅☆1 小时前
东华OJ-基础题-104-A == B ?(C++)
开发语言·c++
马猴烧酒.1 小时前
【面试八股|JAVA多线程】JAVA多线程常考面试题详解
java·服务器·数据库
lightqjx1 小时前
【C++】unordered系列的封装
开发语言·c++·stl·unordered系列
zh_xuan1 小时前
kotlin lazy委托异常时执行流程
开发语言·kotlin
ServBay1 小时前
一个下午,一台电脑,终结你 90% 的 Symfony 重复劳动
后端·php·symfony
阿猿收手吧!1 小时前
【C++】string_view:高效字符串处理指南
开发语言·c++
熊延2 小时前
麒麟V10系统安装部署elasticsearch
linux·运维·服务器·elasticsearch·搜索引擎·全文检索