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)

相关推荐
Morwit2 分钟前
Qt qml创建c++类的单例对象
开发语言·c++·qt
June`2 分钟前
IO模型全解析:从阻塞到异步(高并发的reactor模型)
linux·服务器·网络·c++
古城小栈5 分钟前
Rust 已经自举,却仍需GNU与MSVC工具链的缘由
开发语言·rust
AI_56789 分钟前
零基础学Linux:21天从“命令小白”到独立部署服务器
linux·服务器·人工智能·github
jarreyer9 分钟前
数据项目分析标准化流程
开发语言·python·机器学习
你怎么知道我是队长12 分钟前
C语言---printf函数使用详细说明
c语言·开发语言
weixin_4462608514 分钟前
XPipe: 轻松访问你的服务器基础设施 [特殊字符]
运维·服务器
liulilittle14 分钟前
俄罗斯访问欧洲国际线路优化
开发语言·网络·信息与通信·ip·通信·俄罗斯·莫斯科
TTGGGFF15 分钟前
GLM-4V-9B 视觉多模态模型本地部署教程【保姆级教程】
linux·运维·服务器·图文对话
陈小桔17 分钟前
logging模块-python
开发语言·python