关于LAN网内VLAN与Trunk的详细配置

所属分类: 软件教程 / 网络通讯 阅读数: 1852
收藏 0 赞 0 分享
此实验过程是在Boson NetSim for CCNP version 6.0 BETA 1软件下做的。其中使用2C2905switch4PC机。   实验内容: 1、  配置控制端口和虚拟线路 2、设置VLAN两个,分别为:VLAN100 PcontrolVLAN200 Accout 3、分别将接口加入到VLAN100VLAN200后配置Trunk线路,保证VLAN间的通信 4、最后进行测试是否成功   关于LAN网内VLANTrunk的详细配置      vlan       SW1C2950)交换机测试详细步骤及结果:   CLI session with the switch is open.      To end the CLI session, enter [Exit].         Switch> %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/6, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/7, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/7, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/8, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/9, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/9, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/11, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/11, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/12, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/12, changed state to down Switch>enable Switch#show version   Boson Operating Simulation Software BOSS (tm) C2900 Software (C2900-Enterprise), Version 12.1, RELEASE SOFTWARE Copyright (c) 1998-2003 by Boson Software, Inc.   BOSS ROM: System Bootstrap, Version 12.2, RELEASE SOFTWARE Switch Uptime Is 0 days, 0 hours, 0 minutes System restarted by power-on System image file is ""flash:c2900-enterprise.12.1.boss"", booted via flash Boson 2900 (BOSS) processor (revision 5.0) 12 FastEthernet/IEEE 802.3 interface(s)   32K bytes of simulated non-volatile configuration memory. 8192K bytes of simulated System flash (Read/Write)   Switch# Switch# Switch#show runn ! Version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname Switch ! ! ! ip subnet-zero spanning-tree extend system-id ! ! ! ! ! ! ! ! interface FastEthernet0/1 ! interface FastEthernet0/2 !   Switch#show runn ! Version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname Switch ! ! ! ip subnet-zero spanning-tree extend system-id ! ! ! ! ! ! ! ! interface FastEthernet0/1 ! interface FastEthernet0/2 ! interface FastEthernet0/3 ! interface FastEthernet0/4 ! interface FastEthernet0/5 ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! interface FastEthernet0/8 ! interface FastEthernet0/9 ! interface FastEthernet0/10 ! interface FastEthernet0/11 ! interface FastEthernet0/12 !  vtp domain bigdomain ! interface Vlan 1  no ip address  no ip route-cache ! ! ip classless no ip http server ! ! ! ! line con 0  transport input none line aux 0 line vty 0 15 ! no scheduler allocate end   Switch# Switch# Switch#configure terminal Enter configuration commands, one per line.  End with CNTL/Z. Switch(config)#hostname SW1 SW1(config)#line console 0 SW1(config-line)#exec-timeout 20 0 SW1(config-line)#logging synchronous SW1(config-line)#password dsfeng SW1(config-line)#login SW1(config-line)#line vty 0 15 SW1(config-line)#exec-timeout 15 0 SW1(config-line)#logging synchronous SW1(config-line)#password dsfeng SW1(config-line)#login SW1(config-line)#enable secret cisco SW1(config)#exit SW1# SW1# SW1#vlan database SW1(vlan)#vlan 100 name Pcontrol VLAN 100 added:     Name:Pcontrol SW1(vlan)#vlan 200 name Accout VLAN 200 added:     Name:Accout SW1(vlan)#exit APPLY completed. Exiting.... SW1# SW1# SW1#configure terminal Enter configuration commands, one per line.  End with CNTL/Z. SW1(config)#interface fastethernet 0/2 SW1(config-if)#switchport mode access SW1(config-if)#switchport access vlan 100 SW1(config-if)#exit SW1(config)#interface fastethernet 0/3 SW1(config-if)#switchport mode access SW1(config-if)#switchport access vlan 200 SW1(config-if)#exit SW1(config)#interface fasteterhent 0/10 SW1(config-if)#switchport mode trunk SW1(config-if)#switchport trunk encapsulation dot1q SW1(config-if)#end SW1# SW1# SW1#show interface fastethernet 0/2 FastEthernet0/2 is up, line protocol is up   Hardware is Fast Ethernet, address is 000C.6542.9093 (bia 000C.6542.9093)   MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,      reliability 255/255, txload 1/255, rxload 1/255   Auto-duplex, Auto-speed   Encapsulation ARPA, loopback not set   ARP type: ARPA, ARP Timeout 04:00:00   Last input 02:29:44, output never, output hang never   Last clearing of "show interface" counters never   Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0   Queueing strategy: fifo   Output queue :0/40 (size/max)   5 minute input rate 0 bits/sec, 0 packets/sec   5 minute output rate 0 bits/sec, 0 packets/sec      269 packets input, 71059 bytes, 0 no buffer      Received 6 broadcasts, 0 runts, 0 giants, 0 throttles      0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored      7290 packets output, 429075 bytes, 0 underruns      0 output errors, 3 interface resets      0 output buffer failures, 0 output buffers swapped out   SW1# SW1# SW1#show interface fastethernet 0/3 FastEthernet0/3 is up, line protocol is up   Hardware is Fast Ethernet, address is 000C.3849.2796 (bia 000C.3849.2796)   MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,      reliability 255/255, txload 1/255, rxload 1/255   Auto-duplex, Auto-speed   Encapsulation ARPA, loopback not set   ARP type: ARPA, ARP Timeout 04:00:00   Last input 02:29:44, output never, output hang never   Last clearing of "show interface" counters never   Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0   Queueing strategy: fifo   Output queue :0/40 (size/max)   5 minute input rate 0 bits/sec, 0 packets/sec   5 minute output rate 0 bits/sec, 0 packets/sec      269 packets input, 71059 bytes, 0 no buffer      Received 6 broadcasts, 0 runts, 0 giants, 0 throttles      0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored      7290 packets output, 429075 bytes, 0 underruns      0 output errors, 3 interface resets      0 output buffer failures, 0 output buffers swapped out   SW1# SW1# SW1#show interface fastethernet 0/10 FastEthernet0/10 is up, line protocol is up   Hardware is Fast Ethernet, address is 000C.3878.9745 (bia 000C.3878.9745)   MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,      reliability 255/255, txload 1/255, rxload 1/255   Auto-duplex, Auto-speed   Encapsulation ARPA, loopback not set   ARP type: ARPA, ARP Timeout 04:00:00   Last input 02:29:44, output never, output hang never   Last clearing of "show interface" counters never   Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0   Queueing strategy: fifo   Output queue :0/40 (size/max)   5 minute input rate 0 bits/sec, 0 packets/sec   5 minute output rate 0 bits/sec, 0 packets/sec      269 packets input, 71059 bytes, 0 no buffer      Received 6 broadcasts, 0 runts, 0 giants, 0 throttles      0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored      7290 packets output, 429075 bytes, 0 underruns      0 output errors, 3 interface resets      0 output buffer failures, 0 output buffers swapped out   SW1# SW1# SW1#show vlan   VLAN Name                             Status    Ports ---- -------------------------------- --------- ------------------------------- 1    default                          active    Fa0/1, Fa0/4, Fa0/5, Fa0/6                                                 Fa0/7, Fa0/8, Fa0/9, Fa0/10                                                 Fa0/11, Fa0/12 100  Pcontrol                         active    Fa0/2 200  Accout                           active    Fa0/3 1002 fddi-default                     active 1003 token-ring-default               active 1004 fddinet-default                  active 1005 trnet-default                    active   VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1    enet  100001     1500  -      -      -        -    -        0      0 100  enet  100100     1500  -      -      -        -    -        0      0 200  enet  100200     1500  -      -      -        -    -        0      0 1002 fddi  101002     1500  -      -      -        -    -        0      0 1003 tr    101003     1500  -      -      -        -    -        0      0 1004 fdnet 101004     1500  -      -      -        ieee -        0      0 1005 trnet 101005     1500  -      -      -        ibm  -        0      0     SW1# SW1# SW1#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S -Switch, H - Host, i - IGMP, r - Repeater Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID SW2                 Fas0/10        167           T S      2950      Fas 0/10   SW1# SW1# SW1#show mac-address-table Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S -Switch, H - Host, i - IGMP, r - Repeater Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID SW2                 Fas0/10        167           T S      2950      Fas 0/10             Mac Address Table ------------------------------------------ Vlan    Mac Address       Type       Ports ----    -----------       ----       -----    200    000C.9631.1997    DYNAMIC    Fa0/3    100    000C.7036.8702    DYNAMIC    Fa0/2    1    000C.3817.8412    DYNAMIC    Fa0/10    1    000C.9623.5011    DYNAMIC    Fa0/10    1    000C.1738.3819    DYNAMIC    Fa0/10   Total Mac Addresses for this criterion: 5   SW1# SW1# SW1#show run ! Version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname SW1 enable secret 5 $sdf$6978yhg$jnb76sd ! ! ! ip subnet-zero spanning-tree extend system-id ! ! ! ! ! ! ! ! interface FastEthernet0/1 ! interface FastEthernet0/2  switchport mode access  switchport access vlan 100 ! interface FastEthernet0/3  switchport mode access  switchport access vlan 200 ! interface FastEthernet0/4 ! interface FastEthernet0/5 ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! interface FastEthernet0/8 ! interface FastEthernet0/9 ! interface FastEthernet0/10  switchport mode trunk  switchport trunk encapsulation dot1q ! interface FastEthernet0/11 ! interface FastEthernet0/12 !  vtp domain bigdomain ! interface Vlan 1  no ip address  no ip route-cache ! vlan 100 name Pcontrol vlan 200 name Accout ! ip classless no ip http server ! ! ! ! line con 0  login  transport input none  password dsfeng  exec-timeout 15 0  logging synchronous line aux 0 line vty 0 15  login  password dsfeng ! no scheduler allocate end   SW1# SW1# SW1#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK]   SW1# SW1#     

#p#
  SW2C2950)交换机测试详细步骤及结果:   CLI session with the switch is open.      To end the CLI session, enter [Exit].         %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/6, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/7, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/7, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/8, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/9, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/9, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/11, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/11, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/12, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/12, changed state to down Switch> Switch>enable Switch#show version   Boson Operating Simulation Software BOSS (tm) C2900 Software (C2900-Enterprise), Version 12.1, RELEASE SOFTWARE Copyright (c) 1998-2003 by Boson Software, Inc.   BOSS ROM: System Bootstrap, Version 12.2, RELEASE SOFTWARE Switch Uptime Is 0 days, 0 hours, 5 minutes System restarted by power-on System image file is ""flash:c2900-enterprise.12.1.boss"", booted via flash Boson 2900 (BOSS) processor (revision 5.0) 12 FastEthernet/IEEE 802.3 interface(s)   32K bytes of simulated non-volatile configuration memory. 8192K bytes of simulated System flash (Read/Write)   Switch# Switch# Switch#show runn ! Version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname Switch ! ! ! ip subnet-zero spanning-tree extend system-id ! ! ! ! ! ! ! ! interface FastEthernet0/1 ! interface FastEthernet0/2 ! interface FastEthernet0/3 ! interface FastEthernet0/4 ! interface FastEthernet0/5 ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! interface FastEthernet0/8 ! interface FastEthernet0/9 ! interface FastEthernet0/10 ! interface FastEthernet0/11 ! interface FastEthernet0/12 !  vtp domain bigdomain ! interface Vlan 1  no ip address  no ip route-cache ! ! ip classless no ip http server ! ! ! ! line con 0  transport input none line aux 0 line vty 0 15 ! no scheduler allocate end   Switch# Switch# Switch#configure terminal Enter configuration commands, one per line.  End with CNTL/Z. Switch(config)#hostname SW2 SW2(config)#line console 0 SW2(config-line)#exec-timeout 20 0 SW2(config-line)#logging synchronous SW2(config-line)#password dsfeng SW2(config-line)#login SW2(config-line)#line vty 0 15 SW2(config-line)#exec-timeout 15 0 SW2(config-line)#logging synchronous SW2(config-line)#password dsfeng SW2(config-line)#login SW2(config-line)#enable secret cisco SW2(config)#end SW2# SW2# SW2#vlan database SW2(vlan)#vlan 100 name Pcontrol VLAN 100 added:     Name:Pcontrol SW2(vlan)#vlan 200 name Accout VLAN 200 added:     Name:Accout SW2(vlan)#exit APPLY completed. Exiting.... SW2# SW2# SW2#configure terminal Enter configuration commands, one per line.  End with CNTL/Z. SW2(config)#interface fastethernet 0/2 SW2(config-if)#switchport mode access SW2(config-if)#switchport access vlan 100 SW2(config-if)#exit SW2(config)#interface fastethernet 0/3 SW2(config-if)#switchport mode access SW2(config-if)#switchport access vlan 200 SW2(config-if)#exit SW2(config)#interface fastethernet 0/10 SW2(config-if)#switchport mode trunk SW2(config-if)#switchport trunk encapsulation dot1q SW2(config-if)#end SW2# SW2# SW2#show interface fastethernet 0/2 FastEthernet0/2 is up, line protocol is up   Hardware is Fast Ethernet, address is 000C.2018.9057 (bia 000C.2018.9057)   MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,      reliability 255/255, txload 1/255, rxload 1/255   Auto-duplex, Auto-speed   Encapsulation ARPA, loopback not set   ARP type: ARPA, ARP Timeout 04:00:00   Last input 02:29:44, output never, output hang never   Last clearing of "show interface" counters never   Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0   Queueing strategy: fifo   Output queue :0/40 (size/max)   5 minute input rate 0 bits/sec, 0 packets/sec   5 minute output rate 0 bits/sec, 0 packets/sec      269 packets input, 71059 bytes, 0 no buffer      Received 6 broadcasts, 0 runts, 0 giants, 0 throttles      0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored      7290 packets output, 429075 bytes, 0 underruns      0 output errors, 3 interface resets      0 output buffer failures, 0 output buffers swapped out   SW2# SW2# SW2#show interface fastethernet 0/3 FastEthernet0/3 is up, line protocol is up   Hardware is Fast Ethernet, address is 000C.4287.4991 (bia 000C.4287.4991)   MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,      reliability 255/255, txload 1/255, rxload 1/255   Auto-duplex, Auto-speed   Encapsulation ARPA, loopback not set   ARP type: ARPA, ARP Timeout 04:00:00   Last input 02:29:44, output never, output hang never   Last clearing of "show interface" counters never   Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0   Queueing strategy: fifo   Output queue :0/40 (size/max)   5 minute input rate 0 bits/sec, 0 packets/sec   5 minute output rate 0 bits/sec, 0 packets/sec      269 packets input, 71059 bytes, 0 no buffer      Received 6 broadcasts, 0 runts, 0 giants, 0 throttles      0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored      7290 packets output, 429075 bytes, 0 underruns      0 output errors, 3 interface resets      0 output buffer failures, 0 output buffers swapped out   SW2# SW2# SW2#show interface fastethernet 0/10 FastEthernet0/10 is up, line protocol is up   Hardware is Fast Ethernet, address is 000C.3817.8412 (bia 000C.3817.8412)   MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,      reliability 255/255, txload 1/255, rxload 1/255   Auto-duplex, Auto-speed   Encapsulation ARPA, loopback not set   ARP type: ARPA, ARP Timeout 04:00:00   Last input 02:29:44, output never, output hang never   Last clearing of "show interface" counters never   Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0   Queueing strategy: fifo   Output queue :0/40 (size/max)   5 minute input rate 0 bits/sec, 0 packets/sec  
更多精彩内容其他人还在看

局域网合理布线的六大规则

  网络拓扑结构凌乱、布线过程中偷工减料、设备摆放不合理,别小看这些网络布线时的疏忽大意、有章不循,它们就是一颗颗定时炸弹,随时都会发作,随时都会毁掉你的网络、你的工作。 亡羊补牢?为时已晚,这些问题需要我们提前避免。   如同大厦
收藏 0 赞 0 分享

技巧:对无线局域网进行高效故障诊断

  基于IEEE 802.11标准的WLAN逐渐进入主流网络,使得针对无线网络的故障诊断和安全保障变得与有线网络一样重要。     支持多种模式的分析仪可以扫描所有802.11频段,包括2   .4GHz和5GHz频段中的所有通道,并以图形化的形式显示,从这些图表中
收藏 0 赞 0 分享

巧用WinXP中的“网桥”功能

  当前局域网已经相当普及,经常会遇到以下的状况:    局域网中新增了一台客户机,但集线器端口已接满,为一台电脑增加集线器太不合算。怎么办?Windows XP的“网桥”功能就派上用场了,不过需要一个前提条件,就是局域网中必须有一台安装了双
收藏 0 赞 0 分享

设置防火墙实现禁用QQ,MSN,联众

  现在要求禁止内网用户使用QQ、联众等聊天和网游软件的需求逐渐增多,不久前售后工程师就处理了一项此类业务。工程师在处理过程中发现了一些解决方法,现在进行一下总结,希
收藏 0 赞 0 分享

XP中网络怪异事件解决方法

  未接网线却显示已启用连接   问:Windows XP系统正确识别了新安装的网卡,并安装了驱动程序,在没有连接网线的情况下,网络连接中的“本地连接”显示已启用,并且处于“连接状态”。在接上网线并设置了相应的参数后,进行网络访问,IE显示“无
收藏 0 赞 0 分享

为您支招 局域网内如何防止ARP欺骗

  对于ARP欺骗,提出几点加强安全防范的措施。环境是主机或者网关是基于Linux/BSD的。一、理论前提   本着“不冤枉好人,不放过一个坏人的原则”,先说说我的一些想法和理
收藏 0 赞 0 分享

网管,请别随意关闭默认共享!

  不知道在什么时候,关闭Windows系统中的C$、D$、IPC$等默认共享成为了最基本的安全防范措施,惊弓之鸟们纷纷响应号召,向默认共享宣战。然而存在是有理由的,默认共享的存在同样如此。你可知道盲目地关闭这些默认共享会带来某些非常严重的危害吗
收藏 0 赞 0 分享

网络应用技巧 用注册表强化网上邻居

  每次与内网用户进行信息共享传输时,“网上邻居”就会被派上用场;当然,在默认状态下系统的“网上邻居”功能十分有限,如果你想与内网朋友更高效、更安全地进行共享传输时,就必须想方设法挖掘“网上邻居”自身的潜能。这不,本文为了帮助各位网
收藏 0 赞 0 分享

教你在局域网中映射网络驱动器的使用

  一、为每个学生机建立“映射网络驱动器”   环境为Windows 98对等网。教师机名为“Teacher”,硬盘分成四个区为C、D、E、F;学生机有60台,计算机名为1~60,硬盘分成三个分区C、D、E。   首先在教师机的F盘上建立60个文件夹,文件夹的名字
收藏 0 赞 0 分享

节约成本 详解网络打印机安装方法

  现在很多单位为了节约成本,普遍采取共享使用网络打印机的方法,正巧笔者的单位也要求办公室和其他科室共用办公室的打印机,下面我们一起来看看如何添加网络打印机。   首先,在办公室的计算机上,安装好打印机的驱动,并且把打印机设为共享,
收藏 0 赞 0 分享
查看更多