欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

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

程序员文章站 2022-05-17 19:20:17
关于LAN网内VLAN与Trunk的详细配置...
此实验过程是在boson netsim for ccnp version 6.0 beta 1软件下做的。其中使用2c2905switch4pc机。

 

实验内容:

1、  配置控制端口和虚拟线路

2、设置vlan两个,分别为:vlan100 pcontrolvlan200 accout

3、分别将接口加入到vlan100vlan200后配置trunk线路,保证vlan间的通信

4、最后进行测试是否成功

 

关于lan网内vlantrunk的详细配置

 

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

 

 

 

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 - transbridge, b - sourceroutebridge 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 - transbridge, b - sourceroutebridge 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#