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)

相关推荐
qq_53756267几秒前
跨语言调用C++接口
开发语言·c++·算法
Genie cloud10 分钟前
1Panel SSL证书申请完整教程
服务器·网络协议·云计算·ssl
wjs202411 分钟前
DOM CDATA
开发语言
Tingjct13 分钟前
【初阶数据结构-二叉树】
c语言·开发语言·数据结构·算法
猷咪39 分钟前
C++基础
开发语言·c++
!chen40 分钟前
linux服务器静默安装Oracle26ai
linux·运维·服务器
IT·小灰灰40 分钟前
30行PHP,利用硅基流动API,网页客服瞬间上线
开发语言·人工智能·aigc·php
快点好好学习吧42 分钟前
phpize 依赖 php-config 获取 PHP 信息的庖丁解牛
android·开发语言·php
秦老师Q43 分钟前
php入门教程(超详细,一篇就够了!!!)
开发语言·mysql·php·db
烟锁池塘柳043 分钟前
解决Google Scholar “We‘re sorry... but your computer or network may be sending automated queries.”的问题
开发语言