RT1(config)#interface ethernet0/0
RT1(config-if)#ip address 10.1.1.1 255.255.255.0
RT1(config-if)#no shutdown
RT1(config-if)#exit
RT1(config)#ip route 10.1.2.0 255.255.255.0 ethernet0/0 10.1.1.254
RT2(config)#interface ethernet0/0
RT2(config-if)#ip address 10.1.2.2 255.255.255.0
RT2(config-if)#no shutdown
RT2(config-if)#exit
RT2(config)#ip route 10.1.1.0 255.255.255.0 ethernet0/0 10.1.2.254
SW1(config)#vlan 10,20
SW1(config-vlan)#exit
SW1(config)#interface ethernet0/0
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#interface ethernet0/1
SW1(config-if)#switchport access vlan 20
SW1(config-if)#exit
SW1(config)#interface vlan 10
SW1(config-if)#ip address 10.1.1.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.2.254 255.255.255.0
SW1(config-if)#no shutdown
VLAN 間ルーティングを行うにあたり、ROAS (Router on a Stick) 以外に SVI (Switch Virtual Interface) を用いる方法があります。
スイッチにはルーティング機能を持たない L2SW (Layer2 Switch) とルーティング機能を持つ L3SW (Layer3 Switch) が存在し、L3SW では SVI を設定したり、I/F mode を switchport から routed port に変更することでルーティングを実現できます。
SVI は vlan に紐づく仮想的なインタフェースであり、以下の条件を満たすと link up します。
SVI は以下コマンドで作成可能です。
(config)#interface vlan [vlan-id]
今回の問題文に従い SVI10 と SVI20 を作成します。
※回答にある通り vlan 作成が事前に必要です。
SW1(config)#interface vlan 10
SW1(config-if)#ip address 10.1.1.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.2.254 255.255.255.0
SW1(config-if)#no shutdown
設定後、作成した SVI が 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.1.254 YES manual up up
Vlan20 10.1.2.254 YES manual up up
そして、IP address を持つ機器が設定されたことで 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.1.0/24 is directly connected, Vlan10
L 10.1.1.254/32 is directly connected, Vlan10
C 10.1.2.0/24 is directly connected, Vlan20
L 10.1.2.254/32 is directly connected, Vlan20
最後に ping を実行し疎通確認を行います。
RT1 からの通信は SW1 に着信し、SW1 は上記の routing table に従い転送できるため、RT1(vlan10) と RT2(vlan20) の VLAN 間ルーティングが実現できることを確認できました。
RT1#ping 10.1.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
ログインすると、進捗を保存できます。
← VLAN 間ルーティングの設定(問題) に戻る