

conf t
!
hostname RT1
!
interface Ethernet0/0
ip address 10.1.10.1 255.255.255.0
no shutdown
!
logging console
!
end
conf t
!
hostname RT2
!
interface Ethernet0/0
ip address 10.1.20.2 255.255.255.0
no shutdown
!
logging console
!
end
conf t
!
hostname SW1
!
vlan 10,20
!
interface Ethernet0/0
switchport access vlan 10
switchport mode access
no shutdown
!
interface Ethernet0/1
switchport access vlan 20
switchport mode access
no shutdown
!
logging console
!
end
SVI (Switched Virtual Interface) とは L3 スイッチに設定することができる特定の VLAN に紐づいた仮想インターフェースです。
これまでスイッチは MAC address table を参照したフレーム転送のみを行っていましたが、SVI を設定することで IP address を持つことができ、ルーティングを行うことができます。
今回の構成では SW1 が SVI10 (VLAN10) と SVI20 (VLAN20) を持っています。
そして、これらに IP address が設定されていることでスイッチ内部でルーティングが可能となり、10.1.10.0/24(VLAN10) と 10.1.20.0/24(VLAN20) で VLAN 間通信が可能となります。
では、実際に SW1 に SVI を設定し、VLAN 間ルーティングができることを確認していきましょう。
SVI の設定は以下のように行います。
(config)#interface vlan [vlan id]
今回は SW1 に対して以下の SVI を作成します。
SVI10 : 10.1.10.254/24
SW20 : 10.1.20.254/24
SW1(config)#interface vlan 10
SW1(config-if)#ip address 10.1.10.254 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#interface vlan 20
SW1(config-if)#ip address 10.1.20.254 255.255.255.0
SW1(config-if)#no shutdown
設定すると、show command で SVI が生成され up/up となっていることが確認できます。
SW1#show ip interface 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
Vlan10 10.1.10.254 YES manual up up
Vlan20 10.1.20.254 YES manual up up
SVI は VLAN に紐づく仮想的なインタフェースであるため、Link up するためには以下の条件を満たす必要があります。
1, SVI で指定した vlan が vlan database に存在する。
2, SVI で指定した vlan が割り当てられている物理インタフェースが1つ以上リンクアップしている。
念のため、それぞれ show command で確認してみましょう。
"show vlan brief" を実行すると、 VLAN 10 と VLAN 20 が database に存在することがわかります。
SW1#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et0/2, Et0/3
10 VLAN0010 active Et0/0
20 VLAN0020 active Et0/1
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
"show interface status" を実行すると、Eth0/0 と Eth0/1 が "connected" (link up) となっていることがわかります。
SW1#show interfaces status
Port Name Status Vlan Duplex Speed Type
Et0/0 connected 10 full auto 10/100/1000BaseTX
Et0/1 connected 20 full auto 10/100/1000BaseTX
Et0/2 connected 1 full auto 10/100/1000BaseTX
Et0/3 connected 1 full auto 10/100/1000BaseTX
続いて、"show ip route" を実行すると SVI10 と SVI20 が設定されたことで Routing table にこれらの持つネットワーク情報が登録されていることがわかります。
SW1#show ip route
Codes: L - local, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
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
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.1.10.0/24 is directly connected, Vlan10
L 10.1.10.254/32 is directly connected, Vlan10
C 10.1.20.0/24 is directly connected, Vlan20
L 10.1.20.254/32 is directly connected, Vlan20
これにより、RT1 (10.1.10.1) は SW1 の SVI10 (10.1.10.254) と通信できるようになりました。
RT1#ping 10.1.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.10.254, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
RT2 (10.1.20.2) と SW1 の SVI20 (10.1.20.254) も同様に通信可能です。
RT2#ping 10.1.20.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.20.254, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
最後に復習も兼ねて、RT1 (10.1.10.1) と RT2 (10.1.20.2) が通信できるよう各ルータに static route を設定してみましょう。
RT1(config)#ip route 10.1.20.0 255.255.255.0 ethernet0/0 10.1.10.254
RT2(config)#ip route 10.1.10.0 255.255.255.0 ethernet0/0 10.1.20.254
すると、SW1 で VLAN 間ルーティングが行われ、RT1 (10.1.10.1) と RT2 (10.1.20.2) が通信できることがわかります。
RT1#ping 10.1.20.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.20.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
RT1#traceroute 10.1.20.2
Type escape sequence to abort.
Tracing the route to 10.1.20.2
VRF info: (vrf in name/id, vrf out name/id)
1 10.1.10.254 1 msec 0 msec 1 msec
2 10.1.20.2 1 msec 2 msec *
SVI はネットワークを構築する際必ずといっていいほど使われる技術の1つです。
実環境では複数のネットワークを終端するコアスイッチといった役割で L3 スイッチが配置され、各ネットワークのゲートウェイとして SVI が設定されることが一般的です。
そのため、SVI の設定方法や動作についてはしっかりと理解を深めておきましょう。
ログインすると、進捗を保存できます。
← 2.1 VLAN に戻る