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.3
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.3
RT3(config)#interface ethernet0/0
RT3(config-if)#no shutdown
RT3(config-if)#exit
RT3(config)#interface ethernet0/0.10
RT3(config-subif)#encapsulation dot1Q 10
RT3(config-subif)#ip address 10.1.1.3 255.255.255.0
RT3(config-subif)#no shutdown
RT3(config-subif)#exit
RT3(config)#interface ethernet0/0.20
RT3(config-subif)#encapsulation dot1Q 20
RT3(config-subif)#ip address 10.1.2.3 255.255.255.0
RT3(config-subif)#no shutdown
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 ethernet0/2
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk allowed vlan 10,20
ROAS (Router on a Stick) とは、L2スイッチを介して VLAN 間ルーティングを可能にするためのネットワーク構成を示します。
本問題では RT1 と RT3 が vlan10 に属しており、RT2 と RT3 が vlan20 に属しているため、RT3 が vlan10 と vlan20 間のルーティングを行う構成になっています。
RT3 - SW1 間は1つのインタフェースで接続されているため、これを実現するためには sub interface を設定する必要があります。
sub interface とは物理インタフェースに紐づく仮想インタフェースであり、指定した vlan tag に従いインタフェースを複数に分割することができます。
sub interface を作成する際は、以下のように設定します。
(config)#interface ethernet[インターフェス番号].[番号]
(config-subif)#encapsulation dot1Q [vlan-id]
番号は任意の値を設定しますが、管理上 vlan id に合わせたほうがわかりやすいです。
今回は以下のように2つの sub interface を作成します。
RT3(config)#interface ethernet0/0.10
(config-subif)#encapsulation dot1Q 10
RT3(config)#interface ethernet0/0.20
RT3(config-subif)#encapsulation dot1Q 20
これにより、RT3 の 10.1.1.3 (eth0/0.10) から送信されるフレームには tag 10 が、10.1.2.3 (eth0/0.20) から送信されるフレームには tag 20 が付与されます。
また、SW3 の eth0/2 (RT3 との接続インタフェース)は tag の付いたフレームを送受信するため、trunk port に設定する必要があります。
設定完了後、RT3 では以下のように sub interface の情報が show command で確認できます。
RT3#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES TFTP up up
Ethernet0/0.10 10.1.1.3 YES manual up up
Ethernet0/0.20 10.1.2.3 YES manual up up
Ethernet0/1 unassigned YES TFTP administratively down down
Ethernet0/2 unassigned YES TFTP administratively down down
Ethernet0/3 unassigned YES TFTP administratively down down
また、sub interface が作成され IP address が設定されたことで、それに対応する情報が Routing table に登録されます。
RT3#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, Ethernet0/0.10
L 10.1.1.3/32 is directly connected, Ethernet0/0.10
C 10.1.2.0/24 is directly connected, Ethernet0/0.20
L 10.1.2.3/32 is directly connected, Ethernet0/0.20
そして回答通りに各機器へ設定が完了すると、要件通り RT1 から RT2 で通信できることが確認できます。
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/2 ms
RT1#ping 10.1.2.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.2.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
ログインすると、進捗を保存できます。
← ROAS の設定(問題) に戻る