自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

思科基礎(chǔ)知識(shí):虛擬局域網(wǎng)(VLAN)(5)

網(wǎng)絡(luò)
在一個(gè)純交換式的互聯(lián)網(wǎng)絡(luò)中,通過(guò)創(chuàng)建虛擬局域網(wǎng)(VLAN)就可以分隔廣播域。

配置VTP

所有的交換機(jī),在默認(rèn)時(shí)都配置為VTP服務(wù)器。要配置VTP,首先必須配置你想要使用的VTP域名。在創(chuàng)建VTP域時(shí),有一些選項(xiàng),包括設(shè)置域名、口令、操作模式和交換機(jī)的修建功能??墒褂肰TP全局配置模式命令來(lái)設(shè)置所有這些信息。在下面的列茲中,我將交換機(jī)設(shè)置為VTP server,將VTP域名設(shè)置為Cisco,將VTP口令設(shè)置為12345:

  1. 1900(config)#vtp server  
  2.  
  3. 1900(config)#vtp domain Cisco  
  4.  
  5. 1900(config)#vtp password 12345 

默認(rèn)時(shí)所有的交換機(jī)都設(shè)置為VTP服務(wù)器模式,如果想在交換機(jī)上改動(dòng)任何有關(guān)VLAN的信息,都必須在VTP服務(wù)器模式下進(jìn)行。

在2950交換機(jī)上配置VTP,同樣要首先配置想要使用的域名。同樣,一旦在交換機(jī)上配置了VTP信息,就需要驗(yàn)證它。可使用VTP全局配置模式命令來(lái)設(shè)置這些信息。例子中,把交換機(jī)設(shè)置為服務(wù)器模式,域名設(shè)置為SZ_Lab

  1. Switch(config)#vtp mode server  
  2.  
  3. Switch(config)#vtp domain SZ_Lab 

配置示例互聯(lián)網(wǎng)絡(luò)中的交換

先配置2950C,如下:

  1. 2950C(config)#enable secret noko  
  2.  
  3. 2950C(config)#line con 0  
  4.  
  5. 2950C(config-line)#login  
  6.  
  7. 2950C(config-line)#password noco  
  8.  
  9. 2950C(config-line)#line vty 0 15  
  10.  
  11. 2950C(config-line)#login  
  12.  
  13. 2950C(config-line)#password noco  
  14.  
  15. 2950C(config-line)#banner motd #  
  16.  
  17. 2950C  
  18.  
  19. #  
  20.  
  21. 2950C(config-line)#exit  
  22.  
  23. 2950C(config)#int vlan1  
  24.  
  25. 2950C(config-if)#ip address 172.16.10.2 255.255.255.0  
  26.  
  27. 2950C(config-if)#no shut  
  28.  
  29. 2950C(config-if)#exit  
  30.  
  31. 2950C(config)#up default-gateway 172.16.10.1  
  32.  
  33. 2950C(config)#^Z  
  34.  
  35. 2950C#copy run start 

配置2950B,如下:

  1. 2950B(config)#enable secret noko  
  2.  
  3. 2950B(config)#line con 0  
  4.  
  5. 2950B(config-line)#login  
  6.  
  7. 2950B(config-line)#password noco  
  8.  
  9. 2950B(config-line)#line vty 0 15  
  10.  
  11. 2950B(config-line)#login  
  12.  
  13. 2950B(config-line)#password noco  
  14.  
  15. 2950B(config-line)#banner motd #  
  16.  
  17. 2950B  
  18.  
  19. #  
  20.  
  21. 2950B(config-line)#exit  
  22.  
  23. 2950B(config)#int vlan1  
  24.  
  25. 2950B(config-if)#ip address 172.16.10.3 255.255.255.0  
  26.  
  27. 2950B(config-if)#no shut  
  28.  
  29. 2950B(config-if)#exit  
  30.  
  31. 2950B(config)#up default-gateway 172.16.10.1  
  32.  
  33. 2950B(config)#^Z  
  34.  
  35. 2950B#copy run start 

#p#

配置trunk,2950B如下:

  1. 2950B(config)#int f0/1  
  2.  
  3. 2950B(config-if)#switchport mode trunk  
  4.  
  5. 2950B(config-if)#int f0/4  
  6.  
  7. 2950B(config-if)#switchport mode trunk  
  8.  
  9. 2950B(config-if)#int f0/5  
  10.  
  11. 2950B(confgi-if)#switchport mode trunk 

配置trunk,2950C如下:

  1. 2950C(config)#int f0/4  
  2.  
  3. 2950C(confgi-if)#switchport mode trunk  
  4.  
  5. 2950C(config-if)#int f0/5  
  6.  
  7. 2950C(config-if)#switchport mode trunk 

驗(yàn)證trunk信息,使用show interface trunk命令.如下:

  1. 2950B#sh int trunk  
  2.  
  3. Port Mode Encapsulation Status Native vlan  
  4.  
  5. Fa0/1 on 802.1q trunking 1  
  6.  
  7. Fa0/4 on 802.1q trunking 1  
  8.  
  9. Fa0/5 on 802.1q trunking 1  
  10.  
  11. (略) 

之前我們已經(jīng)對(duì)2950B和2950C做了基本配置和trunk端口的配置,接下來(lái)應(yīng)該設(shè)置VTP和創(chuàng)建VLAN,并且進(jìn)行驗(yàn)證.2950C如下:

  1. 2950C(config)#vtp mode server  
  2.  
  3. 2950C(config)#vtp domain Cisco  
  4.  
  5. 2950C(config)#^Z  
  6.  
  7. 2950C#vlan database  
  8.  
  9. 2950C(vlan)#vlan 2 name sales  
  10.  
  11. 2950C(vlan)#vlan 3 name marketing  
  12.  
  13. 2950C(vlan)#apply  
  14.  
  15. 2950C(vlan)#^C  
  16.  
  17. 2950C#sh vlan brief  
  18.  
  19. (略) 

接下來(lái)分配端口,把Fa0/2分配給VLAN2,Fa0/3分配給VLAN3,默認(rèn)所有的端口都處在VLAN1下,配置如下:

  1. 2950C(config)#int fa0/2  
  2.  
  3. 2950C(config-if)#switchport access vlan2  
  4.  
  5. 2950C(config)#int fa0/3  
  6.  
  7. 2950C(config-if)#switchport access vlan3 

驗(yàn)證信息,注意VLAN1里的Ports欄,如下:

  1. 2950C#sh vlan brief  
  2.  
  3. VLAN Name Status Ports  
  4.  
  5. ----------------------------------------------------------------------------  
  6.  
  7. 1 default active Fa0/1 Fa0/5...Fa0/10  
  8.  
  9. 2 sales active Fa0/2  
  10.  
  11. 3 marketing active Fa0/3 

#p#

配置2950B,把它設(shè)置成客戶模式,2950B從2950C接收VLAN信息,如下:

  1. 2950B(config)#vtp mode client  
  2.  
  3. 2950B(config)#vtp domain Cisco  
  4.  
  5. 2950B(config)#^Z 

驗(yàn)證,注意2950B已經(jīng)從2950C知道了VLAN的信息,如下:

  1. 2950B#sh vlan brief  
  2.  
  3. VLAN Name Status Ports  
  4.  
  5. ----------------------------------------------------------------------------  
  6.  
  7. 1 default active Fa0/1...Fa0/12  
  8.  
  9. 2 sales active  
  10.  
  11. 3 marketing active 

但是仍然要給2950B分配端口,如下:

  1. 2950B(config)#int fa0/2  
  2.  
  3. 2950B(config-if)#switchport access vlan2  
  4.  
  5. 2950B(config)#int fa0/3  
  6.  
  7. 2950B(config-if)#switchport access vlan3 

驗(yàn)證信息,如下:

  1. VLAN Name Status Ports  
  2.  
  3. ----------------------------------------------------------------------------  
  4.  
  5. 1 default active Fa0/1 Fa0/5...Fa0/12  
  6.  
  7. 2 sales active Fa0/2  
  8.  
  9. 3 marketing active Fa0/3 

到現(xiàn)在,2950C和2950B的配置就算是完成了,經(jīng)過(guò)驗(yàn)證,我們也沒(méi)發(fā)現(xiàn)什么問(wèn)題,接下來(lái)該配置什么呢?當(dāng)然是配置VLAN間的通信,根據(jù)上面的拓?fù)鋱D,可以知道需要在RouterB上進(jìn)行配置,如下:

  1. RouterB(config)#hostname Trunkrouter  
  2.  
  3. Trunkrouter(config)#int f0/0  
  4.  
  5. Trunkrouter(config-if)#no ip address  
  6.  
  7. Trunkrouter(config-if)#no shut 

創(chuàng)建子接口,并定義封裝類型,如下:

  1. Trunkrouter(config-if)#int f0/0.1  
  2.  
  3. Trunkrouter(config-subif)#encapsulation dot1q 1  
  4.  
  5. Trunkrouter(config-subif)#ip address 172.16.10.1 255.255.255.0  
  6.  
  7. Trunkrouter(config-if)#int f0/0.2  
  8.  
  9. Trunkrouter(config-subif)#encapsulation dot1q 2  
  10.  
  11. Trunkrouter(config-subif)#ip address 172.16.20.1 255.255.255.0  
  12.  
  13. Trunkrouter(config-if)#int f0/0.3  
  14.  
  15. Trunkrouter(config-subif)#encapsulation dot1q 3  
  16.  
  17. Trunkrouter(config-subif)#ip address 172.16.30.1 255.255.255.0  
  18.  
  19. Trunkrouter(config-if)#exit 

創(chuàng)建子接口,每個(gè)接口對(duì)應(yīng)1個(gè)VLAN.注意,如果你試圖在***個(gè)子接口分配IP地址,將收到錯(cuò)誤信息,除非你先定義了封裝類型,如下:

  1. Trunkrouter(config-if)#int f0/0.1  
  2.  
  3. Trunkrouter(config-subif)#ip address 172.16.10.1 255.255.255.0  
  4.  
  5. Configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL VLAN. 

【編輯推薦】

  1. 思科基礎(chǔ)知識(shí):虛擬局域網(wǎng)(VLAN)(1)
  2. 思科基礎(chǔ)知識(shí):虛擬局域網(wǎng)(VLAN)(2)
  3. 思科基礎(chǔ)知識(shí):虛擬局域網(wǎng)(VLAN)(3)
  4. 思科基礎(chǔ)知識(shí):虛擬局域網(wǎng)(VLAN)(4)
責(zé)任編輯:佚名 來(lái)源: 51CTO整理
相關(guān)推薦

2011-06-01 13:18:30

VLAN交換交換機(jī)

2011-06-01 13:18:26

VLAN

2011-06-01 13:18:17

VLANtrunk路由

2011-06-01 13:18:34

VLAN交換機(jī)

2010-04-16 10:57:43

無(wú)線局域網(wǎng)

2011-06-02 09:36:10

廣域網(wǎng)協(xié)議ISDN

2009-11-26 11:00:51

局域網(wǎng)接口路由器

2011-05-31 10:14:28

協(xié)議IP網(wǎng)絡(luò)地址

2011-06-01 09:26:55

路由路由器IGRP

2011-05-31 13:52:22

口令CiscoIOS

2009-12-28 15:56:42

VLAN協(xié)議

2010-01-18 17:02:06

2011-06-02 09:24:29

廣域網(wǎng)協(xié)議DDR路由

2011-06-02 09:36:03

幀中繼廣域網(wǎng)協(xié)議

2011-06-02 09:36:01

PPP數(shù)據(jù)鏈路廣域網(wǎng)協(xié)議

2011-06-02 09:36:07

廣域網(wǎng)協(xié)議虛電路幀中繼

2011-06-02 09:35:58

WAN交換廣域網(wǎng)

2011-09-19 16:06:55

路由器局域網(wǎng)分段

2010-08-23 17:18:54

DHCP協(xié)議

2010-04-07 14:33:35

無(wú)線局域網(wǎng)基礎(chǔ)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)