99精品伊人亚洲|最近国产中文炮友|九草在线视频支援|AV网站大全最新|美女黄片免费观看|国产精品资源视频|精彩无码视频一区|91大神在线后入|伊人终合在线播放|久草综合久久中文

您好,歡迎來電子發(fā)燒友網(wǎng)! ,新用戶?[免費注冊]

您的位置:電子發(fā)燒友網(wǎng)>電子百科>網(wǎng)絡(luò)>網(wǎng)絡(luò)交換機>

三層交換機配置實例詳解 - 全文

2018年03月06日 10:45 網(wǎng)絡(luò)整理 作者: 用戶評論(0
關(guān)鍵字:三層交換機(9512)

在校園網(wǎng)、城域教育網(wǎng)中,從骨干網(wǎng)、城域網(wǎng)骨干、匯聚層都有三層交換機的用武之地,尤其是核心骨干網(wǎng)一定要用三層交換機,否則整個網(wǎng)絡(luò)成千上萬臺的計算機都在一個子網(wǎng)中,不僅毫無安全可言,也會因為無法分割廣播域而無法隔離廣播風暴。如果采用傳統(tǒng)的路由器,雖然可以隔離廣播,但是性能又得不到保障。而三層交換機的性能非常高,既有三層路由的功能,又具有二層交換的網(wǎng)絡(luò)速度。二層交換是基于MAC尋址,三層交換則是轉(zhuǎn)發(fā)基于第三層地址的業(yè)務(wù)流;除了必要的路由決定過程外,大部分數(shù)據(jù)轉(zhuǎn)發(fā)過程由二層交換處理,提高了數(shù)據(jù)包轉(zhuǎn)發(fā)的效率。三層交換機通過使用硬件交換機構(gòu)實現(xiàn)了IP的路由功能,其優(yōu)化的路由軟件使得路由過程效率提高,解決了傳統(tǒng)路由器軟件路由的速度問題。因此可以說,三層交換機具有“路由器的功能、交換機的性能”。

另外,連接子網(wǎng)少不了三層交換換。同一網(wǎng)絡(luò)上的計算機如果超過一定數(shù)量(通常在200臺左右,視通信協(xié)議而定),就很可能會因為網(wǎng)絡(luò)上大量的廣播而導(dǎo)致網(wǎng)絡(luò)傳輸效率低下。為了避免在大型交換機上進行廣播所引起的廣播風暴,可將其進一步劃分為多個虛擬網(wǎng)(VLAN)。但是這樣做將導(dǎo)致一個問題:VLAN之間的通信必須通過路由器來實現(xiàn)。但是傳統(tǒng)路由器也難以勝任VLAN之間的通信任務(wù),因為相對于局域網(wǎng)的網(wǎng)絡(luò)流量來說,傳統(tǒng)的普通路由器的路由能力太弱。 而且千兆級路由器的價格也是非常難以接受的。如果使用三層交換機上的千兆端口或百兆端口連接不同的子網(wǎng)或VLAN,就在保持性能的前提下,經(jīng)濟地解決了子網(wǎng)劃分之后子網(wǎng)之間必須依賴路由器進行通信的問題,因此三層交換機是連接子網(wǎng)的理想設(shè)備。

三層交換機詳細配置實例

一:二層交換機的配置:

在三個二層交換機上分別劃出兩VLAN,并將二層交換機上與三層交換或路由器上的接線設(shè)置為trunk接口

二:三層交換機的配置:

1:首先在三層交換上劃出兩個VLAN,并進入VLAN為其配置IP,此IP將作為與他相連PC的網(wǎng)關(guān)。

2:將與二層交換機相連的線同樣設(shè)置為trunk接線,并將三層交換與路由器連接的線設(shè)置為路由接口(no switchsport)

3:將路由器和下面的交換機進行單臂路由的配置 實驗最終結(jié)果:拓撲圖下各個PC均能相互通信

三層交換機配置實例

交換機的配置命令:

SW 0:

Switch》 Switch》en Switch#conf

Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 2 Switch(config-vlan)#exit Switch(config)#int f0/2

Switch(config-if)#switchport access vlan 2 Switch(config-if)#no shut Switch(config-if)#int f0/3

Switch(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)#exit Switch(config)#

SW 1:

Switch》en Switch#conf

Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#int f0/2

Switch(config-if)#switchport access vlan 2 % Access VLAN does not exist. Creating vlan 2 Switch(config-if)#no shut Switch(config-if)#exit Switch(config)#int f0/3

Switch(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》en

Switch#conf

Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#int f0/2

Switch(config-if)#switchport access vlan 2 % Access VLAN does not exist. Creating vlan 2 Switch(config-if)#exit

Switch(config)#int f0/3

Switch(config-if)#switchport mode trunk Switch(config-if)#

三層交換的配置命令:

Switch》en Switch#conf

Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#int f0/1

Switch(config-if)#switchport mode trunk

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

Switch(config-if)#exit Switch(config)#int f0/2

Switch(config-if)#switchport mode trunk Switch(config-if)#exit Switch(config)#vlan 2 Switch(config-vlan)#exit Switch(config)#int vlan 1 Switch(config-if)#no shut

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up Switch(config-if)#ip address 192.168.1.168 255.255.255.0 Switch(config-if)#exit Switch(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 add

Switch(config-if)#ip address 192.168.2.168 255.255.255.0 Switch(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)#exit Switch(config)#int f0/3

Switch(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.0 Switch(config-if)#no shut Switch(config-if)#exit Switch(config)#ip routing Switch(config-if)#exit

Switch(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2 Switch(config)# 路由器的配置:

Router》en Router#conf

Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int f0/0 Router(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up Router(config-if)#exit Router(config)#int f0/1 Router(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)#exit Router(config)#int f0/0 Router(config-if)#no shut Router(config-if)#exit Router(config)#int f0/0.1

Router(config-subif)#encapsulation dot1Q 1

Router(config-subif)#ip address 192.168.3.168 255.255.255.0 Router(config-subif)#exit Router(config)#int f0/0.2

Router(config-subif)#encapsulation dot1Q 2 Router(config-subif)#ip add

Router(config-subif)#ip address 192.168.4.168 255.255.255.0 Router(config-subif)#exit

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1 Router(config)#exit

%SYS-5-CONFIG_I: Configured from console by console Router#conf

Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#int f0/1

Router(config-if)#ip add

Router(config-if)#ip address 192.168.10.2 255.255.255.0

Router(config-if)#

H3C配置三層交換機配置實例

舉例講解H3C配置三層交換機4個步驟詳細用法,配置三層交換機通用的四個步驟就是:劃分VLAN,并描述;給VLAN劃網(wǎng)關(guān);給VLAN指定端口;配置路由協(xié)議;學(xué)會這幾個步驟之后就能解決所有的配置三層交換機的問題。

《H3C》language-modechinese//切換到中文模式

《H3C》system-view//進入系統(tǒng)視圖

[H3C]displaycurrent-configuration//顯示當前配置三層交換機

//以下開始配置三層交換機

配置三層交換機第一步:劃分VLAN,并描述

vlan1

descriptionlocal-s3600//本交換機使用

#

vlan2

descriptionlink-to-shanxicentre//陜西省中心

#

vlan3

descriptionlink-to-shangjiecentre//商界分中心內(nèi)部使用

#

vlan4

descriptionlink-to-shangdongsuo//商東所

#

vlan5

descriptionlink-to-shangnansuo//商南所

配置三層交換機第二步:給VLAN劃網(wǎng)關(guān)

#

interfaceVlan-interface2

descriptionlinktoshanxicentre

ipaddress10.61.242.110255.255.255.252//省中心指定廣域網(wǎng)關(guān)、子網(wǎng)掩碼

#

interfaceVlan-interface3

descriptionlinktoshangjiecentre

ipaddress10.161.134.65255.255.255.192//商界分中心局域網(wǎng)關(guān)、子網(wǎng)掩碼

#

interfaceVlan-interface4

descriptionlinktoshangdongsuo

ipaddress10.61.242.113255.255.255.252//商東所廣域網(wǎng)關(guān)、子網(wǎng)掩碼

#

interfaceVlan-interface5

descriptionlinktoshangnansuo

ipaddress10.61.242.117255.255.255.252//商南所廣域網(wǎng)關(guān)、子網(wǎng)掩碼

配置三層交換機第三步:給VLAN指定端口

#

interfaceEthernet1/0/2//將交換機的端口2指定給省中心使用

descriptionlinktoshanxicentre

portaccessvlan2

#

interfaceEthernet1/0/15-24//將交換機的端口15-24指定給分中心內(nèi)部使用

descriptionlinktoshangjiecentre

portaccessvlan3

#

interfaceEthernet1/0/3//將交換機的端口3指定給商東所使用

descriptionlinktoshangdongsuo

portaccessvlan4

#

interfaceEthernet1/0/4//將交換機的端口4指定給商南所使用

descriptionlinktoshangnansuo

portaccessvlan5

配置三層交換機第四步:配置路由協(xié)議

//配靜態(tài)路由(只用對遠端設(shè)備配一條路由即可,本地自通)

iproute0.0.0.00.0.0.010.61.242.109//指定所有網(wǎng)段到商東所的路由

//配置三層交換機商東所的反向路由

iproute10.161.134.0255.255.255.010.61.242.114

iproute10.161.135.0255.255.255.010.61.242.114

//配置三層交換機商南所的反向路由

iproute10.161.135.0255.255.255.010.61.242.118

iproute10.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指向分中心網(wǎng)關(guān)

iproute10.161.134.0255.255.255.010.61.242.110//分中心內(nèi)部網(wǎng)段指向分中心網(wǎng)關(guān)

//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

上一頁12全文

非常好我支持^.^

(143) 44%

不好我反對

(182) 56%

( 發(fā)表人:李倩 )

      發(fā)表評論

      用戶評論
      評價:好評中評差評

      發(fā)表評論,獲取積分! 請遵守相關(guān)規(guī)定!

      ?