简单vlan配置

1.连接拓扑图

2.交换机配置

2.1给每个交换机配置vlan

en

进入配置模式:

conf t

vtp mode server

vtp domain wencell(其他与之相连的交换机都会学习到vlan)

vlan 10 (创建名为10的vlan)

exit

vlan 20

exit

vlan 30

exit

vlan 40

exit

将每个端口加入到VLAN:

int f0/1

switchport access vlan 10

exit

显示vlan 信息:do sh vlan b

2.2给每个交换机的出接口配置:trunk

int range f0/4

switchport mode trunk

exit

如果是多个出接口:

int range f0/3-5

sw m t

exit

3.路由器配置:

3.1 开启三层路由功能

en

conf t

ip routing 开启三层路由功能

no ip routing 关闭三层路由功能

3.2 路由器虚拟接口配置标签(三层路由上才有)

int f0/0.1

r1(config-subif)#encapsulation dot1Q 10

r1(config-subif)#ip add 10.1.1.254 255.255.255.0

r1(config-subif)#no sh

r1(config-subif)#exit

int f0/0.2

r1(config-subif)#encapsulation dot1Q 10

r1(config-subif)#ip add 10.1.1.254 255.255.255.0

r1(config-subif)#no sh

r1(config-subif)#exit

int f0/0.3

r1(config-subif)#encapsulation dot1Q 10

r1(config-subif)#ip add 10.1.1.254 255.255.255.0

r1(config-subif)#no sh

r1(config-subif)#exit

(开启总接口):

r1(config)#int f0/0

r1(config-if)#no sh

r1(config-if)#exit

3.2三层路由器上部署DHCP

conf t (以下命令,直接复制粘贴)

ip dhcp excluded-address 10.1.1.1 10.1.1.99(排除的Ip地址)

ip dhcp pool v10 (地址池的名字是v10)

network 10.1.1.0 255.255.255.0

default-router 10.1.1.254

dns-server 40.1.1.1

ip dhcp excluded-address 20.1.1.1 20.1.1.99

ip dhcp pool v20

network 20.1.1.0 255.255.255.0

default-router 20.1.1.254

dns-server 40.1.1.1

ip dhcp excluded-address 30.1.1.1 30.1.1.99

ip dhcp pool v30

network 30.1.1.0 255.255.255.0

default-router 30.1.1.254

dns-server 40.1.1.1

3.3 查看配置:

r1(config)#do sh run

点击每台pc 可以自动获取ip

3.4删除配置

no ip dhcp excluded-address 10.1.1.1 10.1.1.99

no ip dhcp pool v10

4.路由器不做DHCP,让服务器来做DHCP

4.1 删除配置

no ip dhcp excluded-address 10.1.1.1 10.1.1.99

no ip dhcp excluded-address 20.1.1.1 20.1.1.99

no ip dhcp excluded-address 30.1.1.1 30.1.1.99

no ip dhcp pool v10

no ip dhcp pool v20

no ip dhcp pool v30

(以上命令,直接粘贴复制到en模式下就行)

4.2 服务器配置dhcp

写完每一条后点击添加,不要点保存,最后不要忘了启用

4.3配置DHCP中继

配置dhcp中继,这样不用以广播的形式也能为pc分配ip

在路由器上配置dhcp帮助:

int f0/0.1 (该接口需要被帮助)

ip helper-address DHCP服务器的IP

exit

int f0/0.2 (该接口需要被帮助)

ip helper-address 40.1.1.1

exit

int f0/0.3 (该接口需要被帮助)

ip helper-address 40.1.1.1

exit

5.Vtp:

相关推荐
黑岚樱梦20 分钟前
计算机网络第四章学习
网络·学习·计算机网络
微小冷20 分钟前
ARP协议详解及其Wireshark抓包测试
网络·测试工具·wireshark·抓包·tcp/ip协议·arp协议·地址解析协议
RTC老炮43 分钟前
webrtc弱网-RembThrottler类源码分析及算法原理
网络·算法·webrtc
嫄码1 小时前
HTTPS的四次握手过程
服务器·网络·https
真正的醒悟1 小时前
什么是组网架构
网络·架构
TG_yunshuguoji1 小时前
亚马逊云代理商:怎么快速构建高安全区块链应用?
网络·安全·云计算·区块链·aws
喜欢你,还有大家2 小时前
企业安全防护之——防火墙
服务器·网络·安全
滑水滑成滑头2 小时前
**发散创新:探索零信任网络下的安全编程实践**随着信息技术的飞速发展,网络安全问题日益凸显。传统的网络安全防护方式已难以
java·网络·python·安全·web安全
それども2 小时前
HTTP 三次握手最终状态变更的时机
网络·网络协议·http
阎*水2 小时前
虚拟化网络连接与虚拟机嵌套
网络·智能路由器