前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >思科 配置VLAN与3层交换

思科 配置VLAN与3层交换

作者头像
py3study
发布2020-01-14 14:54:22
5360
发布2020-01-14 14:54:22
举报
文章被收录于专栏:python3
代码语言:javascript
复制
enable   //特权模式  ^Z可回特权
config t  //配置模式
no ip domain-lookup //关闭域名解析
(config-line)#exec-timeout 0 0                // 设置超时时间为永不超时
(config-line)#exit                           // 退出
(config)#line vty 0 15                       // 进入VTY口
(config-line)#password cisco                  //设置VTY密码
#copy running-config startup-config #保存设置
##Cisco3550---------------------------------------------
(config)# hostname 3550    //改名
(config)# enable secret 654321   //交换机加密密码
3550(config)# interface f0/24
3550(config-if)# switchport mode chunk  //配置为trunk模式
3550(config)#vtp domain dywer           //域名 很关键
3550(config)#vtp mode server                //设置vtp模式为Server
3550(config)#vtp password 123456             //设置通信密码
3550(config)# vlan 11   //创建VLAN
3550(config-vlan)# name sales
3550(config)# vlan 12
3550(config-vlan)# name sales
3550(config)#interface vlan 1       //传送vtp,与默认管理使用 
3550(config-if)#no shut                //启动vlan1
3550(config-if)#switchport trunk encapsulation  dot1q  //配置VTP,也可能没有此命令 
^Z

#三层交换---------------------------------------------
3550(config)#interface vlan 10
3550(config-if)#ip address 172.16.10.1 255.255.255.0
3550(config)#interface vlan 11
3550(config-if)#ip address 172.16.11.1 255.255.255.0
3550(config)#interface vlan 12
3550(config-if)#ip address 172.16.12.1 255.255.255.0
#把各VLAN中机器的默认网关设为该对应VLAN接口地址,便可以互访了。
3550(config)#ip routing   #开启VLAN间路由
3550# copy r s   //保存设置
##Cisco2950---------------------------------------------
switch(config)# hostname 2950  //改名
(config)# enable secret 654321   //交换机加密密码
2950(config)# interface f0/24
2950(config-if)# switchport mode chunk //配置为trunk模式
2950(config)#vtp domain dywer           //设置域
2950(config)#vtp mode client                //设置vtp模式为Client
2950(config)#vtp password 123456             //设置通信密码
2950#show vlan [brief]   //查看VLAN是否正常
2950(config)# interface f0/1   //分配VLAN端口   
2950(config-if)# switchport access vlan 11  
2950(config)# interface range f0/10 -20   //范围分配
2950(config-if-range)#switchport access vlan 12
2950(config-if)switchport trunk allowed vlan all
2950# copy r s   //保存设置
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019/07/15 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档