为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

三层交换机路由功能的设置

2017-09-21 15页 doc 97KB 19阅读

用户头像

is_562397

暂无简介

举报
三层交换机路由功能的设置三层交换机路由功能的设置 1. 单台三层交换机路由功能配置 1(在DES-3828上划分VLAN10与VLAN20,VLAN10包含1-12口,VLAN20包含13-24口 2(VLAN10和VLAN20中的计算机可以互相访问DES-3828配置如下: # VLAN config vlan default delete 1-28 config vlan default add untagged 25-28 create vlan v10 tag 10 config vlan v10 add untagged 1...
三层交换机路由功能的设置
三层交换机路由功能的设置 1. 单台三层交换机路由功能配置 1(在DES-3828上划分VLAN10与VLAN20,VLAN10包含1-12口,VLAN20包含13-24口 2(VLAN10和VLAN20中的计算机可以互相访问DES-3828配置如下: # VLAN config vlan default delete 1-28 config vlan default add untagged 25-28 create vlan v10 tag 10 config vlan v10 add untagged 1-12 create vlan v20 tag 20 config vlan v20 add untagged 13-24 create ipif if10 192.168.10.254/24 v10 state enable create ipif if20 192.168.20.254/24 v20 state enable 其中create ipif 是命令名;if10 是所创建的虚接口的名字,可以自己设定,不一定 是if10;192.168.10.254/24 是虚接口的IP 地址,也是自己设定,但一定要用/24 这种形式表明子网掩码长度;V10 是虚接口对应的vlan 的名字。需要注意的是虚接 口和vlan 是一一对应的,而且每个虚接口的IP 应在不同的逻辑子网。 DES-3800:admin#show vlan Command: show vlan VID : 1 VLAN Name : default VLAN TYPE : static Advertisement : Enabled Member ports : 25-28 Static ports : 25-28Current Tagged ports :Current Untagged ports : 25-28Static Tagged ports :Static Untagged ports : 25-28Forbidden ports : VID : 10 VLAN Name : v10VLAN TYPE : static Advertisement : DisabledMember ports : 1-12Static ports : 1-12Current Tagged ports :Current Untagged ports : 1-12Static Tagged ports :Static Untagged ports : 1-12Forbidden ports : VID : 20 VLAN Name : v20VLAN TYPE : static Advertisement : DisabledMember ports : 13-24Static ports : 13-24Current Tagged ports :Current Untagged ports : 13-24Static Tagged ports :Static Untagged ports : 13-24Forbidden ports : Total Entries : 3 12 端口,V20 应包含13,用showvlan 命令查看配置情况,此时V10 应包含1, 24 端口,而default 包含25-28 端口 DES-3800:admin#show ipifCommand: show ipif IP Interface SettingsInterface Name : SystemIP Address : 192.168.0.2 (MANUAL)Secondary : FALSESubnet Mask : 255.255.255.0VLAN Name : defaultAdmin. State : EnabledProxy ARP : DisabledLink Status : Link UP Member Ports : 25-28 Interface Name : if10 IP Address : 192.168.10.254 (MANUAL) Secondary : FALSE Subnet Mask : 255.255.255.0 VLAN Name : v10 Admin. State : Enabled Proxy ARP : Disabled Link Status : Link DOWN Member Ports : 1-12 Interface Name : if20 IP Address : 192.168.20.254 (MANUAL) Secondary : FALSE Subnet Mask : 255.255.255.0 VLAN Name : v20 Admin. State : Enabled Proxy ARP : Disabled Link Status : Link DOWN Member Ports : 13-24 Total Entries : 3 用show ipif 命令查看虚接口状态,会发现一个现象:没有接PC 的vlan 所对应的 虚接口的状态是Link down ,也就是说,vlan 里接了终端,虚接口才会启用。 DES-3800:admin#show iproute Command: show iproute OSPF ECMP : Disabled Routing Table IP Address/Netmask Gateway Interface Hops Protocol - 0.0.0.0 System 1 192.168.0.0/24 Local 192.168.10.0/24 0.0.0.0 if10 1 Local 192.168.20.0/24 0.0.0.0 if20 1 Local 以上步骤正确设置完后,用show iproute 命令查看路由表,应看到三条路由,分别是192.168.10.0/24 和192.168.20.0/24 和192.168.0.0/24 没有接PC 的vlan 所对应的路由是不会显示在路由表中的,若接有PC ,所对应的vlan 的路由才会显示在路由表中。 把V10 里面PC 的IP 地址设为192.168.10.x,网关设为192.168.10.254, V20 里面PC 的IP 地址设为192.168.20.x ,网关设为192.168.20.254, 两个Vlan 里面的计算机可以互相ping 通。 当配置交换机的三层功能时,如果是一台三层交换机,只要配置各vlan 的虚接口就可以,因为一台三层交换机上的虚接口会在交换机里以直连路由的身份出现,所以不需要进行静态路由的配置或启用动态路由协议。 2. 多台三层交换机静态路由设置 两台交换机通过Port 25 相连。 V 4 0 : 1 9 2 . 1 6 8 . 4 0 . x GW:192.168.40.254 Port:13-24 default:192.168.0.3Port:25-28 DES-3800-A: # VLAN config vlan default delete 1-28config vlan default add untagged 25-28create vlan v10 tag 10config vlan v10 add untagged 1-12create vlan v20 tag 20config vlan v20 add untagged 13-24 config ipif System vlan default ipaddress 192.168.0.2/24create ipif if10 192.168.10.254/24 v10 state enablecreate ipif if20 192.168.20.254/24 v20 state enable create iproute 192.168.30.0/255.255.255.0 192.168.0.3create iproute 192.168.40.0/255.255.255.0 192.168.0.3 在本实验中有一个关键步骤,那就是要保留缺省Vlan default ,它的成员是两台交换机的级联 端口。只有保留了这个VLAN ,两台交换机才能有一条相互通信的通道,这是保证多台三层设 备互连时能正常工作的基础。交换机级联多口可以任选,但不能是其它VLAN 的成员,在本例 中选用的是端口25 。DES-3800-B: # VLAN config vlan default delete 1-28config vlan default add untagged 25-28create vlan v30 tag 30config vlan v30 add untagged 1-12create vlan v40 tag 40config vlan v40 add untagged 13-24 config ipif System vlan default ipaddress 192.168.0.3/24create ipif if30 192.168.30.254/24 v30 state enablecreate ipif if40 192.168.40.254/24 v40 state enable create iproute 192.168.10.0/255.255.255.0 192.168.0.2create iproute 192.168.20.0/255.255.255.0 192.168.0.2 但需要注意的是,创建虚接口时,default 的虚接口IP 地址应和第一台交换机 defualt 的虚接口IP 地址不同,但要位于同一网段,这样才能保证正常通信。比如, 设成192.168.0.3 。 当配置多台三层交换机的静态路由功能时,相对动态路由来说要简单,不过为了让路 由协议能够正常通信,互连的交换机的级联端口应单独设置到一个VLAN 里,并创建 虚接口,虚接口的IP 应该是相同网段的不同IP 地址。 3. 多台三层交换机动态路由设置 3.1 RIP 设置 两台交换机通过Port 25 相连。 V 4 0 : 1 9 2 . 1 6 8 . 4 0 . x GW:192.168.40.254 Port:13-24 default:192.168.0.3 Port:25-28 # VLAN DES-3800-A: config vlan default delete 1-28config vlan default add untagged 25-28create vlan v10 tag 10config vlan v10 add untagged 1-12create vlan v20 tag 20config vlan v20 add untagged 13-24 config ipif System vlan default ipaddress 192.168.0.2/24create ipif if10 192.168.10.254/24 v10 state enablecreate ipif if20 192.168.20.254/24 v20 state enable enable rip config rip ipif System authentication disable tx_mode v2_only rx_mode v1_or_v2 state enable config rip ipif if10 authentication disable tx_mode v2_only rx_mode v1_or_v2 state enable config rip ipif if20 authentication disable tx_mode v2_only rx_mode v1_or_v2 state enable 第一条命令是启用RIP 协议,后三条命令是配置虚接口的收发RIP 信息的模式,是 必须要做的,其中可选的收发模式是针对RIP 协议有两个版本制定的,在实际应用中 可根据实际情况来配置。 DES-3800-B: # VLAN config vlan default delete 1-28config vlan default add untagged 25-28create vlan v30 tag 30config vlan v30 add untagged 1-12create vlan v40 tag 40config vlan v40 add untagged 13-24 config ipif System vlan default ipaddress 192.168.0.3/24create ipif if30 192.168.30.254/24 v30 state enablecreate ipif if40 192.168.40.254/24 v40 state enable enable rip config rip ipif System authentication disable tx_mode v2_only rx_mode v1_or_v2 state enable config rip ipif if30 authentication disable tx_mode v2_only rx_mode v1_or_v2 state enable config rip ipif if40 authentication disable tx_mode v2_only rx_mode v1_or_v2 state enable 当配置多台三层交换机的路由功能时,和配置一台三层交换机是不同的,除了 配置各vlan 的虚接口之外,还要启用路由协议,为了让路由协议能够正常通信,互 连的交换机的级联端口应单独设置到一个VLAN 里,并创建虚接口,虚接口的IP 应 该是相同网段的不同IP 地址。 3.2 OSPF 设置 两台交换机通过Port 25 相连。 V 4 0 : 1 9 2 . 1 6 8 . 4 0 . x G W : 1 9 2 . 1 6 8 . 4 0 . 2 5 4 P o r t : 1 3 - 2 4 d e f a u l t : 1 9 2 . 1 6 8 . 0 . 3 P o r t : 2 5 - 2 8 DES-3800-A: # VLAN config vlan default delete 1-28config vlan default add untagged 25-28create vlan v10 tag 10config vlan v10 add untagged 1-12create vlan v20 tag 20config vlan v20 add untagged 13-24 config ipif System vlan default ipaddress 192.168.0.2/24create ipif if10 192.168.10.254/24 v10 state enablecreate ipif if20 192.168.20.254/24 v20 state enable enable ospfconfig ospf router_id 192.168.0.2create ospf area 0.0.0.1 type normalconfig ospf ipif System area 0.0.0.1 state enableconfig ospf ipif if10 area 0.0.0.1 state enableconfig ospf ipif if20 area 0.0.0.1 state enable config ospf router_id 描述该命令用于配置OSPF 路由器ID。参数 ?OSPF 路由器的IP 地址。 enable ospf 描述与disable ospf 命令一起用于在交换机上启用和禁用OSPF 。 create ospf area type [normal | stub ] 描述该命令用于创建一个OSPF 区域并配置其设置。 ?OSPF 区域ID 。 用户可以输入一个IP 地址格式的32 比特数字,对OSPF 域里的OSPF 区域进行唯 一性识别。type [normal | stub] ?OSPF 区域运行模式?末梢或常规。 config ospf [ipif | all] {area state [enable | disable] | -IP 接口的名称。all – 所有的IP 接口。area -一个 32 位数字的IP地址,格式为(xxx.xxx.xxx.xxx), 唯一能识别OSPF 域内的OSPF 区域。state [enable | disable] – 用于启用或禁用此功能。 Ospf 配置步骤:1、set the router ID 2、enable OSPF 3、create the OSPF area 4、add interfaces to the area 5、如有必要,配置OSPF 其他参数 DES-3800-B: # VLAN config vlan default delete 1-28config vlan default add untagged 25-28create vlan v30 tag 30config vlan v30 add untagged 1-12create vlan v40 tag 40config vlan v40 add untagged 13-24 config ipif System vlan default ipaddress 192.168.0.3/24 create ipif if30 192.168.30.254/24 v30 state enable create ipif if40 192.168.40.254/24 v40 state enable enable ospfconfig ospf router_id 192.168.0.3create ospf area 0.0.0.1 type normalconfig ospf ipif System area 0.0.0.1 state enableconfig ospf ipif if30 area 0.0.0.1 state enableconfig ospf ipif if40 area 0.0.0.1 state enable
/
本文档为【三层交换机路由功能的设置】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索