computerの日記

Cisco,SHELL,C,Qt,C++,Linux,ネットワーク,Windows Scriptなどの発言です

Switch の SVI インターフェースの down down を解決する

SWITCH の設定をしていて、SVI インターフェースが up しない、という事がよくあると思います。

この理由について、考え、解決します。

今、以下のようなトポロジを考えます。

f:id:intrajp:20171216114443p:plain

SW1(config)#vlan 111
SW1(config-vlan)#
SW1#show vlan

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et0/0, Et0/1, Et0/2, Et0/3
Et1/0, Et1/1, Et1/2, Et1/3
Et2/0, Et2/1, Et2/2, Et2/3
Et3/0, Et3/1, Et3/2, Et3/3
111 VLAN0111 active
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
111 enet 100111 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

Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------

 

 

SW1(config)#int vlan 111
SW1(config-if)#ip address 1.1.1.111 255.255.255.0
SW1(config-if)#no shut
SW1#show ip int brief


Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset up up
Ethernet0/3 unassigned YES unset up up
...(snip)...
Vlan1 unassigned YES unset administratively down down
Vlan111 1.1.1.111 YES NVRAM down down

 

Vlan 111 のインターフェースを no shut したはずなのに、Status が down、Protocol が down のままです。

これは、Vlan 111 に接続されているインターフェースがないからです。

SW1(config)#int range e0/0 -3
SW1(config-if-range)#switchport access vlan
SW1(config-if-range)#switchport access vlan 111


*Dec 16 09:53:01.364: %LINK-3-UPDOWN: Interface Vlan111, changed state to up
*Dec 16 09:53:02.364: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan111, changed state to up

 

お、アップしたようです。

SW1#show ip int bri


Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset up up
Ethernet0/3 unassigned YES unset up up
...(snip)...
Vlan1 unassigned YES unset up up
Vlan111 1.1.1.111 YES NVRAM up up

 

アップしました。
結局、当該 Vlan にアクセスするポートが 1つ以上ないと、SVI インターフェースは、アップしない、ということのようです。

portfast, uplinkfast, backbonefastその2

このセクションでは、802.1d スパニングツリーのトポロジの変更プロセスとSTPタイマーへの影響を確認します。
SW3 の fa1/0 の portfast 機能を無効にしなさい。
--------

f:id:intrajp:20171205053028p:plain


まずは、現在の設定を確認します。

SW3#show spanning-tree active | begin FastEthernet1/0
Port 41 (FastEthernet1/0) of VLAN3 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.41.
Designated root has priority 8192, address c207.153c.0000
Designated bridge has priority 32768, address c201.1621.0000
Designated port id is 128.41, designated path cost 18
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 4694, received 0
The port is in the portfast mode <--------portfast が有効になっています。

では、fa1/0 上で portfast を無効にします。

SW3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW3(config)#interface fa1/0
SW3(config-if)#no spanning-tree portfast

確認します。
SW3#show spanning-tree interface fa1/0 portfast
VLAN3 disabled

SW3 上で、portfast を無効にしました。portfast を無効にしたので、learning, forwarding, blocking になり、スパニングツリー変更のお知らせを、ルートブリッジ
に送信するはずです。
それを確認します。
SW3 で、デバッグモードにします。そのうえで、fa1/0 をシャットダウンして、トポロジの変更を見てみます。また、fa1/0 を再度有効に(no shut)してみます。

SW3#debug spanning-tree events
Spanning Tree event debugging is on
SW3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW3(config)#interface fa1/0
SW3(config-if)#shutdown
SW3(config-if)#
*Mar 1 03:24:37.159: STP: VLAN3 sent Topology Change Notice on Fa1/15
*Mar 1 03:24:37.159: STP: VLAN3 Fa1/0 -> blocking
SW3(config-if)#
*Mar 1 03:24:39.171: %LINK-5-CHANGED: Interface FastEthernet1/0, changed state to administratively down
*Mar 1 03:24:40.171: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to down
SW3(config-if)#no shutdown
SW3(config-if)#
*Mar 1 03:24:46.759: STP: VLAN3 Fa1/0 -> listening
SW3(config-if)#
*Mar 1 03:24:49.735: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
SW3(config-if)#
*Mar 1 03:25:01.767: STP: VLAN3 Fa1/0 -> learning
SW3(config-if)#
*Mar 1 03:25:16.779: STP: VLAN3 sent Topology Change Notice on Fa1/15
*Mar 1 03:25:16.779: STP: VLAN3 Fa1/0 -> forwarding

では、portfast を有効にして、もう一度やってみます。

SW3(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/0 but will only
have effect when the interface is in a non-trunking mode.

SW3#show spanning-tree active | begin FastEthernet1/0
from FastEthernet1/0
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0, aging 300

Port 41 (FastEthernet1/0) of VLAN3 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.41.
Designated root has priority 8192, address c207.153c.0000
Designated bridge has priority 32768, address c201.1621.0000
Designated port id is 128.41, designated path cost 18
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 129, received 0
The port is in the portfast mode

SW3(config)#interface fa1/0
SW3(config-if)#
SW3(config-if)#
SW3(config-if)#
SW3(config-if)#shutdown
SW3(config-if)#
*Mar 1 03:30:18.591: STP: VLAN3 Fa1/0 -> blocking
SW3(config-if)#
*Mar 1 03:30:20.535: %LINK-5-CHANGED: Interface FastEthernet1/0, changed state to administratively down
*Mar 1 03:30:21.535: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to down
SW3(config-if)#no shutdown
SW3(config-if)#
*Mar 1 03:30:33.683: STP: VLAN3 Fa1/0 ->jump to forwarding from blocking
SW3(config-if)#
*Mar 1 03:30:36.639: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
SW3(config-if)#end
SW3#show s
*Mar 1 03:32:04.683: %SYS-5-CONFIG_I: Configured from console by console
SW3#show spanning-tree vlan 3 brief

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c207.153c.0000
Cost 18
Port 56 (FastEthernet1/15)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 18 32768 c201.1621.0000 128.41
...

デバッグモードを元に戻します。
SW3#undebug all

お疲れさまです。次回をお楽しみに。

portfast, uplinkfast, backbonefast

このタスクでは、STPトポロジにおける速いコンバージェンスを実現するオプションのスパニングツリー機能を設定する。
それぞれのスイッチ上のただ一つのスパニングツリー命令により、どんなアクセススイッチポートがオンラインになる時、スパニングツリーのリスニング、ラーニング状態を省略して、
直接フォワーディンぐ状態になること。
スイッチ2上のただ一つのスパニングツリー命令により、 ルートポートが物理的に失われた場合、1、2秒で新なルートポートが回復されること。
それぞれのスイッチ上のただ一つのスパニングツリー命令により、指定ポートの関節リンクが失われた時に、およそ 30秒でスパニングツリートポロジのコンバージェンスが回復すること。

上記をすべて検証すること。

 

f:id:intrajp:20171205053028p:plain

 

GNS3 では、spanning-tree uplinkfast と、spanning-tree backbonefast は有効だが、spanning-tree portfast は、
それぞれのインタフェースにおいて有効にする必要があります。

SW2#conf t
*Mar 1 01:36:08.175: %SYS-5-CONFIG_I: Configured from console by console
SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#int range fa1/0 - 15 , po1
SW2(config-if-range)#spann
SW2(config-if-range)#spanning-tree ?
cost Change an interface's spanning tree path cost
port-priority Change an interface's spanning tree priority
portfast Enable an interface to move directly to forwarding on link up
vlan VLAN Switch Spanning Tree

SW2(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/0 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/1 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/2 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/3 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/4 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/5 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/6 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/7 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/8 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/9 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/10 but will only
have effect when the interface
*Mar 1 01:36:47.411: %EC-5-UNBUNDLE: Interface Fa1/10 left the port-channel Po1
*Mar 1 01:36:47.483: STP FAST: UPLINKFAST: make_forwarding on VLAN1 Port-channel1 root port id new: 129.65 prev: 128.47

*Mar 1 01:36:47.487: %SPANTREE_FAST-7-PORT_FWD_UPLINK: VLAN1 Port-channel1 moved to Forwarding (UplinkFast).
*Mar 1 01:36:47.535: STP FAST: UPLINKFAST: make_forwarding on VLAN1 FastEthernet1/6 root port id new: 128.47 prev: 129.65

*Mar 1 01:36:47.535: %EC-5-BUNDLE: Interface Fa1/10 joined port-channel Po1
*Mar 1 01:36:47.535: STP FAST: UPLINKFAST: make_forwarding on VLAN1 Port-channel1 root port id new: 129.65 prev: 128.47

*Mar 1 01:36:47.563: STP FAST: UPLINKFAST: make_forwarding on VLAN1 FastEthernet1/6 root port id new: 128.47 prev: 129.65
is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/11 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/12 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has
*Mar 1 01:36:52.791: %EC-5-UNBUNDLE: Interface Fa1/11 left the port-channel Po1
*Mar 1 01:36:52.831: STP FAST: UPLINKFAST: make_forwarding on VLAN1 Port-channel1 root port id new: 129.65 prev: 128.47

*Mar 1 01:36:52.831: %SPANTREE_FAST-7-PORT_FWD_UPLINK: VLAN1 Port-channel1 moved to Forwarding (UplinkFast).
*Mar 1 01:36:52.831: STP FAST: UPLINKFAST: make_forwarding on VLAN1 FastEthernet1/6 root port id new: 128.47 prev: 129.65

*Mar 1 01:36:52.831: %EC-5-BUNDLE: Interface Fa1/11 joined port-channel Po1
*Mar 1 01:36:52.831: STP FAST: UPLINKFAST: make_forwarding on VLAN1 Port-channel1 root port id new: 129.65 prev: 128.47

*Mar 1 01:36:52.831: STP FAST: UPLINKFAST: make_forwarding on VLAN1 FastEthernet1/6 root port id new: 128.47 prev: 129.65

*Mar 1 01:36:52.883: %EC-5-UNBUNDLE: Interface Fa1/12 left the port-channel Po1
*Mar 1 01:36:52.883: STP FAST: UPLINKFAST: make_forwarding on VLAN1 Port-channel1 root port id new: 129.65 prev: 128.47

*Mar 1 01:36:52.883: STP FAST: UPLINKFAST: make_forwarding on VLAN1 FastEthernet1/6 root port id new: 128.47 prev: 129.65

*Mar 1 01:36:52.883: %EC-5-BUNDLE: Interface Fa1/12 joined port-channel Po1
*Mar 1 01:36:52.923: STP FAST: UPLINKFAST: make_forwarding on VLAN1 Port-channel1 root port id new: 129.65 prev: 128.47

*Mar 1 01:36:52.935: STP FAST: UPLINKFAST: make_forwarding on VLAN1 FastEthernet1/6 root port id new: 128.47 prev: 129.65
been configured on FastEthernet1/13 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/14 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/15 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on Port-channel1 but will only
have effect when the interface is in a non-trunking mode.

SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#interface range fa1/0 - 15 , po1
SW1(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/0 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/1 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/2 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/3 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/4 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/5 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/6 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/7 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/8 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/9 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/10 but will only
have effect when the interface is in a non-tru
*Mar 1 01:40:00.591: %EC-5-UNBUNDLE: Interface Fa1/10 left the port-channel Po1
*Mar 1 01:40:00.687: %EC-5-BUNDLE: Interface Fa1/10 joined port-channel Po1nking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/11 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/12 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast
*Mar 1 01:40:03.927: %EC-5-UNBUNDLE: Interface Fa1/11 left the port-channel Po1
*Mar 1 01:40:04.027: %EC-5-BUNDLE: Interface Fa1/11 joined port-channel Po1
*Mar 1 01:40:04.027: %EC-5-UNBUNDLE: Interface Fa1/12 left the port-channel Po1
*Mar 1 01:40:04.027: %EC-5-BUNDLE: Interface Fa1/12 joined port-channel Po1 has been configured on FastEthernet1/13 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/14 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/15 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on Port-channel1 but will only
have effect when the interface is in a non-trunking mode.

SW3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW3(config)#int range fa1/0 - 15
SW3(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/0 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/1 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/2 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/3 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/4 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/5 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/6 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/7 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/8 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/9 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/10 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/11 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/12 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/13 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/14 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION

%Portfast has been configured on FastEthernet1/15 but will only
have effect when the interface is in a non-trunking mode.

ーーーーーーーーーーーーーーーーーーーーーー
SW3# show spanning-tree active
...(snip)...
Port 41 (FastEthernet1/0) of VLAN3 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.41.
Designated root has priority 8192, address c207.153c.0000
Designated bridge has priority 32768, address c201.1621.0000
Designated port id is 128.41, designated path cost 18
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 3196, received 0
The port is in the portfast mode <---portfast モードになっている

SW2# show spanning-tree active
...(snip)...
Port 41 (FastEthernet1/0) of VLAN3 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.41.
Designated root has priority 8192, address c207.153c.0000
Designated bridge has priority 8192, address c207.153c.0000
Designated port id is 128.41, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 3376, received 0
The port is in the portfast mode

Port 45 (FastEthernet1/4) of VLAN4 is forwarding
Port path cost 3019, Port priority 128, Port Identifier 128.45.
Designated root has priority 8192, address c206.152d.0000
Designated bridge has priority 49152, address c207.153c.0001
Designated port id is 128.45, designated path cost 37
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 3391, received 0
The port is in the portfast mode

SW1# show spanning-tree active
...(snip)...
Port 41 (FastEthernet1/0) of VLAN4 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.41.
Designated root has priority 8192, address c206.152d.0000
Designated bridge has priority 8192, address c206.152d.0000
Designated port id is 128.41, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 3539, received 0
The port is in the portfast mode

SW2#show spanning-tree summary
Root bridge for: VLAN3.
PortFast BPDU Guard is disabled
UplinkFast is enabled <------------------uplinkfast が有効になっている
BackboneFast is disabled

Name Blocking Listening Learning Forwarding STP Active
-------------------- -------- --------- -------- ---------- ----------
VLAN1 3 0 0 1 4
VLAN3 0 0 0 5 5
VLAN4 3 0 0 2 5
-------------------- -------- --------- -------- ---------- ----------
3 VLANs 6 0 0 8 14

Station update rate set to 150 packets/sec.

UplinkFast statistics
-----------------------
Number of transitions via uplinkFast (all VLANs) : 18
Number of proxy multicast addresses transmitted (all VLANs) : 0

SW2#show spanning-tree uplinkfast
UplinkFast is enabled

Station update rate set to 150 packets/sec.

UplinkFast statistics
-----------------------
Number of transitions via uplinkFast (all VLANs) : 18
Number of proxy multicast addresses transmitted (all VLANs) : 0

Name Interface List
-------------------- ------------------------------------
VLAN1 Fa1/6(fwd), Fa1/7, Fa1/8, Po1
VLAN3
VLAN4 Fa1/8(fwd), Fa1/6, Fa1/7, Po1

SW1#show spanning-tree summary
Root bridge for: VLAN4.
PortFast BPDU Guard is disabled
UplinkFast is disabled
BackboneFast is enabled <----------------------backbonefast が有効になっている

Name Blocking Listening Learning Forwarding STP Active
-------------------- -------- --------- -------- ---------- ----------
VLAN1 2 0 0 2 4
VLAN3 0 0 0 4 4
VLAN4 0 0 0 5 5
-------------------- -------- --------- -------- ---------- ----------
3 VLANs 2 0 0 11 13

BackboneFast statistics
-----------------------
Number of transition via backboneFast (all VLANs) : 0
Number of inferior BPDUs received (all VLANs) : 0
Number of RLQ request PDUs received (all VLANs) : 0
Number of RLQ response PDUs received (all VLANs) : 0
Number of RLQ request PDUs sent (all VLANs) : 0
Number of RLQ response PDUs sent (all VLANs) : 0

SW1#show spanning-tree backbonefast
BackboneFast is enabled

BackboneFast statistics
-----------------------
Number of transition via backboneFast (all VLANs) : 0
Number of inferior BPDUs received (all VLANs) : 0
Number of RLQ request PDUs received (all VLANs) : 0
Number of RLQ response PDUs received (all VLANs) : 0
Number of RLQ request PDUs sent (all VLANs) : 0
Number of RLQ response PDUs sent (all VLANs) : 0

お疲れさまです。次回をお楽しみに。

 

STPトポロジ-3(パスコスト変更による通信経路の変更2)

このタスクでは、802.1d PVST Spanning-Tree コマンドにより、VLAN-4 の通信経路を操ります。
このタスクが完遂されれば、PC1 から PC2 への VLAN-4 の ping による通信経路は、PC1-->SW2-->SW3-->SW1-->PC2 となる。

ただ一つのスイッチ上の spanning-tree コマンドが、SW3 が、fa1/14をVLAN-4 のルートポートとすることを選択するようにしなさい。
どのスイッチ上のポートコストも変更してはならない。
どのインタフェースも閉鎖してはならない。
ルートブリッジを変更してはならない。
2つ以上のコマンドを使用して、SW2 が fa1/8 を、VLAN-4 のためのルートポートとなるようにせよ。
どのインタフェースも閉鎖してはならない。
ルートブリッジを変更してはならない。

このタスクが完遂されたら、VLAN-4 のスパニングツリーは、PC1-->SW2(fa1/8)-->SW3(fa1/8)-->SW3(fa1/14)-->SW1(fa1/14)-->PC2 となるようになる。

 

トポロジは、以下を使います。

f:id:intrajp:20171205053028p:plain

 

--------
まず、それぞれのスイッチで、VLAN-4 のスパニングツリーを確認しておく。

SW1#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c206.152d.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c206.152d.0002 128.41
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 128.55 128 19 FWD 0 8192 c206.152d.0002 128.55
FastEthernet1/15 128.56 128 19 FWD 0 8192 c206.152d.0002 128.56
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 9
Port 321 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 9 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 FWD 9 32768 c207.153c.0002 128.47
FastEthernet1/7 128.48 128 19 FWD 9 32768 c207.153c.0002 128.48
FastEthernet1/8 128.49 128 19 FWD 9 32768 c207.153c.0002 128.49
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW3#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 19
Port 54 (FastEthernet1/13)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/6 128.47 128 19 BLK 9 32768 c207.153c.0002 128.47
FastEthernet1/7 128.48 128 19 BLK 9 32768 c207.153c.0002 128.48
FastEthernet1/8 128.49 128 19 BLK 9 32768 c207.153c.0002 128.49
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 128.55 128 19 BLK 0 8192 c206.152d.0002 128.55
FastEthernet1/15 128.56 128 19 BLK 0 8192 c206.152d.0002 128.56

ここで、SW3 の fa1/14 はブロッキングであり、fa1/13 がフォーワディングとなっている。これを、fa1/14 がフォーワディングになるようにするには、
ポートプライオリティを下げればよいと考えられる。ポートプライオリティは、16の倍数で増える。なので、128 -16 の、112 にすればよいと考える。
ここで、SW3 の peer で実行する必要がある。したがって、SW1 上で、以下のコマンドを発行する。

SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#interface fa1/14
SW1(config-if)#end
SW1#d
*Mar 1 09:36:00.577: %SYS-5-CONFIG_I: Configured from console by console
SW1#debug spanning-tree eve
SW1#debug spanning-tree events
Spanning Tree event debugging is on
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#interface fa1/14
SW1(config-if)#spanning-tree vlan 4 port-pri
SW1(config-if)#spanning-tree vlan 4 port-priority 112
SW1(config-if)#
*Mar 1 09:36:43.745: STP: VLAN4 Topology Change rcvd on Fa1/14
SW1(config-if)#
*Mar 1 09:37:13.781: STP: VLAN4 Topology Change rcvd on Fa1/14

SW1#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c206.152d.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c206.152d.0002 128.41
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 112.55 112 19 FWD 0 8192 c206.152d.0002 112.55
FastEthernet1/15 128.56 128 19 FWD 0 8192 c206.152d.0002 128.56
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW3 の fa1/14 がフォワードとなってくれたか確認する。
(省略)
なってくれた。

次に、SW2-SW1 間のコストを上げてみる。今、SW2-SW1 間はポートチャネルになっており、そのパスコストは 9 である。
このパスを通させたくないので、SW2-SW3-SW1 とさせるには、そのパスコスト 19 + 19 = 38 より大きい 39 とすれば
よさそうである。

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 9
Port 321 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 9 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 FWD 9 32768 c207.153c.0002 128.47
FastEthernet1/7 128.48 128 19 FWD 9 32768 c207.153c.0002 128.48
FastEthernet1/8 128.49 128 19 FWD 9 32768 c207.153c.0002 128.49
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW2 上で、以下のコマンドを発行する。
SW2#debug spanning-tree events
Spanning Tree event debugging is on
SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#interface port
SW2(config)#interface port-channel 1
SW2(config-if)#spanning-tree vlan 4 cost 39
SW2(config-if)#
*Mar 1 09:13:24.681: STP: VLAN4 new root port Fa1/6, cost 38
*Mar 1 09:13:24.685: STP: VLAN4 sent Topology Change Notice on Fa1/6
*Mar 1 09:13:24.729: STP: VLAN4 Po1 -> blocking
*Mar 1 09:13:24.729: STP: VLAN4 Fa1/7 -> blocking
*Mar 1 09:13:24.781: STP: VLAN4 Fa1/8 -> blocking

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 38
Port 47 (FastEthernet1/6)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 38 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 FWD 19 32768 c201.1621.0002 128.47
FastEthernet1/7 128.48 128 19 BLK 19 32768 c201.1621.0002 128.48
FastEthernet1/8 128.49 128 19 BLK 19 32768 c201.1621.0002 128.49
Port-channel1 129.65 128 39 BLK 0 8192 c206.152d.0002 129.65

SW3 では、以下のようになった。

SW3#
*Mar 1 09:13:23.941: STP: VLAN4 Fa1/6 -> listening
*Mar 1 09:13:23.985: STP: VLAN4 Fa1/7 -> listening
*Mar 1 09:13:24.041: STP: VLAN4 Fa1/8 -> listening
*Mar 1 09:13:24.877: STP: VLAN4 Topology Change rcvd on Fa1/6
*Mar 1 09:13:24.877: STP: VLAN4 sent Topology Change Notice on Fa1/13
SW3#
*Mar 1 09:13:38.949: STP: VLAN4 Fa1/6 -> learning
*Mar 1 09:13:38.985: STP: VLAN4 Fa1/7 -> learning
*Mar 1 09:13:39.049: STP: VLAN4 Fa1/8 -> learning
SW3#
*Mar 1 09:13:53.957: STP: VLAN4 sent Topology Change Notice on Fa1/13
*Mar 1 09:13:53.957: STP: VLAN4 Fa1/6 -> forwarding
*Mar 1 09:13:53.997: STP: VLAN4 sent Topology Change Notice on Fa1/13
*Mar 1 09:13:53.997: STP: VLAN4 Fa1/7 -> forwarding
*Mar 1 09:13:54.057: STP: VLAN4 Fa1/8 -> forwarding

最後に、SW2 上で fa1/8 がフォワードになるようにします。

SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#interface fa1/8
SW2(config-if)#spanning-tree vlan 4 cost 18
SW2(config-if)#
*Mar 1 09:31:42.257: STP: VLAN4 new root port Fa1/8, cost 37
*Mar 1 09:31:42.257: STP: VLAN4 sent Topology Change Notice on Fa1/8
*Mar 1 09:31:42.305: STP: VLAN4 Fa1/6 -> blocking
*Mar 1 09:31:42.305: STP: VLAN4 Fa1/8 -> listening
SW2(config-if)#
*Mar 1 09:31:57.313: STP: VLAN4 Fa1/8 -> learning
SW2(config-if)#
*Mar 1 09:32:12.321: STP: VLAN4 sent Topology Change Notice on Fa1/8
*Mar 1 09:32:12.325: STP: VLAN4 Fa1/8 -> forwarding

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 37
Port 49 (FastEthernet1/8)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 37 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 BLK 19 32768 c201.1621.0002 128.47
FastEthernet1/7 128.48 128 19 BLK 19 32768 c201.1621.0002 128.48
FastEthernet1/8 128.49 128 18 FWD 19 32768 c201.1621.0002 128.49
Port-channel1 129.65 128 39 BLK 0 8192 c206.152d.0002 129.65

SW3、SW1 の VLAN-4 のスパニングツリーも、もう一度確認する。

SW3#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 19
Port 55 (FastEthernet1/14)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/6 128.47 128 19 FWD 19 32768 c201.1621.0002 128.47
FastEthernet1/7 128.48 128 19 FWD 19 32768 c201.1621.0002 128.48
FastEthernet1/8 128.49 128 19 FWD 19 32768 c201.1621.0002 128.49
FastEthernet1/13 128.54 128 19 BLK 0 8192 c206.152d.0002 128.54
FastEthernet1/14 128.55 128 19 FWD 0 8192 c206.152d.0002 112.55
FastEthernet1/15 128.56 128 19 BLK 0 8192 c206.152d.0002 128.56

SW1#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c206.152d.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c206.152d.0002 128.41
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 112.55 112 19 FWD 0 8192 c206.152d.0002 112.55
FastEthernet1/15 128.56 128 19 FWD 0 8192 c206.152d.0002 128.56
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

これを読めば、PC1-->SW2(fa1/8)-->SW3(fa1/8)-->SW3(fa1/14)-->SW1(fa1/14)-->PC2 となる
のがわかる。

お疲れさまです。次回をお楽しみに。

STPトポロジ-3(パスコスト変更による通信経路の変更1)

このタスクでは、802.1d PVST Spanning-Tree VLAN-3 のある特定のパスを操ることによって、VLAN-3 に所属する R2 から R3 へのトラフィックping)を、SW3-->SW2 の経路ではなく、SW3-->SW1-->SW2 の経路を通るようにしなさい。

ただ一つのコマンドを、ただ一つのスイッチ上で、上記を実現させなさい。
SW3 から SW1 へのトラフィックは、Fa1/15 上で行いなさい。SW1 と SW2 との間で、EtherChannel のどのリンクがフレームの送信に使用されるかは、はっきりとしない。
このタスクを完遂するために、ルートブリッジの設定を変更することは許されない。

トポロジは、以下を使います。

f:id:intrajp:20171205031524p:plain

--------
現在のコストを確認すると、SW2 がルートブリッジで、SW3 は、SW2 と直接繋がっているので、パスコストは、19である事が分かる。
SW3 fa1/15-->SW1 fa1/15-->SW2 という経路にするためには、SW3-->SW2 のパスコスト 19 より小さいパスコストをとればよい。
したがって、総パスコストを、18にすれば、実現できるはずである。ここで、SW2 と SW1 のポートチャネルのパスコストを確認すると、
9 となっている。したがって、SW3 fa1/15 のパスコストを 9 にすれば、良いと思われる。

SW2#show spanning-tree vlan 3 brief

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c207.153c.0000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c207.153c.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c207.153c.0000 128.41
FastEthernet1/6 128.47 128 19 FWD 0 8192 c207.153c.0000 128.47
FastEthernet1/7 128.48 128 19 FWD 0 8192 c207.153c.0000 128.48
FastEthernet1/8 128.49 128 19 FWD 0 8192 c207.153c.0000 128.49
Port-channel1 129.65 128 9 FWD 0 8192 c207.153c.0000 129.65

SW3#show spanning-tree vlan 3 brief

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c207.153c.0000
Cost 19
Port 47 (FastEthernet1/6)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 19 32768 c201.1621.0000 128.41
FastEthernet1/6 128.47 128 19 FWD 0 8192 c207.153c.0000 128.47
FastEthernet1/7 128.48 128 19 BLK 0 8192 c207.153c.0000 128.48
FastEthernet1/8 128.49 128 19 BLK 0 8192 c207.153c.0000 128.49
FastEthernet1/13 128.54 128 19 BLK 9 32768 c206.152d.0001 128.54
FastEthernet1/14 128.55 128 19 BLK 9 32768 c206.152d.0001 128.55
FastEthernet1/15 128.56 128 19 BLK 9 32768 c206.152d.0001 128.56

SW1#show spanning-tree vlan 3 brief

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c207.153c.0000
Cost 9
Port 321 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c206.152d.0001
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/13 128.54 128 19 FWD 9 32768 c206.152d.0001 128.54
FastEthernet1/14 128.55 128 19 FWD 9 32768 c206.152d.0001 128.55
FastEthernet1/15 128.56 128 19 FWD 9 32768 c206.152d.0001 128.56
Port-channel1 129.65 128 9 FWD 0 8192 c207.153c.0000 129.65


では、コマンドを発行してみる。

SW3#conf t
SW3(config)#interface fa1/15
SW3(config-if)#spanning-tree vlan 3 cost 9

SW3#show spanning-tree vlan 3 brief

SW3 上で、fa1/6 がブロッキングになり、fa1/15 がフォワードになりました。

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c207.153c.0000
Cost 18
Port 56 (FastEthernet1/15)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 18 32768 c201.1621.0000 128.41
FastEthernet1/6 128.47 128 19 BLK 0 8192 c207.153c.0000 128.47
FastEthernet1/7 128.48 128 19 BLK 0 8192 c207.153c.0000 128.48
FastEthernet1/8 128.49 128 19 BLK 0 8192 c207.153c.0000 128.49
FastEthernet1/13 128.54 128 19 BLK 9 32768 c206.152d.0001 128.54
FastEthernet1/14 128.55 128 19 BLK 9 32768 c206.152d.0001 128.55
FastEthernet1/15 128.56 128 9 FWD 9 32768 c206.152d.0001 128.56

ここで、目で見て確認したいと考えたのですが、いいコマンドがあります。
以下の debug コマンドで、spanning-tree の イベントを観察できます。

# debug spannin-tree events

停止するには、頭に no をつけます。

# no debug spanning-tree events

では、一度、SW3 の fa1/15 のパスコストを 19 に戻しておきます。

SW3(config-if)#spanning-tree vlan 3 cost 19

デバッグモードで、spanning-tree events を観察する設定にします。

SW3#debug spanning-tree events
Spanning Tree event debugging is on

では、もう一度、SW3 の fa1/15 のパスコストを 9 にして、また 19 に戻す、というのをやってみます。

SW3(config-if)#spanning-tree vlan 3 cost 9
SW3(config-if)#
*Mar 1 07:23:14.710: STP: VLAN3 new root port Fa1/15, cost 18
*Mar 1 07:23:14.710: STP: VLAN3 sent Topology Change Notice on Fa1/15
*Mar 1 07:23:14.762: STP: VLAN3 Fa1/6 -> blocking
*Mar 1 07:23:14.762: STP: VLAN3 Fa1/15 -> listening
SW3(config-if)#
*Mar 1 07:23:29.762: STP: VLAN3 Fa1/15 -> learning
SW3(config-if)#
*Mar 1 07:23:44.770: STP: VLAN3 sent Topology Change Notice on Fa1/15
*Mar 1 07:23:44.774: STP: VLAN3 Fa1/15 -> forwarding
SW3(config-if)#spanning-tree vlan 3 cost 19
SW3(config-if)#
*Mar 1 07:24:43.122: STP: VLAN3 new root port Fa1/6, cost 19
*Mar 1 07:24:43.158: STP: VLAN3 Fa1/6 -> listening
*Mar 1 07:24:43.158: STP: VLAN3 sent Topology Change Notice on Fa1/6
*Mar 1 07:24:43.158: STP: VLAN3 Fa1/15 -> blocking
SW3(config-if)#
*Mar 1 07:24:58.166: STP: VLAN3 Fa1/6 -> learning
SW3(config-if)#
*Mar 1 07:25:13.174: STP: VLAN3 sent Topology Change Notice on Fa1/6
*Mar 1 07:25:13.178: STP: VLAN3 Fa1/6 -> forwarding

30秒で変更されたようです。戻す時も同じでした。

デバッグモードを戻します。

SW3#no debug spanning-tree events
Spanning Tree event debugging is off

お疲れさまです。次回をお楽しみに。

STPトポロジ-2(ROOT BRIDGE の変更)

このタスクにおいては、あらかじめ設定されたスイッチに対して、802.1d PVST Spanning-Tree パラメータを操って、
特定の VLAN において、Spanning-Tree Root Bridge の役割を持たせます。

(タスク)

Switch-2 が、VLAN-3 において、ブリッジプライオリティ 8192 になるようなコマンドを発行しなさい。
Switch-1 が、VLAN-4 において、ブリッジプライオリティ 8192 になるようなコマンドを発行しなさい。

 

基本設定を、以下のリンクにしたがっておこなう。
http://intrajp-computer.hatenadiary.jp/entry/2017/12/03/231614

 

spanning-tree を確認する。

SW1#show spanning-tree vlan 3 brief

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c201.1621.0000
Cost 19
Port 54 (FastEthernet1/13)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c206.152d.0001
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/13 128.54 128 19 FWD 0 32768 c201.1621.0000 128.54
FastEthernet1/14 128.55 128 19 BLK 0 32768 c201.1621.0000 128.55
FastEthernet1/15 128.56 128 19 BLK 0 32768 c201.1621.0000 128.56
Port-channel1 129.65 128 9 FWD 19 32768 c206.152d.0001 129.65


SW2#show spanning-tree vlan 3 brief

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c201.1621.0000
Cost 28
Port 321 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 28 32768 c207.153c.0000 128.41
Port-channel1 129.65 128 9 FWD 19 32768 c206.152d.0001 129.65


SW3#show spanning-tree vlan 3 brief

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c201.1621.0000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 32768 c201.1621.0000 128.41
FastEthernet1/6 128.47 128 19 FWD 0 32768 c201.1621.0000 128.47
FastEthernet1/7 128.48 128 19 FWD 0 32768 c201.1621.0000 128.48
FastEthernet1/8 128.49 128 19 FWD 0 32768 c201.1621.0000 128.49
FastEthernet1/13 128.54 128 19 FWD 0 32768 c201.1621.0000 128.54
FastEthernet1/14 128.55 128 19 FWD 0 32768 c201.1621.0000 128.55
FastEthernet1/15 128.56 128 19 FWD 0 32768 c201.1621.0000 128.56

現在のところ、root bridge は、SW3 のようだ。
では、以下のコマンドを発行します。
Switch-2 が、VLAN-3 において、ブリッジプライオリティ 8192 になるようなコマンドを発行しなさい。

SW2(config)#spanning-tree vlan 3 priority 8192
確認します。SW2がルート・ブリッジになったことがわかります。
SW2#show spanning-tree vlan 3 brief

VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c207.153c.0000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c207.153c.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c207.153c.0000 128.41
Port-channel1 129.65 128 9 FWD 0 8192 c207.153c.0000 129.65

では、トポロジに基づいて、VLAN 4 も作成しましょう。
まず、PC1,PC2を、それぞれ、SW2、SW1に接続します。
それぞれで、dhcp でアドレスを取得してみます。

PC1>dhcp
DDD
Can't find dhcp server

PC2>dhcp
DDD
Can't find dhcp server

できません。
SW1 に vlan 4 を設定して、トランクやスイッチポートを適切に設定して、IP アドレスを取得できました。
PC1> dhcp
DORA IP 4.4.4.2/24 GW 4.4.4.1
PC2> dhcp
DORA IP 4.4.4.3/24 GW 4.4.4.1

では、現在の STP を確認します。

SW1#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c201.1621.0002
Cost 19
Port 54 (FastEthernet1/13)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c206.152d.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 19 32768 c206.152d.0002 128.41
FastEthernet1/13 128.54 128 19 FWD 0 32768 c201.1621.0002 128.54
FastEthernet1/14 128.55 128 19 BLK 0 32768 c201.1621.0002 128.55
FastEthernet1/15 128.56 128 19 BLK 0 32768 c201.1621.0002 128.56
Port-channel1 129.65 128 9 FWD 19 32768 c206.152d.0002 129.65

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c201.1621.0002
Cost 19
Port 47 (FastEthernet1/6)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 19 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 FWD 0 32768 c201.1621.0002 128.47
FastEthernet1/7 128.48 128 19 BLK 0 32768 c201.1621.0002 128.48
FastEthernet1/8 128.49 128 19 BLK 0 32768 c201.1621.0002 128.49
Port-channel1 129.65 128 9 BLK 19 32768 c206.152d.0002 129.65

SW3#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c201.1621.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/6 128.47 128 19 FWD 0 32768 c201.1621.0002 128.47
FastEthernet1/7 128.48 128 19 FWD 0 32768 c201.1621.0002 128.48
FastEthernet1/8 128.49 128 19 FWD 0 32768 c201.1621.0002 128.49
FastEthernet1/13 128.54 128 19 FWD 0 32768 c201.1621.0002 128.54
FastEthernet1/14 128.55 128 19 FWD 0 32768 c201.1621.0002 128.55
FastEthernet1/15 128.56 128 19 FWD 0 32768 c201.1621.0002 128.56

ここで、タスクを実行します。

Switch-1 が、VLAN-4 において、ブリッジプライオリティ 8192 になるようなコマンドを発行しなさい。

SW1(config)#spanning-tree vlan 4 priority 8192

SW1#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c206.152d.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c206.152d.0002 128.41
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 128.55 128 19 FWD 0 8192 c206.152d.0002 128.55
FastEthernet1/15 128.56 128 19 FWD 0 8192 c206.152d.0002 128.56
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 9
Port 321 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 9 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 FWD 9 32768 c207.153c.0002 128.47
FastEthernet1/7 128.48 128 19 FWD 9 32768 c207.153c.0002 128.48
FastEthernet1/8 128.49 128 19 FWD 9 32768 c207.153c.0002 128.49
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW3#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 19
Port 54 (FastEthernet1/13)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/6 128.47 128 19 BLK 9 32768 c207.153c.0002 128.47
FastEthernet1/7 128.48 128 19 BLK 9 32768 c207.153c.0002 128.48
FastEthernet1/8 128.49 128 19 BLK 9 32768 c207.153c.0002 128.49
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 128.55 128 19 BLK 0 8192 c206.152d.0002 128.55
FastEthernet1/15 128.56 128 19 BLK 0 8192 c206.152d.0002 128.56

SW1 が、ROOT BRIDGE になりました。

f:id:intrajp:20171205031220p:plain

 

STPトポロジ-1(準備編)

お疲れさまです。

Cisco Switch を、GNS3 でエミュレートするシリーズです。

今回は、STP を実験しますが、先ずは、必要な機器を設定して、準備します。

以下のようなトポロジになります。スイッチには、3725 の NM-16ESW を使っています。ルータは、7200 です。

SW1をVTPサーバにして、設定を伝搬させます。また、DHCPサーバとして動作させ、アドレスをルータに配布します。Cisco機器のDHCPは、細かい設定がにがてみたいですけど。まあ、それが本位ではないので、ここでは、目をつぶりましょう。

トランクの設定や、スイッチポートにVLANを設定するのを忘れないように。また、ポートチャネルを設定しているので、その設定も覚えましょう。ここに書いてある設定ができたら、次に進んでいきます。

f:id:intrajp:20171203231231p:plain

・ホストネームの設定(各端末)

(一例)

SW1(config)#hostname SW1

SW2(config)#hostname SW2

SW3(config)#hostname SW3

 

・enable password 設定(各端末)

(一例)

SW1(config)#enable password cisco

SW2(config)#enable password cisco

SW3(config)#enable password cisco

 

telnet のパスワード設定(各端末)

(一例)

SW1(config)#line vty 0 5

SW1(config-line)password cisco

SW2(config)#line vty 0 5

SW2(config-line)password cisco

SW3(config)#line vty 0 5

SW3(config-line)password cisco

 

・管理 VLAN の設定

VLAN1 Management

SVI Sw1:1.1.1.1/24

SVI Sw2:1.1.1.2/24

SVI Sw3:1.1.1.3/24

(一例)

SW1#configure terminal

SW1(config)#interface vlan1

SW1(config-if)#ip address 1.1.1.1 255.255.255.0

SW1(config)#no shutdown

SW2#configure terminal

SW2(config)#interface vlan1

SW2(config-if)#ip address 1.1.1.2 255.255.255.0

SW2(config)#no shutdown

SW3#configure terminal

SW3(config)#interface vlan1

SW3(config-if)#ip address 1.1.1.3 255.255.255.0

SW3(config)#no shutdown

 

・VTPの設定

VTP DOMAIN cisco

VTP PASSWORD cisco

(一例)

SW1(config)#vtp version 2

SW1(config)#vtp mode server

SW1(config)#vtp domain cisco

SW2(config)#vtp version 2

SW2(config)#vtp domain cisco

SW2(config)#vtp password cisco

SW2(config)#vtp mode client

SW3(config)#vtp version 2

SW3(config)#vtp domain cisco

SW3(config)#vtp password cisco

SW3(config)#vtp mode client

 

・VLANの作成

(一例:SW1 だけで作成し、他のSWに伝搬する)

SW1#vlan database

SW1(vlan)#vlan 3

SW1(vlan)#exit

 

・ポートチャネルの設定

トポロジ参照

(一例)

SW1(config)#interface range fa1/10 - 12

SW1(config-if-range)#shutdown

SW1(config-if-range)#channel-protocol pagp

SW1(config-if-range)#channel-group 1 mode desireble (on)

SW1(config-if-range)#no shutdown

SW2(config)#interface range fa1/10 - 12

SW2(config-if-range)#shutdown

SW2(config-if-range)#channel-protocol pagp

SW2(config-if-range)#channel-group 1 mode auto (on)

SW2(config-if-range)#no shutdown

 

・トランクポートの設定

トポロジ参照

(一例)

SW1(config)#interface fa1/6 - 8 , fa/13 - 15 , po1

SW1(config-if-range)#switchport trunk enc dot1q

SW1(config-if-range)#switchport mode dynamic desirable (trunk)

SW1(config-if-range)#switchport trunk allowed vlan add 3

SW2(config)#interface fa1/6 - 8 , po1

SW2(config-if-range)#switchport trunk enc dot1q

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

SW2(config-if-range)#switchport trunk allowed vlan add 3

SW3(config)#interface fa1/6 - 8 , fa/13 - 15

SW3(config-if-range)#switchport trunk enc dot1q

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

SW3(config-if-range)#switchport trunk allowed vlan add 3

 

・switchport にVLANを割り当てる設定

(一例)

SW2(conf)#interface fa1/0

SW2(conf-if)#switchport

SW2(conf-if)#switchport access vlan 3

SW3(conf)#interface fa1/0

SW3(conf-if)#switchport

SW3(conf-if)#switchport access vlan 3

 

DHCP SERVERの設定

(一例:SW1から、他のサーバに配布する)

SW1(config)#ip dhcp pool vlan3

SW1(dhcp-config)#network 3.3.3.1 255.255.255.0

SW1(dhcp-config)#default-router 3.3.3.1

SW1(config)#

SW1(config)#interface vlan3

SW1(config-if)#ip address 3.3.3.1 255.255.255.0

R1(config)#interface fa1/0

R1(config-if)#ip address dhcp

R1(config-if)#no shutdown

R2(config)#interface fa1/0

R2(config-if)#ip address dhcp

R2(config-if)#no shutdown

 

設定の確認方法

(確認方法の一例)

L2の隣接デバイス確認

#show cdp neighbors

VLANの確認:

#show vlan(-switch)

VTPの確認

#show vtp status

論理ポートの確認:

#show ip interface brief

トランクポートの確認

#show interface trunk

 

各スイッチに telnet 接続して、パスワード投入後、設定や確認を行いましょう。

各ルータがアドレスを取得したことも確認しましょう。

 

お疲れさまです。今回の実験は終了です。次回は、このトポロジを元に、踏み込んでいきたいと思ます。

次回をお楽しみに。

 

 

topology-1

こんなトポロジで遊んでいます。

VLANをSwitch-1 上で作成して、他のスイッチに伝搬させ、かつ、DHCPサーバとして動作させて、ルータにアドレスを配布する、って感じです。

 

f:id:intrajp:20171130051334p:plain

Switch-1#show ip dhcp server statistics
Memory usage 28077
Address pools 4
Database agents 0
Automatic bindings 8
Manual bindings 0
Expired bindings 0
Malformed messages 0
Secure arp entries 0

Message Received
BOOTREQUEST 0
DHCPDISCOVER 9
DHCPREQUEST 8
DHCPDECLINE 0
DHCPRELEASE 0
DHCPINFORM 0

Message Sent
BOOTREPLY 0
DHCPOFFER 9
DHCPACK 8
DHCPNAK 0

Switch-1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.10.10.11 0063.6973.636f.2d63. Mar 02 2002 01:40 AM Automatic
6130.352e.3039.3532.
2e30.3031.632d.4661.
312f.30
10.10.10.12 0063.6973.636f.2d63. Mar 02 2002 01:42 AM Automatic
6130.362e.3039.3731.
2e30.3031.632d.4661.
312f.30
10.10.10.34 0063.6973.636f.2d63. Mar 02 2002 06:45 AM Automatic
6130.352e.3039.3532.
2e30.3031.642d.4661.
312f.31
10.10.10.35 0063.6973.636f.2d63. Mar 02 2002 06:45 AM Automatic
6130.362e.3039.3731.
2e30.3031.642d.4661.
312f.31
20.20.20.98 0063.6973.636f.2d63. Mar 02 2002 07:06 AM Automatic
6130.382e.3039.3866.
2e30.3031.642d.4661.
312f.31
20.20.20.99 0063.6973.636f.2d63. Mar 02 2002 07:06 AM Automatic
6130.372e.3039.3830.
2e30.3031.632d.4661.
312f.30
30.30.30.2 0063.6973.636f.2d63. Mar 02 2002 06:48 AM Automatic
6130.382e.3039.3866.
2e30.3031.632d.4661.
312f.30
30.30.30.3 0063.6973.636f.2d63. Mar 02 2002 06:48 AM Automatic
6130.372e.3039.3830.
2e30.3031.642d.4661.
312f.31

Rtr-1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM administratively down down
FastEthernet1/0 10.10.10.11 YES DHCP up up
FastEthernet1/1 10.10.10.34 YES DHCP up up

Rtr-2#show ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM administratively down down
FastEthernet1/0 10.10.10.12 YES DHCP up up
FastEthernet1/1 10.10.10.35 YES DHCP up up

Rtr-3#show ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM administratively down down
FastEthernet1/0 20.20.20.99 YES DHCP up up
FastEthernet1/1 30.30.30.3 YES DHCP up up

Rtr-4#show ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM administratively down down
FastEthernet1/0 30.30.30.2 YES DHCP up up
FastEthernet1/1 20.20.20.98 YES DHCP up up

Rtr-1#ping 10.10.10.12
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.12, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 52/115/148 ms
Rtr-1#ping 10.10.10.35
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.35, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 64/127/180 ms
Rtr-1#ping 30.30.30.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.30.30.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 140/246/520 ms
Rtr-1#ping 30.30.30.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.30.30.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 132/330/568 ms
Rtr-1#ping 20.20.20.99
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.99, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 136/145/180 ms
Rtr-1#ping 20.20.20.98
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.98, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 224/309/584 ms

GNS3 で疑似的にインタフェースのスピードを変える方法

7200を利用すれば、Gig インタフェースが利用できますが、以下の様にしてもできるようです。

 

GNS3 | The software that empowers network professionals

 

なにかあればお知らせください。

Fedora27 で、GNS3 を動かす

Fedora27 にして、GNS3 を動かしてみたら、エラーになっていました。

直しました。結論的にいうと、gns3-gui は、Fedorarpm にして、gns3-server は、pip3 でインストールしました。

$ rpm -q gns3-gui

gns3-gui-2.1.0-0.rc3.fc27.noarch

---

$ pip3 list

...(snip)...

aiohttp (2.2.5)

...(snip)...

gns3-gui (2.1.0rc3)
gns3-net-converter (1.3.0)
gns3-server (2.1.0rc3)

...(snip)...

yarl (0.11.0)

 

$ gns3

しかしながら、、

-------------------------
今のところ、以下のバージョンしかうまくいかないみたいだ。
VirtualBox の、1.5.2 をダウンロードして、インポートする。
# pip3 install gns3-server==1.5.2
# pip3 install gns3-gui==1.5.2
# pip3 install aiohttp==1.1.6
# pip3 list
aiohttp (1.1.6)
gns3-gui (1.5.2)
gns3-net-converter (1.3.0)
gns3-server (1.5.2)
yarl (0.8.1)
デバッグ方法ー以下のコマンドで、立ち上がること。
$ gns3server
では、立ち上げてみる。
$ /usr/local/bin/gns3

お疲れさまです。何かあればお知らせください。

新人さんにポインタを教える

新人さん、said,

>int *x と *x の違いがよくわからない

Me said,

int* x の方が、理解しやすいと思います。
普通はあまりやらないみたいですけど。

実際に、プログラムを作って動かしてみると良いです。
例えば、以下のように。

1 #include <stdio.h>
2
3 int main() {
4 int* x;
5 int y;
6 int *y2;
7 int **z;
8 int ***z2;
9 y = 123;
10 y2 = &y;
11 x = y2;
12 z = &x;
13 z2 = &z;
14 printf ("%d\n",*x);
15 printf ("%d\n",y);
16 printf ("%d\n",*y2);
17 printf ("%d\n",**z);
18 printf ("%d\n",***z2);
19 return 0;
20 }

LVM のアーカイブファイル名の数字の限界は 5桁

以下のような実験で確かめました。

fdisk /dev/sdb
n
p
1
t
8e
w
mkfs.xfs /dev/sdb1
pvcreate /dev/sdb1
pvdisplay
vgcreate VgTest /dev/sdb1
vgdisplay
lvcreate -l 50%FREE -n LvTest VgTest
lvdisplay
vi /root/lv_test.sh
-------------
#!/bin/bash
while true
do
lvcreate -L 100M -n snap VgTest
sleep 1
lvremove -f /dev/VgTest/snap
done
-------------
chmod +x lv_test.sh

cd /etc/lvm/archive
ls -la
rm -f VgTest*
touch VgTest_99999-1234.vg

./lv_test.sh

ナンバリングが、インクリメントされることなく、以下のファイルが大量に作成されます。

VgTest_100000-<ランダムな数字>.vg

望ましい動作
100000 から、数字がインクリメントされていく。

何かあれば、お知らせください。

Fedora27 で Ruby 関連ソースパッケージをダウンロードする

お疲れさまです。

SHIRASAGI-hardening の RPM パッケージを作成してみた私ですが、あれ、Fedora なら、パッケージ色々とあるんじゃないか、とふと思いました。

ということで、以下のコマンドを実行しました。

$ cd

$ su

# dnf download --source ruby*

rubygems とかいっぱいダウンロードされました。

これは失敗した、どこかにディレクトリを作成してからやればよかった。

$ cd

$ mkdir RUBY

# chown me:me ruby*

# mv buby* RUBY

# ls lt | less

まだ先程ダウンロードしたファイルがあるようだ。me というホームディレクトリで、root でダウンロードしたので、時間的なことも考慮して移動させます。

# find ./ -type f -user root -maxdepth 1 -and -newermt '20171116' | xargs -I% mv % RUBY

できました。

# chown me:me RUBY -R

# exit

$ ls -l RUBY | wc -l

666

うわっ。

あるプロセスが使用しているメモリの正確な値を知る方法

お疲れさまです。あるプロセスが、どの程度メモリを使用しているかを知りたいという人がいると思います。

その回答となります。

例えば、 ps コマンドで以下のように出力してみます。
以下は、auditd のプロセスのみを取り出しました。

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
...(snip)...
root 885 0.0 0.0 56120 1936 ? S<sl 18:50 0:00 /sbin/auditd
...(snip)...

ここで、VSZ は、Virtual Set SiZe (仮想メモリのサイズ)
RSS は、Resident Set Size (物理メモリのサイズ)

と言われています。

これが、正確な値であるかどうかは、疑わしいです。
他の確認方法として、以下のコマンドを実行する方法があります。

# pmap -x <PID>

結構、いい感じですけど、
共有されているメモリなのか、自分だけに割り当てられているものなのかがわかりません。
そんなときに使えるのが、以下のコマンドです。

# cat /proc/<PID>/smaps

上記コマンドは、メモリをどの位使用しているかを正確に教えてくれます。
もっと重要なことには、メモリを private と shared に分割します。
したがって、いくつかのプログラムのインスタンスにより共有されているメモリを含めることなく、プログラムのインスタンスがどの程度メモリを使用しているかを、知ることができます。


(コマンド)
# pmap -x 885 | less
(結果の一部)
----------------------------
885: /sbin/auditd
Address Kbytes RSS Dirty Mode Mapping
0000560598052000 112 112 0 r-x-- auditd
0000560598052000 0 0 0 r-x-- auditd
000056059826e000 4 4 4 r---- auditd
000056059826e000 0 0 0 r---- auditd
000056059826f000 4 4 4 rw--- auditd
000056059826f000 0 0 0 rw--- auditd
0000560598270000 16 12 12 rw--- [ anon ]
...(snip)...
----------------------------
(コマンド)
# cat /proc/885/smaps | less
(結果の一部)
----------------------------
560598052000-56059806e000 r-xp 00000000 fd:00 3044478 /usr/sbin/auditd
Size: 112 kB
Rss: 112 kB
Pss: 112 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 112 kB
Private_Dirty: 0 kB
Referenced: 112 kB
Anonymous: 0 kB
LazyFree: 0 kB
AnonHugePages: 0 kB
ShmemPmdMapped: 0 kB
Shared_Hugetlb: 0 kB
Private_Hugetlb: 0 kB
Swap: 0 kB
SwapPss: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB
VmFlags: rd ex mr mw me dw sd
56059826e000-56059826f000 r--p 0001c000 fd:00 3044478 /usr/sbin/auditd
Size: 4 kB
Rss: 4 kB
Pss: 4 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
...(snip)...

これなら、あるプロセスが使用しているメモリについて知りたいことが、全て明らかになりすね。

(参考)
https://stackoverflow.com/questions/131303/how-to-measure-actual-memory-usage-of-an-application-or-process

 

何かあれば、お知らせください。

Fedora27 アップグレード後に shell に落ちたときの対処法

標記の件、アップグレードシーケンス終了後の最初の起動時に、/etc/os-release がないと言われ、shell に落とされました。

 

幸い、既にアップグレードできていた Fedora27 が手元にあったので調べてみると、/etc/os-release は /usr/lib/os-release へのシンボリックリンクとなっていて、/usr/lib/os-release は、/usr/lib/os.release.d/os-release-fedora へのシンボリックリンクとなっていました。

 

起動に失敗した OS には、/usr/lib/os.release.d/os-release-fedora がなかったです。

 

/sysroot を rw でマウントして、上記ファイルを以下の内容で作成しました。

続きを読む