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)

相关推荐
꒰ঌ 安卓开发໒꒱31 分钟前
Java 面试 -Java基础
java·开发语言·面试
不枯石3 小时前
Matlab通过GUI实现点云的最远点下采样(Farthest point sampling)
开发语言·图像处理·算法·计算机视觉·matlab
冠希陈、3 小时前
云锁客户端连不上服务器处理
linux·运维·服务器
似水এ᭄往昔3 小时前
【Linux】--入门、基础命令
linux·服务器
做运维的阿瑞3 小时前
Linux 企业级备份体系实战:cron/anacron/restic/rclone 对比与脚本总结
linux·运维·服务器·后端·学习·系统架构·centos
wanhengidc4 小时前
BGP高防服务器具体是指什么
运维·服务器·网络·安全·游戏·智能手机
2301_767902644 小时前
10. Linux 系统启动原理
linux·运维·服务器
☆璇4 小时前
【Linux】Ext系列文件系统(下)
linux·运维·服务器
crackpot·4 小时前
Linux 命令
linux·运维·服务器
ProgrammerPulse4 小时前
告别“硬件绑定”困局:青云云易捷如何让异构服务器“物尽其用”
服务器