Cum configuram un router cisco on a stick folosind trunk 802.1q

Configurare noua (How To)

Situatie

Ne-am decis sa implementam vlan-uri in retea insa avem un router care are putine interfete. Solutia pentru acesta problem este sa configuram router-ul ca si on stick. Pe o interfata de tip FastEthernet se vor configura subinterfete si se va activa protocolul 802.1q trunk.

Solutie

Pentru acest lucru se vor urma pasii urmatori:

ASKIT# enable

ASKIT# configure terminal
ASKIT(config)# interface fastethernet0/1
ASKIT(config-if)# no ip address
ASKIT(config-if)# duplex auto
ASKIT(config-if)# speed auto

 

Configuram subinterfetele si activam protocolul trunk 802.1q

 

ASKIT(config-if)# interface fastEthernet0/0.100
ASKIT(config-subif)# description Vlan 100
ASKIT(config-subif)# encapsulation dot1q 100
ASKIT(config-subif)# ip address 192.168.0.1 255.255.255.0

ASKIT(config-subif)# interface fastEthernet0/0.200
ASKIT(config-subif)# description Vlan 200
ASKIT(config-subif)# encapsulation dot1q 200
ASKIT(config-subif)# ip address 192.168.2.1 255.255.255.0

 

ASKIT(config-if)# interface fastEthernet0/0

ASKIT(config-if)# no shutdown
Urmatorul pas este sa cream VLAN-urile pe switch si sa configuram IP pe acestea:

SW1# enable

SW1# configure terminal

SW1(config)# vlan 200

SW1(config-vlan)# name Vlan200

SW1(config-vlan)# exit

 

SW1(config)# vlan 100

SW1(config-vlan)# name Vlan100

SW1(config-vlan)# exit

 

SW1(config)# interface vlan 100

SW1(config-if)# description Vlan100

SW1(config-if)# ip address 192.168.0.2 255.255.255.0

SW1(config-if)# exit

 

SW1(config)# interface vlan 200

SW1(config-if)# description Vlan100

SW1(config-if)# ip address 192.168.2.2 255.255.255.0

SW1(config-if)# exit

 

 

Ultimul pas pe care trebuie sa il facem este sa cream un port de tip trunk din switch in router.

SW1(config)# interface FastEthernet 0/1

SW1(config-if)# description Trunk-la-Router

SW1(config-if)# switchport trunk encapsulation dot1q

SW1(config-if)#switchport trunk allowed vlan 100,200

SW1(config-if)# switchport mode trunk

SW1(config-if)# spanning-tree portfast trunk

 

Se configura intefetele ca si mod access cu vlan-ul din care vor face parte.

 

SW1(config)#interface range fastEthernet 0/2

SW1(config-if-range)#switchport mode access

SW1(config-if-range)#switchport access vlan 100

 

SW1(config)#interface range fastEthernet 0/3

SW1(config-if-range)#switchport mode access

SW1(config-if-range)#switchport access vlan 100

 

SW1(config)#interface range fastEthernet 0/4

SW1(config-if-range)#switchport mode access

SW1(config-if-range)#switchport access vlan 200

 

SW1(config)#interface range fastEthernet 0/5

SW1(config-if-range)#switchport mode access

SW1(config-if-range)#switchport access vlan 100

 

Nu uitati sa folositi comanda: copy running-config startup-config , pentru salvare configuratii. Altfel la un restart la router sau switch tot ce ati facut se va pierde.

Tip solutie

Permanent

Voteaza

(4 out of 8 people found this article helpful)

Despre Autor

Leave A Comment?