三层交换机与路由器的配置_实例(图解)

合集下载

三层交换机与路由器对接上网教程

三层交换机与路由器对接上网教程

三层交换机与路由器对接上网教程交换机作为网关,实现跨网段转发。

同时作为DHCP服务器分配IP。

路由器做NAT转换,使用户可以上外网。

下面是小编带来的配置过程:1、配置连接用户的接口和对应的VLANIF接口system-view[Huawei]vlanbatch23[Huawei]interfaceg0/0/2[Huawei-GigabitEther0/0/2]portlink-typeaccess[Huawei-GigabitEther0/0/2]portdefaultvlan2[Huawei-GigabitEther0/0/2]quit[Huawei]intg0/0/3[Huawei-GigabitEther0/0/3]portlink-typeaccess[Huawei-GigabitEther0/0/3]portdefaultvlan3[Huawei-GigabitEther0/0/3]q[Huawei]intVlanif2[Huawei-Vlanif2]ipaddress192.168.1.124[Huawei-Vlanif2]quit[Huawei]intvlanif3[Huawei-Vlanif3]ipaddress192.168.2.124[Huawei-Vlanif3]quit2、配置连接路由器的接口和对应的VLANIF接口[Huawei]vlan100[Huawei-vlan100]intg0/0/1[Huawei-GigabitEther0/0/1]portlink-typeaccess[Huawei-port-group-default]portdefaultvlan100[Huawei-port-group-default]quit[Huawei]intVlanif100[Huawei-Vlanif100]ipaddress192.168.100.224[Huawei-Vlanif100]quit3、配置缺省路由(下一跳地址为路由器内网口地址)[Huawei]iproute-static0.0.0.00.0.0.0192.168.100.14、配置DHCP服务[Huawei]dhcpenable[Huawei][Huawei]intvlanif2[Huawei-Vlanif2]dhcpselectinterface[Huawei-Vlanif2]dhcpserverdns-list202.102.128.68114.114.114.114[Huawei-Vlanif2]quit[Huawei]intvlanif3[Huawei-Vlanif3]dhcpselectinterface[Huawei-Vlanif3]dhcpserverdns-list202.102.128.68114.114.114.114[Huawei-Vlanif3]quit1、配置连接交换机的接口对应的IP地址sys[Huawei]intg0/0/1[Huawei-GigabitEther0/0/1]ipaddress192.168.100.124[Huawei-GigabitEther0/0/1]quit2、配置连接公网的接口对应的IP地址[Huawei]intg0/0/2[Huawei-GigabitEther0/0/2]ipaddress222.134.95.5830[Huawei-GigabitEther0/0/2]q3、配置缺省路由和回程路由(路由器访问内网段192.168.0.0,接口为连接路由器的VLANIF地址)[Huawei]iproute-static0.0.0.00.0.0.0222.134.95.57[Huawei]iproute-static192.168.0.0255.255.0.0192.168.100.24、配置NAT转换[Huawei]aclnumber2001[Huawei-acl-basic-2001]rule5permitsource192.168.0.00.0.255.255 [Huawei-acl-basic-2001]quit[Huawei]intg0/0/2[Huawei-GigabitEther0/0/2]natoutbound2001 [Huawei-GigabitEther0/0/2]quit。

H3C三层交换机配置实例

H3C三层交换机配置实例

H3C三层交换机配置实例H3C三层交换机配置实例1 网络拓扑图 02 配置要求 03划分VLAN并描述 (1)3.1进入系统视图 (1)3.2 创建VLAN并描述 (1)4 给VLAN设置网关 (2)4.1 VLAN1的IP地址设置 (2)4.2 VLAN100的网关设置 (2)4.3 VLAN101的网关设置 (2)4.4 VLAN102的网关设置 (3)4.5 VLAN103的网关设置 (3)5 给VLAN指定端口,设置端口类型 (3)5.1 VLAN100指定端口 (3)5.2 VLAN102指定端口 (4)5.3 VLAN1/101/103指定端口 (4)6 配置路由协议 (5)6.1 默认路由 (5)6.2配置流分类 (5)6.3 定义行为 (5)6.4 应用QOS策略 (6)6.5 接口配置QOS策略 (6)1 网络拓扑图图1-1 网络拓扑图2 配置要求用户1网络:172.16.1.0/24 至出口1网络:172.16.100.0/24 用户2网络:192.168.1.0/24 至出口2网络:192.168.100.0/24实现功能:用户1通过互联网出口1,用户2通过互联网出口2。

3划分VLAN并描述3.1进入系统视图<H3C>system-view //进入系统视图图3-1 系统视图3.2 创建VLAN并描述[H3C]vlan 1 //本交换机使用[H3C-vlan1]description Manager //描述为“Manager”[H3C-vlan1]quit[H3C]vlan 100 //划分vlan100[H3C-vlan100]description VLAN 100 //描述为“VLAN 100”[H3C-vlan100]quit[H3C]vlan 101 //划分vlan101[H3C-vlan101]description VLAN 101 //描述为“VLAN 101”[H3C-vlan101]quit[H3C]vlan 102 //划分vlan102[H3C-vlan102]description VLAN 102 //描述为“VLAN 102”[H3C-vlan102]quit[H3C]vlan 103 //划分vlan103[H3C-vlan103]description VLAN 103 //描述为“VLAN 103”[H3C-vlan103]quit[H3C]图3-2 划分VLAN及描述4 给VLAN设置网关4.1 VLAN1的IP地址设置把VLAN1的IP地址设置为192.168.0.254,子网掩码为255.255.255.0,用于本地使用。

华为三层交换机配置实例一例

华为三层交换机配置实例一例

华为三层交换机配置实例一例服务器1双网卡,内网IP:192.168.0.1,其它计算机通过其代理上网PORT1属于VLAN1PORT2属于VLAN2PORT3属于VLAN3VLAN1的机器可以正常上网配置VLAN2的计算机的网关为:192.168.1.254配置VLAN3的计算机的网关为:192.168.2.254即可实现VLAN间互联如果VLAN2和VLAN3的计算机要通过服务器1上网则需在三层交换机上配置默认路由系统视图下:ip route-static 0.0.0.0 0.0.0.0 192.168.0.1然后再在服务器1上配置回程路由进入命令提示符route add 192.168.1.0 255.255.255.0 192.168.0.254route add 192.168.2.0 255.255.255.0 192.168.0.254这个时候vlan2和vlan3中的计算机就可以通过服务器1访问internet了~~华为路由器与CISCO路由器在配置上的差别"华为路由器与同档次的CISCO路由器在功能特性与配置界面上完全一致,有些方面还根据国内用户的需求作了很好的改进。

例如中英文可切换的配置与调试界面,使中文用户再也不用面对着一大堆的英文专业单词而无从下手了。

另外它的软件升级,远程配置,备份中心,PPP回拨,路由器热备份等,对用户来说均是极有用的功能特性。

在配置方面,华为路由器以前的软件版本(VRP1.0-相当于CISCO的IOS)与CISCO有细微的差别,但目前的版本(VRP1.1)已和CISCO兼容,下面首先介绍VRP软件的升级方法,然后给出配置上的说明。

一、VRP软件升级操作升级前用户应了解自己路由器的硬件配置以及相应的引导软件bootrom的版本,因为这关系到是否可以升级以及升级的方法,否则升级失败会导致路由器不能运行。

在此我们以从VRP1.0升级到VRP1.1为例说明升级的方法。

H3C三层交换机和路由器的配置流程

H3C三层交换机和路由器的配置流程

H3C三层交换机和路由器的配置流程H3C三层交换机和路由器的配置流程举例讲解H3C配置三层交换机4个步骤详细用法,配置三层交换机通用的四个步骤就是:划分VLAN,并描述;给VLAN划网关;给VLAN指定端口;配置路由协议;学会这几个步骤之后就能解决所有的配置三层交换机的问题。

language-modechinese//切换到中文模式system-view//进入系统视图[H3C]displaycurrent-configuration//显示当前配置三层交换机//以下开始配置三层交换机配置三层交换机第一步:划分VLAN,并描述vlan1descriptionlocal-s3600//本交换机使用#vlan2descriptionlink-to-shanxicentre//陕西省中心#vlan3descriptionlink-to-shangjiecentre//商界分中心内部使用#vlan4descriptionlink-to-shangdongsuo//商东所#vlan5descriptionlink-to-shangnansuo//商南所配置三层交换机第二步:给VLAN划网关#interfaceVlan-interface2descriptionlinktoshanxicentreipaddress10.61.242.110255.255.255.252//省中心指定广域网关、子网掩码#interfaceVlan-interface3descriptionlinktoshangjiecentreipaddress10.161.134.65255.255.255.192//商界分中心局域网关、子网掩码#interfaceVlan-interface4descriptionlinktoshangdongsuoipaddress10.61.242.113255.255.255.252//商东所广域网关、子网掩码#interfaceVlan-interface5descriptionlinktoshangnansuoipaddress10.61.242.117255.255.255.252//商南所广域网关、子网掩码配置三层交换机第三步:给VLAN指定端口#interfaceEthernet1/0/2//将交换机的端口2指定给省中心使用descriptionlinktoshanxicentreportaccessvlan2#interfaceEthernet1/0/15-24//将交换机的端口15-24指定给分中心内部使用descriptionlinktoshangjiecentreportaccessvlan3#interfaceEthernet1/0/3//将交换机的端口3指定给商东所使用descriptionlinktoshangdongsuoportaccessvlan4#interfaceEthernet1/0/4//将交换机的端口4指定给商南所使用descriptionlinktoshangnansuoportaccessvlan5配置三层交换机第四步:配置路由协议//配静态路由(只用对远端设备配一条路由即可,本地自通)iproute0.0.0.00.0.0.010.61.242.109//指定所有网段到商东所的路由//配置三层交换机商东所的反向路由iproute10.161.134.0255.255.255.010.61.242.114iproute10.161.135.0255.255.255.010.61.242.114//配置三层交换机商南所的反向路由iproute10.161.135.0255.255.255.010.61.242.118iproute10.161.136.0255.255.255.010.61.242.118//省中心配置三层交换机:iproute10.61.242.0255.255.255.010.61.242.110//商东所242.114和商南所242.118共属的242.0指向分中心网关iproute10.161.134.0255.255.255.010.61.242.110//分中心内部网段指向分中心网关//iproute10.161.134.0255.255.255.010.61.242.110//iproute10.161.135.0255.255.255.010.61.242.110//iproute10.161.136.0255.255.255.010.61.242.110//以下开始配置路由器syslocal-user admin创建账号adminpassword simple chuntent创建密码chuntentauthorization-attribute level 3 账号权限service-type telnet打开telnet服务service-type web打开页面登陆服务telnet server enable 启用服务ip http enable 启用服务quitsysuser-interface vty 0 4authentication-mode schemequitinterface g0/0 进入外网接口配置外网ip和子网掩码ip address X.X.X.X 255.255.255.X这里地址按照您的公网ip地址和掩码填写nat outboundquitinterface vlan 1 进入内网接口配置内网ip和子网掩码ip address X.X.X.X 255.255.255.Xquitip route-static 0.0.0.0 0.0.0.0 X.X.X.X这里填写外网网关地址。

三层交换机路由配置实例

三层交换机路由配置实例

三层交换机路由配置一、三层交换机VLAN间路由建立某公司有两个主要部门:技术部和销售部,分处于不同的办公室,为了安全和便于管理对两个部门的主机进行了VLAN划分,技术部和销售部分处于不同VLAN。

现由于业务需要销售部和技术部的主机能够相互访问,获得相应资源,两个部门的交换机通过一台三层交换机进行连接。

在交换机上建立2个Vlan:Vlan10分配给技术部及Vlan20分配给销售部。

为了实现两部门的主机能够相互访问,在三层交换机上开启路由功能,并在Vlan10中设置IP地址为192.168.10.1;在Vlan20中设置IP地址为192.168.20.1,查看三层交换机路由表,会发现在三层交换机路由表内有2条直连路由信息,实现在不同网络之间路由数据包,从而达到2个部门的主机可以相互访问,拓朴图如图所示。

第1步:开启三层交换机路由功能Switch#configure terminalSwitch(config)#hostname s3550S3550(conifg)#ip routing第2步:建立Vlan,并分配端口S3550(conifg)#vlan 10S3550(config-vlan)#name salesS3550(config-vlan)#exitS3550(conifg)#vlan 20S3550(config-vlan)#name technicalS3550(config-vlan)#exitS3550(conifg)#S3550(conifg)#interface fastethernet 0/10S3550(conifg-if)#switchport mode accessS3550(conifg-if)#switchport access vlan 10S3550(conifg-if)#exitS3550(conifg)# interface fastethernet 0/20S3550(conifg-if)#switchport mode accessS3550(conifg-if)#switchport access vlan 20S3550(config-vlan)#exitS3550(config)#第3步:配置三层交换机端口的路由功能S3550(config)#interface vlan 10S3550(conifg-if)#ip address 192.168.10.1 255.255.255.0 S3550(conifg-if)#no shutdownS3550(conifg-if)#exitS3550(config)#interface vlan 20S3550(conifg-if)#ip address 192.168.20.1 255.255.255.0S3550(conifg-if)#no shutdownS3550(conifg-if)#endS3550#第4步:查看路由表S3550#show ip route第5步:测试三层交换机Vlan间路由功能二、三层交换机与路由器间静态路由的建立某校园局域网由若干台交换机构成,现学校需要将校园网接入互联网,学校在出口使用一台路由器连接互联网。

H3C三层交换机和路由器的配置流程

H3C三层交换机和路由器的配置流程

H3C三层交换机和路由器的配置流程举例讲解H3C配置三层交换机4个步骤详细用法,配置三层交换机通用的四个步骤就是:划分VLAN,并描述;给VLAN划网关;给VLAN指定端口;配置路由协议;学会这几个步骤之后就能解决所有的配置三层交换机的问题。

<H3C>language-modechinese//切换到中文模式<H3C>system-view//进入系统视图[H3C]displaycurrent-configuration//显示当前配置三层交换机//以下开始配置三层交换机配置三层交换机第一步:划分VLAN,并描述vlan1descriptionlocal-s3600//本交换机使用#vlan2descriptionlink-to-shanxicentre//陕西省中心#vlan3descriptionlink-to-shangjiecentre//商界分中心内部使用#vlan4descriptionlink-to-shangdongsuo//商东所#vlan5descriptionlink-to-shangnansuo//商南所配置三层交换机第二步:给VLAN划网关#interfaceVlan-interface2descriptionlinktoshanxicentreipaddress10.61.242.110255.255.255.252//省中心指定广域网关、子网掩码#interfaceVlan-interface3descriptionlinktoshangjiecentreipaddress10.161.134.65255.255.255.192//商界分中心局域网关、子网掩码#interfaceVlan-interface4descriptionlinktoshangdongsuoipaddress10.61.242.113255.255.255.252//商东所广域网关、子网掩码#interfaceVlan-interface5descriptionlinktoshangnansuoipaddress10.61.242.117255.255.255.252//商南所广域网关、子网掩码配置三层交换机第三步:给VLAN指定端口#interfaceEthernet1/0/2//将交换机的端口2指定给省中心使用descriptionlinktoshanxicentreportaccessvlan2#interfaceEthernet1/0/15-24//将交换机的端口15-24指定给分中心内部使用descriptionlinktoshangjiecentreportaccessvlan3#interfaceEthernet1/0/3//将交换机的端口3指定给商东所使用descriptionlinktoshangdongsuoportaccessvlan4#interfaceEthernet1/0/4//将交换机的端口4指定给商南所使用descriptionlinktoshangnansuoportaccessvlan5配置三层交换机第四步:配置路由协议//配静态路由(只用对远端设备配一条路由即可,本地自通)iproute0.0.0.00.0.0.010.61.242.109//指定所有网段到商东所的路由//配置三层交换机商东所的反向路由iproute10.161.134.0255.255.255.010.61.242.114iproute10.161.135.0255.255.255.010.61.242.114//配置三层交换机商南所的反向路由iproute10.161.135.0255.255.255.010.61.242.118iproute10.161.136.0255.255.255.010.61.242.118//省中心配置三层交换机:iproute10.61.242.0255.255.255.010.61.242.110//商东所242.114和商南所242.118共属的242.0指向分中心网关iproute10.161.134.0255.255.255.010.61.242.110//分中心内部网段指向分中心网关//iproute10.161.134.0255.255.255.010.61.242.110//iproute10.161.135.0255.255.255.010.61.242.110//iproute10.161.136.0255.255.255.010.61.242.110//以下开始配置路由器syslocal-user admin创建账号adminpassword simple chuntent创建密码chuntentauthorization-attribute level 3 账号权限service-type telnet打开telnet服务service-type web打开页面登陆服务telnet server enable 启用服务ip http enable 启用服务quitsysuser-interface vty 0 4authentication-mode schemequitinterface g0/0 进入外网接口配置外网ip和子网掩码ip address X.X.X.X 255.255.255.X这里地址按照您的公网ip地址和掩码填写nat outboundquitinterface vlan 1 进入内网接口配置内网ip和子网掩码ip address X.X.X.X 255.255.255.Xquitip route-static 0.0.0.0 0.0.0.0 X.X.X.X这里填写外网网关地址。

cisco3560 3层交换机和路由器连接,交换机如何配置

cisco3560 3层交换机和路由器连接,交换机如何配置

如图。

pc0 属于vlan2,pc1属于vlan3,pc0 ip 192.168.0.10 /24 192.168.0.254 pc1 ip 1 0.139.168.10 /21 10.139.168.254 。

所有交换机的管理vlan是vlan4 192.168.1.x/24 。

要求pc0、pc1可以telnet 到交换机,和路由器 R1 ,交换机之间可以互ping通,pc 0和pc1可以ping通pc3。

pc0、pc1、可以互ping通。

3层交换机和路由器R1如何配置,主要是3层交换机如何配置,我已经在交换机的端口配置好了ip 。

路由器之间的ip 1 0.1.1.0/24 也已经配置好。

麻烦高后帮忙配置一下3层交换机和路由器。

谢谢。

分享到:2012-11-21 18:00提问者采纳这种配置我郁闷!我直接打命令看看能不能解决。

同时覆盖你一些配置吧!三层交换机3560enableconfigure terminalinterface range fastethernet0/1 -2switchport trunk encapsulation dot1qswitchport mode trunkexit这个时候,三层交换机接下面的二层交换机都为中继链路了(trunk),同时需要配置vtp,让各个交换机的vlan信息同步,如下配置:三层交换:enableconfigure terminalvtp domain netvtp mode server两个二层交换机都要配:enableconfigure terminalvtp domain netvtp mode client然后在三层交换上配置vlanenablevlan databasevlan 2vlan 3vlan 4exitconfigure terminalinterface vlan 2ip address 192.168.0.254 255.255.255.0exitinterface vlan 3ip address 10.139.168.254 255.255.248.0exitinterface vlan 4ip address 192.168.1.254 255.255.255.0然后在第一个二层交换机上将PC划分相应的vlan当中。

三层交换机与路由器的配置_实例(图解)

三层交换机与路由器的配置_实例(图解)

三层交换机与路由器的配置实例(图解)目的:学会使用三层交换与路由器让处于不同网段的网络相互通信实验步骤:一:二层交换机的配置:在三个二层交换机上分别划出两VLAN,并将二层交换机上与三层交换或路由器上的接线设置为trunk接口二:三层交换机的配置:1:首先在三层交换上划出两个VLAN,并进入VLAN为其配置IP,此IP将作为与他相连PC的网关。

2:将与二层交换机相连的线同样设置为trunk接线,并将三层交换与路由器连接的线设置为路由接口(no switchsport)3:将路由器和下面的交换机进行单臂路由的配置实验最终结果:拓扑图下各个PC均能相互通信交换机的配置命令:SW 0:Switch>Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int f0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#no shutSwitch(config-if)#int f0/3Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#exitSwitch(config)#SW 1:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#SW 2:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode trunkSwitch(config-if)#三层交换的配置命令:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/1Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down Switch(config-if)#exitSwitch(config)#int f0/2Switch(config-if)#switchport mode trunkSwitch(config-if)#exitSwitch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int vlan 1Switch(config-if)#no shut%LINK-5-CHANGED: Interface Vlan1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to upSwitch(config-if)#ip address 192.168.1.168 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 2%LINK-5-CHANGED: Interface Vlan2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to upSwitch(config-if)#ip addSwitch(config-if)#ip address 192.168.2.168 255.255.255.0Switch(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#Switch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#ip routingSwitch(config-if)#exitSwitch(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2Switch(config)#路由器的配置:Router>enRouter#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int f0/0Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upRouter(config-if)#exitRouter(config)#int f0/1Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Router(config-if)#exitRouter(config)#int f0/0Router(config-if)#no shutRouter(config-if)#exitRouter(config)#int f0/0.1Router(config-subif)#encapsulation dot1Q 1Router(config-subif)#ip address 192.168.3.168 255.255.255.0Router(config-subif)#exitRouter(config)#int f0/0.2Router(config-subif)#encapsulation dot1Q 2Router(config-subif)#ip addRouter(config-subif)#ip address 192.168.4.168 255.255.255.0Router(config-subif)#exitRouter(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1Router(config)#exit%SYS-5-CONFIG_I: Configured from console by consoleRouter#confConfiguring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int f0/1Router(config-if)#ip addRouter(config-if)#ip address 192.168.10.2 255.255.255.0 Router(config-if)#Welcome !!! 欢迎您的下载,资料仅供参考!。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

三层交换机与路由器的配置实例(图解)目的:学会使用三层交换与路由器让处于不同网段的网络相互通信实验步骤:一:二层交换机的配置:在三个二层交换机上分别划出两VLAN,并将二层交换机上与三层交换或路由器上的接线设置为trunk接口二:三层交换机的配置:1:首先在三层交换上划出两个VLAN,并进入VLAN为其配置IP,此IP将作为与他相连PC的网关。

2:将与二层交换机相连的线同样设置为trunk接线,并将三层交换与路由器连接的线设置为路由接口(no switchsport)3:将路由器和下面的交换机进行单臂路由的配置实验最终结果:拓扑图下各个PC均能相互通信交换机的配置命令:SW 0:Switch>Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int f0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#no shutSwitch(config-if)#int f0/3Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#exitSwitch(config)#SW 1:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#SW 2:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode trunkSwitch(config-if)#三层交换的配置命令:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/1Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down Switch(config-if)#exitSwitch(config)#int f0/2Switch(config-if)#switchport mode trunkSwitch(config-if)#exitSwitch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int vlan 1Switch(config-if)#no shut%LINK-5-CHANGED: Interface Vlan1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to upSwitch(config-if)#ip address 192.168.1.168 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 2%LINK-5-CHANGED: Interface Vlan2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to upSwitch(config-if)#ip addSwitch(config-if)#ip address 192.168.2.168 255.255.255.0Switch(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#Switch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#ip routingSwitch(config-if)#exitSwitch(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2Switch(config)#路由器的配置:Router>enRouter#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int f0/0Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upRouter(config-if)#exitRouter(config)#int f0/1Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Router(config-if)#exitRouter(config)#int f0/0Router(config-if)#no shutRouter(config-if)#exitRouter(config)#int f0/0.1Router(config-subif)#encapsulation dot1Q 1Router(config-subif)#ip address 192.168.3.168 255.255.255.0Router(config-subif)#exitRouter(config)#int f0/0.2Router(config-subif)#encapsulation dot1Q 2Router(config-subif)#ip addRouter(config-subif)#ip address 192.168.4.168 255.255.255.0Router(config-subif)#exitRouter(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1Router(config)#exit%SYS-5-CONFIG_I: Configured from console by consoleRouter#confConfiguring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int f0/1Router(config-if)#ip addRouter(config-if)#ip address 192.168.10.2 255.255.255.0 Router(config-if)#。

相关文档
最新文档