天天看點

CCNA綜合實驗(一):實驗實作(Ⅰ)

實驗拓撲:

CCNA綜合實驗(一):實驗實作(Ⅰ)
一、綜合實驗位址配置設定方案

子網名稱 環回接口占用 R1 區域網路 R3 R1-R2 網間網
位址空間範圍 1-31/29 32-63/27 64-95/27 112-115/30
R2-R3 Vlan1 VlanX1 VlanX2
116-119/30 96-111/28 128-191/26 192-255/26
裝置名稱 接口名稱 配置設定位址以及子網路遮罩
S0/0 192.168.1.113/30 252
F0/0 192.168.1.33/27 224
Loopback0 192.168.1.10/29 248
R2 192.168.1.114/30 252
S0/1 192.168.1.117/30 252
192.168.1.20/29 248
F0/0.1 192.168.1.97/28 240
F0/0.X1 192.168.1.129/26 192
F0/0.X2 192.168.1.193/26 192
192.168.1.118/30 252
192.168.1.65/27 224
192.168.1.30/29 248
SW1 192.168.1.98/28 240
SW2 192.168.1.99/28 240
SW3 192.168.1.100/28 240

二、可以使用Cisco Packet Tracer 或者GNS模拟器,若使用GNS3需要使用路由器來模拟交換機,使用VPCS來模拟主機可以檢視這篇文章

使用GNS3模拟交換機和PC

來自 <http://shenghao.blog.51cto.com/5890026/1194815>

這裡使用Cisco Packet Tracer 6.0完全可以完成

三、實驗操作

  1. 中繼要求:三台交換機之間連接配接封裝Trunk ,采用802.1Q的方式封裝,SW1為VTP Server;SW2和SW3為VTP Client;VTP 域名為CCNA,VTP密碼cisco,VTP version 2

STP要求:SW2為VLAN X1的跟橋,SW3為VLAN X2的跟橋,注意觀察接口的狀态,哪個接口是阻塞狀态?

STP特性:與PC直連的接口設定Portfast .

VLAN:VLAN 1為管理VLAN ,要求給三個交換機都配置管理位址,并且遠端可以進行telnet登入;建立VLAN X1和VLAN X2名稱分别為NetServer 、TFTPServer

注意:三台交換機不能直接兩兩相連成環狀,由于還未配置生成樹協定,會導緻環路生成。

  • 配置VTP

SW1(config)#vtp domain ccna

Changing VTP domain name from NULL to ccna

SW1(config)#vtp mode server

Device mode already VTP SERVER.

SW1(config)#vtp version 2

SW1(config)#vtp password cisco

Setting device VLAN database password to cisco

SW1(config)#

SW2(config)#vtp domain ccna

SW2(config)#vtp mode client

Setting device to VTP CLIENT mode.

SW2(config)#vtp pass

SW2(config)#vtp password cisco

SW2(config)#

SW3(config)#vtp domain ccna

SW3(config)#vtp mode client

SW3(config)#vtp pass

SW3(config)#vtp password cisco

SW3(config)#

  • 配置交換機的管理位址和trunk連接配接

SW1(config)#int vlan 1

SW1(config-if)#ip add 192.168.1.98 255.255.255.240

SW1(config-if)#no shut

SW1(config-if)#

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

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

SW2(config)#int vlan 1

SW2(config-if)#ip add 192.168.1.99 255.255.255.240

SW2(config-if)#no shut

SW2(config-if)#

SW3(config)#int vlan 1

SW3(config-if)#ip add 192.168.1.100 255.255.255.240

SW3(config-if)#no shut

SW3(config-if)#

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SW1(config)#int f0/2

SW1(config-if)#sw

SW1(config-if)#switchport mode trunk

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

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

SW1(config-if)#int f0/3

%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

SW2(config)#int range f0/1-2

SW2(config-if-range)#sw

SW2(config-if-range)#switchport mode trunk

SW2(config-if-range)#

SW3(config)#int range f0/1-2

SW3(config-if-range)#sw

SW3(config-if-range)#switchport mode trunk

SW3(config-if-range)#

  • 劃分VLAN

SW1(vlan)#vlan 11 name NetServer

VLAN 11 added:

    Name: NetServer

SW1(vlan)#vlan 12 name TFTPServer

VLAN 12 added:

    Name: TFTPServer

SW1(vlan)#

  • 将與PC直接相連的接口設為PortFast,并劃分到相應的VLAN中

SW1(config)#int range f0/4-12

SW1(config-if-range)#sw mode access

SW1(config-if-range)#sw access vlan 11

SW1(config-if-range)#int range f0/13-24

SW1(config-if-range)#sw access vlan 12

SW1(config-if-range)#

SW2(config)#int range f0/4-12

SW2(config-if-range)#sw mode acc

SW2(config-if-range)#sw acc vlan 11

SW2(config-if-range)#int range f0/13-24

SW2(config-if-range)#sw acc vlan 12

SW3(config)#int range f0/4-24

SW3(config-if-range)#sw mode acc

SW3(config-if-range)#sw acc vlan 12

  • 設定SW2為VLAN X1的跟橋,SW3為VLAN X2的跟橋

SW2(config)#spanning-tree vlan 11 root primary

SW3(config)#spanning-tree vlan 12 root primary

檢視配置結果

SW2#sh spanning-tree

VLAN0001

  Spanning tree enabled protocol ieee

  Root ID    Priority    32769

             Address     0006.2A02.8C96

             This bridge is the root

             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)

             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type

---------------- ---- --- --------- -------- --------------------------------

Fa0/2            Desg FWD 19        128.2    P2p

Fa0/1            Desg FWD 19        128.1    P2p

VLAN0011

  Root ID    Priority    24587

  Bridge ID  Priority    24587  (priority 24576 sys-id-ext 11)

Fa0/4            Desg FWD 19        128.4    P2p

Fa0/5            Desg FWD 19        128.5    P2p

VLAN0012

  Root ID    Priority    24588

             Address     00E0.A3BD.343C

             Cost        19

             Port        2(FastEthernet0/2)

  Bridge ID  Priority    32780  (priority 32768 sys-id-ext 12)

Fa0/2            Root FWD 19        128.2    P2p

  • 單臂路由的設定

R2(config)#int f0/0

R2(config-if)#no ip add

R2(config-if)#no shut

R2(config-if)#int f0/0.1

R2(config-subif)#enca

R2(config-subif)#encapsulation dot1q 1

R2(config-subif)#ip add 192.168.1.97 255.255.255.240

R2(config-subif)#no shut

R2(config-subif)#int f0/0.11

R2(config-subif)#encapsulation dot1q 11

R2(config-subif)#ip add 192.168.1.129 255.255.255.192

R2(config-subif)#no sh

R2(config-subif)#int f0/0.12

R2(config-subif)#encapsulation dot1q 12

R2(config-subif)#ip add 192.168.1.193 255.255.255.192

R2(config-subif)#

SW1(config)#int f0/1

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

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

測試vlan間通信

VLAN 11 中的PC2 ping VLAN 12 中的PC5

PC>ping 192.168.1.195

Pinging 192.168.1.195 with 32 bytes of data:

Request timed out.

Reply from 192.168.1.195: bytes=32 time=11ms TTL=127

Reply from 192.168.1.195: bytes=32 time=1ms TTL=127

Ping statistics for 192.168.1.195:

    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),

Approximate round trip times in milli-seconds:

CCNA綜合實驗(一):實驗實作(Ⅱ)

http://shenghao.blog.51cto.com/5890026/1194956