vlan配置

1. 三层交换机实现VLAN间路由-拓扑图

2. 三层交换机实现VLAN间路由-配置文档解释

本案例中,只需要在汇聚交换机(4楼中心机房SW)上进行配置
本案例中,只需要在汇聚交换机(4楼中心机房SW)上进行配置

enable   //从用户模式(>)进入到特权模式(#)

configure terminal  //从特权模式(#)进入到全局配置模式

no logging on   no ip domain-lookup    //禁止DNS解析

hostname 4LouZhongXinJiFangSW  //给这台设备起名字

vlan 20   //进入VLAN配置模式,同时创建VLAN 20

name ZongHeGuanliBu  //给VLAN20起名字,综合管理部

vlan 30     //进入VLAN配置模式,同时创建VLAN 30

name ShiChangBu      //给VLAN30起名字,市场部

vlan 50   //进入VLAN配置模式,同时创建VLAN 50

name JiShuBu  //给VLAN50起名字,技术部

exit     //退出VLAN配置模式

interface vlan 20          //创建虚拟接口/端口,接口/端口名称是vlan 20

ip address 192.168.20.1 255.255.255.0  //给虚拟接口VLAN20配置IP地址

description ZongHeGuanliBu    //描述虚拟接口VLAN20的用途

no shutdown    //开启该虚拟接口

exit            //退出虚拟接口配置模式

interface vlan 30ip address 192.168.30.1 255.255.255.0

description ShiChangBu

no shutdown

exit

interface vlan 50ip address 192.168.50.1 255.255.255.0

description JishuBu

no shutdown

exitinterface fastEthernet 0/1     //进入端口配置模式,具体配置的端口是fa0/1口。

fastethernet快速以太网,百兆,工作在二层,数据链路层。

description ToZGBSwitchFa0/24  //给实体端口fa0/1起个名字

switchport mode access     //端口模式接入口(还有一种是trunk中继口,trunk口允许多个vlan通过,access口和trunk口对应,access只允许某一个vlan通过。)

switchport access vlan 20   //通过该口的数据属于VLAN20,该access口允许vlan 20通过

no shutdown   //开启该端口

exit   //退出端口配置模式

interface fastEthernet 0/2

description ToSCBSwitchFa0/24

switchport mode access

switchport access vlan 30

no shutdown

exit

interface fastEthernet 0/3

description ToJSBSwitchFa0/24

switchport mode access

switchport access vlan 50

no shutdown

exit

exit

write

copy running-config startup-config

3. 三层交换机实现VLAN间路由-配置脚本

enable

configure terminal

no logging on

no ip domain-lookup

hostname HuiJuCisco3560

vlan 20name ZongHeGuanliBu

vlan 30name ShiChangBu

vlan 50name JiShuBuexitinterface

vlan 20ip address 192.168.20.1 255.255.255.0

description ZongHeGuanliBu

no shutdown

exit

interface vlan 30

ip address 192.168.30.1 255.255.255.0

description ShiChangBu

no shutdown

exit

interface vlan 50

ip address 192.168.50.1 255.255.255.0

description JishuBu

no shutdown

exit

interface fastEthernet 0/1

description ToZGBSwitchFa0/24

switchport mode access

switchport access vlan 20

no shutdown

exit

interface fastEthernet 0/2

description ToSCBSwitchFa0/24

switchport mode access

switchport access vlan 30

no shutdown

exit

interface fastEthernet 0/3

description ToJSBSwitchFa0/24

switchport mode access

switchport access vlan 50

no shutdown

exit

ip routing

exit

write

copy running-config startup-config

4. 三层交换机实现VLAN间路由-刷脚本过程展示

  • 22
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

计网1班 孤独的根号三

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值