0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cisco VLAN間ルーティング設定まとめ|SVIとRouter-on-a-stickの違いと設定コマンド

0
Posted at

Cisco VLAN間ルーティング設定まとめ|SVIとRouter-on-a-stickの違いと設定コマンド

VLANを切ったあとに必ず出てくる「別VLAN同士で通信させたい」という要件。L3スイッチでSVIを使うか、L2スイッチ+ルーターでRouter-on-a-stickを組むか。実機検証ベースで両方の設定手順と違いをまとめました。

SVIとRouter-on-a-stickの違い

比較項目 SVI(L3スイッチ) Router-on-a-stick
処理方式 ハードウェアASIC処理 ソフトウェアCPU処理
スループット目安 数Gbps〜数十Gbps 数百Mbps〜1Gbps程度
必要機器 L3スイッチ1台 L2スイッチ+ルーター
向いている規模 中規模〜大規模オフィス 小規模・検証環境・拠点
運用しやすさ SVIごとに整理しやすい 物理障害でVLAN全滅の恐れ

中規模以上はSVI一択、小規模拠点や検証用ならRouter-on-a-stickという感じで使い分けるのが現実的です。

SVI(L3スイッチ)の設定手順

Catalyst 9300での設定例。VLAN10(営業)とVLAN20(開発)を切ってSVIで繋ぎます。

Catalyst-9300
SW1(config)# vlan 10
SW1(config-vlan)# name SALES
SW1(config)# vlan 20
SW1(config-vlan)# name DEV

SW1(config)# interface vlan 10
SW1(config-if)# ip address 192.168.10.1 255.255.255.0
SW1(config-if)# no shutdown

SW1(config)# interface vlan 20
SW1(config-if)# ip address 192.168.20.1 255.255.255.0
SW1(config-if)# no shutdown

! ★これが必須
SW1(config)# ip routing

ip routing の入れ忘れで永遠にpingが通らない、というのは深夜帯のメンテで一度はやらかすパターンです。

Router-on-a-stickの設定手順

L2スイッチからルーターへトランクで持ってきて、ルーター側でサブインターフェースを切ります。

L2-Switch
SW1(config)# interface Gi1/0/24
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport mode trunk
SW1(config-if)# switchport trunk allowed vlan 10,20
ISR-4321
R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# no shutdown

R1(config)# interface GigabitEthernet0/0/1.10
R1(config-subif)# encapsulation dot1Q 10
R1(config-subif)# ip address 192.168.10.1 255.255.255.0

R1(config)# interface GigabitEthernet0/0/1.20
R1(config-subif)# encapsulation dot1Q 20
R1(config-subif)# ip address 192.168.20.1 255.255.255.0

ポイントは encapsulation dot1Q [VLAN ID] でVLAN番号を明示する箇所。サブインターフェース番号(.10とか.20)はあくまで識別用で、本物のVLAN番号ではないので注意。

通らないときの切り分け

症状 原因 対処
SVI同士でping不通 ip routing無効 グローバルでip routing
SVIがadmin down no shutdown忘れ int vlanでno shutdown
片VLANだけ通信不可 trunk allowed vlanにない switchport trunk allowed vlan add
サブIF無反応 親IFがshutdown 親IFでno shutdown
時々パケロス Router CPU過負荷 show processes cpu確認、L3SW移行検討

show系で1つずつ潰すのが結局一番早いです。reloadは最後の手段。

詳しくはブログで

この記事の完全版(実機の確認コマンド出力例・FAQ・ハマりどころの体験談など)はブログで公開しています。

👉 Cisco VLAN間ルーティング設定手順|SVIとRouter-on-a-stickの使い分け【実機検証】

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?