Sei sulla pagina 1di 19

R

SW

A B
R

SW

A B

SW

A B
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 172.20.1.1 255.255.255.0
Router(config-if)#no shutdown
00:01:03: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed
state to up
Router(config-if)#interface fastEthernet 1/0
Router(config-if)#ip address 172.20.2.1 255.255.255.0
Router(config-if)#no shutdown
00:01:52: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed
state to up
Router#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS
inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

172.20.0.0/24 is subnetted, 2 subnets


C 172.20.1.0 is directly connected, FastEthernet0/0
C 172.20.2.0 is directly connected, FastEthernet1/0
Router(config)#interface FastEthernet slot-number/port-
number.subinterface-number

Router(config-subif)#encapsulation encapsulation-type vlan-


number
Router(config)#interface fastEthernet 0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 172.20.1.1 255.255.255.0
Router(config-subif)#interface fastEthernet 0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 172.20.2.1 255.255.255.0
Router(config-subif)#interface fastEthernet 0/0
Router(config-if)#no shutdown
Router(config-if)#^Z
Router#show ip interface brief
Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 unassigned YES manual up up


FastEthernet0/0.10 172.20.1.1 YES manual up up
FastEthernet0/0.20 172.20.2.1 YES manual up up
Router#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS
inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

172.20.0.0/24 is subnetted, 2 subnets


C 172.20.1.0 is directly connected, FastEthernet0/0.10
C 172.20.2.0 is directly connected, FastEthernet0/0.20
R

Switch#configure terminal
Enter configuration commands, one per
line. End with CNTL/Z.
S1(config)#vlan 10
S1(config-vlan)#vlan 30 SW
S1(config-vlan)#exit
S1(config)#interface fas0/11
S1(config-if)#switchport access vlan 20
S1(config-if)#interface fas0/4
S1(config-if)#switchport access vlan 20
S1(config-if)#interface fas0/6 A B
S1(config-if)#switchport access vlan 10
S1(config-if)#interface fas0/5
S1(config-if)#switchport access vlan 10
R

Switch#configure terminal
Enter configuration commands, one per line. SW
End with CNTL/Z.
S1(config)#vlan 10
S1(config-vlan)#vlan 30
S1(config-vlan)#exit
S1(config)#interface fas0/5
S1(config-if)#switchport mode trunk A B

Potrebbero piacerti anche