EtherChannelで束ねたポートに対して,IPアドレスを割り当てることもできます。
「レイヤー3EhterChannel」と呼ばれる機能です。
●レイヤー3EhterChannelの設定
レイヤー3EtherChannelの設定の流れは,以下のようになります。
まず,すべての物理ポート(Faインタフェース)と論理ポート(Poインタフェース)に「no switchport」コマンドを入れ,ポートをレイヤー3モードにします。
次に,論理ポートに対してIPアドレスを割り当てます。
SwitchA(config)#interface range fastEthernet 0/11 - 12
SwitchA(config-if-range)#no switchport
SwitchA(config-if-range)#no shutdown
SwitchA(config-if-range)#exit
SwitchA(config)#interface port-channel 1
SwitchA(config-if)#no switchport
SwitchA(config-if)#ip address 192.168.1.1 255.255.255.0
SwitchA(config-if)#no shutdown
同様に,SwitchBのport-channel1には,192.168.1.2を割り当てます。
設定は以上です。
●動作の確認
動作を確認してみましょう。
SwitchA(192.168.1.1)からSwitchB(192.168.1.2)にpingを打ってみます。
SwitchA#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
きちんと応答が返ってきました。
IPによる通信が成功していることがわかります。
SwitchAのEtherChannelの状態を見てみましょう。
SwitchA#show etherchannel summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use f - failed to allocate aggregator
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(RU) - Fa0/11(P) Fa0/12(P)
「Po1」(Port-channel1インタフェース)のフラグが「RU」となっています。
「R」は,このポートがレイヤー3(layer3)であることを示しています。
「U」は,このポートが利用中(in use)であることを示しています。
確かにPo1インタフェースは,IPアドレスが割り振られたレイヤー3のポートになってますね。
show interefaceコマンドを使ってPort-channel1インタフェースの様子も確認してみましょう。
SwitchA#show interfaces port-channel 1
Port-channel1 is up, line protocol is up (connected)
Hardware is EtherChannel, address is 000e.d7f6.9180 (bia 000e.d7f6.9180)
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 200000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Full-duplex, 100Mb/s, media type is 10/100BaseTX
input flow-control is off, output flow-control is unsupported
Members in this channel: Fa0/11 Fa0/12
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:01:29, output 00:01:29, 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
61651 packets input, 6640066 bytes, 0 no buffer
Received 8805 broadcasts (0 IP multicast)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 8802 multicast, 0 pause input
0 input packets with dribble condition detected
61655 packets output, 6649229 bytes, 0 underruns
0 output errors, 0 collisions, 16 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 PAUSE output
0 output buffer failures, 0 output buffers swapped out
up/upで,Port-channel1インタフェースがアップしていることがわかります。
また,「Hardware is EtherChannel」とあり,このインタフェースがEtherChannelであることがわかります。
このインタフェースに設定されたIPアドレス(192.168.1.1)も確認できます。
●おまけ
SwitchAでIPルーティングを有効にして,ルーティング・テーブルを見てみましょう。
SwitchA(config)#ip routing
SwitchA(config)#end
SwitchA#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, Port-channel1
192.168.1.0/24あてのパケットの出力インタフェースが「Port-channel1」となっているのがわかります。
|