―S1のfa0/1をdynamic desirableモードに、fa0/2をdynamic autoモードに設定する
―S1のfa0/12をtrunkモードに設定して、さらにネゴシエーションフレームを無効化する
―S1のトランクを許可するVLANを、vlan10とvlan20のみとする
―S1のVLAN_10をネイティブVLANとして設定する

―R1のfa0/0.1とfa0/0.2にトランクプロトコルを指定する
―R1にサブインタフェースとして、fa0/0.1とfa0/0.2を設定する




■S1
S1(config)#vlan 10
S1(config-vlan)#name VLAN_10
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#name VLAN_20
S1(config-vlan)#exit
S1(config)#int fa0/1
S1(config-if)#switchport mode dynamic desirable
S1(config-if)#switchport access vlan 10
S1(config-if)#int fa0/2
S1(config-if)#switchport mode dynamic auto
S1(config-if)#switchport access vlan 20
S1(config-if)#int fa0/12
S1(config-if)#switchport mode trunk
S1(config-if)#switchport nonegotiate
S1(config-if)#switchport trunk allowed vlan 10,20
S1(config-if)#switchport trunk native vlan 10


S1#sh int fa0/1 switch
Name: Fa0/1
Switchport: Enabled
Administrative Mode: dynamic desirable
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: On
Access Mode VLAN: 10 (VLAN_10)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false

Voice VLAN: none (Inactive)
Appliance trust: none


S1#sh int fa0/2 swi
Name: Fa0/2
Switchport: Enabled
Administrative Mode: dynamic auto
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: On
Access Mode VLAN: 20 (VLAN_20)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false

Voice VLAN: none (Inactive)
Appliance trust: none


S1#sh int fa0/12 sw
Name: Fa0/12
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 10 (VLAN_10)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Operational private-vlan: none
Trunking VLANs Enabled: 10,20
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false

Voice VLAN: none (Inactive)
Appliance trust: none


■R1
R1(config)#int fa0/0.1
R1(config-subif)#encapsulation dot1q 10
R1(config-subif)#ip address 192.168.0.1 255.255.255.0
R1(config-subif)#no shut
R1(config-subif)#int fa0/0.2
R1(config-subif)#encapsulation dot1q 20
R1(config-subif)#ip address 192.168.1.1 255.255.255.0
R1(config-subif)#no shut
R1(config-subif)#end
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router rip
R1(config-router)#network 192.168.0.0
R1(config-router)#network 192.168.1.0
R1(config-router)#end


R1#sh int fa0/0.1
FastEthernet0/0.1 is up, line protocol is up
Hardware is AmdFE, address is 0009.7cb8.1e21 (bia 0009.7cb8.1e21)
Internet address is 192.168.0.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 10.
ARP type: ARPA, ARP Timeout 04:00:00
Last clearing of "show interface" counters never


R1#sh int fa0/0.2
FastEthernet0/0.2 is up, line protocol is up
Hardware is AmdFE, address is 0009.7cb8.1e21 (bia 0009.7cb8.1e21)
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 20.
ARP type: ARPA, ARP Timeout 04:00:00
Last clearing of "show interface" counters never


■192.168.0.100から192.168.1.100にping
C:\Documents and Settings\192.168.0.100>ping 192.168.1.100

Pinging 192.168.1.100 with 32 bytes of data:

Reply from 192.168.1.100: bytes=32 time<1ms TTL=128
Reply from 192.168.1.100: bytes=32 time<1ms TTL=128
Reply from 192.168.1.100: bytes=32 time<1ms TTL=128
Reply from 192.168.1.100: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.100:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms